|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.telephony.media.provider.Request
Represents an API method request on a MediaGroup.
A Request is a Method plus some args. When the request is invoked, the indicated Method is invoked (on the given MPI.MediaGroup) with the previously supplied args.
Requests are created in BasicMediaService, and invoked in Base_MediaService. This technique allows Base_MediaService to invoke methods that are beyond the pre-defined MPI methods; including all the Resource methods.
This class includes a static wrapper around reflect.getMethod(...) which catches any exceptions, so that method can be used in static initializers to find the required Method.
The constructor comes in various flavors with different numbers of Object arguments, and a couple with strategically placed int args. These are sufficient to handle the S.410 media resource methods.
This bit of reflection allows the MediaGroup object and its public methods to be hidden from the application.
Constructor Summary | |
Request(java.lang.reflect.Method method)
|
|
Request(java.lang.reflect.Method method,
int arg0,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
|
|
Request(java.lang.reflect.Method method,
java.lang.Object arg0)
|
|
Request(java.lang.reflect.Method method,
java.lang.Object[] arglist)
|
|
Request(java.lang.reflect.Method method,
java.lang.Object arg0,
int arg1,
java.lang.Object arg2,
java.lang.Object arg3)
|
|
Request(java.lang.reflect.Method method,
java.lang.Object arg0,
java.lang.Object arg1)
|
|
Request(java.lang.reflect.Method method,
java.lang.Object arg0,
java.lang.Object arg1,
java.lang.Object arg2)
|
|
Request(java.lang.reflect.Method method,
java.lang.Object arg0,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
|
|
Request(java.lang.reflect.Method method,
java.lang.Object arg0,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
|
Method Summary | |
java.lang.reflect.Method |
getMethod()
return the internal, cached Method, so one can look up the declaring class. |
java.lang.Object |
invoke(MPI.MediaGroup group)
Invoke this Request on the target object. |
static java.lang.reflect.Method |
theMethod(java.lang.Class clas,
java.lang.String name,
java.lang.Class[] argtypes)
Find the indicated Method. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Request(java.lang.reflect.Method method, java.lang.Object[] arglist)
public Request(java.lang.reflect.Method method)
public Request(java.lang.reflect.Method method, java.lang.Object arg0)
public Request(java.lang.reflect.Method method, java.lang.Object arg0, java.lang.Object arg1)
public Request(java.lang.reflect.Method method, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
public Request(java.lang.reflect.Method method, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
public Request(java.lang.reflect.Method method, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
public Request(java.lang.reflect.Method method, int arg0, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
public Request(java.lang.reflect.Method method, java.lang.Object arg0, int arg1, java.lang.Object arg2, java.lang.Object arg3)
Method Detail |
public java.lang.reflect.Method getMethod()
public java.lang.Object invoke(MPI.MediaGroup group)
The Request.method is not invoked directly on the given MPI.MediaGroup. The MPI.MediaGroup is allowed to delegate the method to any implementation object. The MPI.MediaGroup implementation should return the proper object for each method as the value of MPI.MediaGroup.getTargetForMethod(java.lang.reflect.Method).
If an Exception is generated, either by Method.invoke() or by the actual method implementation, it is wrapped as a RuntimeException and thrown.
Note: for media resource methods, most exceptions are bundled into the return value.
group
- the MPI.MediaGroup on which this request is invoked.java.lang.RuntimeException
- if any Throwable/Exception is generated.public static java.lang.reflect.Method theMethod(java.lang.Class clas, java.lang.String name, java.lang.Class[] argtypes)
|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |