|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.qtunes.auth.control.ControlMethodInvoker
public class ControlMethodInvoker
The ControlMethodInvoker takes a method description to its "invoke" method and invokes the matching {link ControlMethod}.
Constructor Summary | |
---|---|
ControlMethodInvoker(ServiceContext context)
Create a new ControlMethodInvoker |
Method Summary | |
---|---|
protected java.lang.Object |
convert(java.lang.Object o,
java.lang.Class paramclass)
|
java.util.List<java.lang.reflect.Method> |
getControlMethods(java.lang.Object o)
|
java.lang.Object |
getObject(java.lang.String objectname)
Given the name of an Object, return the Object itself. |
java.lang.Object |
invoke(ServiceContext context,
java.lang.String objectname,
java.util.List<Call> calls)
Invoke a ControlMethod on an Object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ControlMethodInvoker(ServiceContext context)
qtunes
- the qtunes;Method Detail |
---|
public java.lang.Object getObject(java.lang.String objectname)
objectname
- the name of the Object
public java.lang.Object invoke(ServiceContext context, java.lang.String objectname, java.util.List<Call> calls) throws java.lang.Throwable
ControlMethod
on an Object. The object will be searched
for a matching method, and the arguments - specified in the "args" map as either
positional values like {1:"value1", 2:"value2"}
, or by name eg
{"track":"1", "index":0}
. This class will attempt to cast the
parameters (say converting "Album" into Field.Album
an arrays into
BitSet
objects), and if that succeeds then it will call the method
and return the return value or Void.TYPE
if the method returns
no value.
qtunes
- the QTunesobjectname
- the name of the Object, to be passed in to getObject(java.lang.String)
methodname
- the name of the method on the Object to invokeargs
- the parameters. These will be matched against the paramaters of the ControlMethod
by type, using the convert(java.lang.Object, java.lang.Class)
method to type match if necessary
Void.TYPE
if the method has no return
java.lang.Throwable
protected java.lang.Object convert(java.lang.Object o, java.lang.Class paramclass) throws java.lang.Exception
java.lang.Exception
public java.util.List<java.lang.reflect.Method> getControlMethods(java.lang.Object o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |