|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.pluginsimpl.local.ipc.IPCInterfaceImpl
public class IPCInterfaceImpl
Constructor Summary | |
---|---|
IPCInterfaceImpl(Object _target)
Constructor for non-plugin providers |
|
IPCInterfaceImpl(PluginInitializer _plugin_initializer,
Plugin _target)
Constructor for real plugin based providers. |
Method Summary | |
---|---|
boolean |
canInvoke(String methodName,
Class<?>[] params)
|
boolean |
canInvoke(String methodName,
Object[] params)
Test for existance of IPC method - params as above |
protected Method |
getMethod(Object target,
String methodName,
Class<?>[] paramTypes)
|
protected Method |
getMethod(Object target,
String methodName,
Object[] params)
|
protected Object |
getTarget()
|
Object |
invoke(String methodName,
Object[] params)
This function will call the given method on the plugin. |
void |
unload()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IPCInterfaceImpl(PluginInitializer _plugin_initializer, Plugin _target)
_plugin_initializer
- _target
- public IPCInterfaceImpl(Object _target)
_target
- Method Detail |
---|
public boolean canInvoke(String methodName, Object[] params)
IPCInterface
canInvoke
in interface IPCInterface
public boolean canInvoke(String methodName, Class<?>[] params)
public Object invoke(String methodName, Object[] params) throws IPCException
IPCInterface
int
, boolean
need to be wrapped in their
Objects (int -> Integer).
Results will be returned as Object and can be classcasted.
WARNING: only call Methods that use Java or Azureus Classes the use of custom classes may cause problems.
Examples:
1.
Plugin has method
int add (int x, int y);
int result = ((Integer)invoke ("add", new Object[] {Integer.valueOf(10),Integer.valueOf(5)}).intValue(); //result (15)2. Plugin has method
String randomize (String x);
String result = (String)invoke("randomize", new Object[]{"foobar"}); //result ("bfaoro")
invoke
in interface IPCInterface
methodName
- the name of the Methods to be calledparams
- Parameters of the Method
IPCException
protected Method getMethod(Object target, String methodName, Object[] params) throws Throwable
Throwable
protected Method getMethod(Object target, String methodName, Class<?>[] paramTypes) throws Throwable
Throwable
protected Object getTarget() throws IPCException
IPCException
public void unload()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |