public class DependencyCallback extends Callback
Modifier and Type | Field and Description |
---|---|
static int |
BIND
Bind method (called when a service arrives).
|
static int |
MODIFIED
Updated method (called when a service is modified).
|
static int |
UNBIND
Unbind method (called when a service disappears).
|
m_methodObj
Constructor and Description |
---|
DependencyCallback(Dependency dep,
java.lang.String method,
int methodType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
call(org.osgi.framework.ServiceReference ref,
java.lang.Object obj)
Call the callback method with a service reference.
|
protected void |
callOnInstance(java.lang.Object instance,
org.osgi.framework.ServiceReference ref,
java.lang.Object obj)
Call the callback on the given instance with the given argument.
|
java.lang.String |
getMethodName() |
int |
getMethodType() |
protected void |
searchMethod()
Search the method object in the POJO by analyzing present method.
|
void |
setArgument(java.lang.String[] arg)
Set the argument type (Empty or the class name).
|
public static final int BIND
public static final int UNBIND
public static final int MODIFIED
public DependencyCallback(Dependency dep, java.lang.String method, int methodType)
dep
- : the dependency attached to this dependency callbackmethod
- : the method to callmethodType
- : is the method to call a bind method or an unbind
methodpublic int getMethodType()
public java.lang.String getMethodName()
public void setArgument(java.lang.String[] arg)
arg
- : the array of argument types.protected void searchMethod()
searchMethod
in class Callback
protected void call(org.osgi.framework.ServiceReference ref, java.lang.Object obj) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
ref
- : the service reference to send to the methodobj
- : the service objectjava.lang.NoSuchMethodException
- : Method is not found in the classjava.lang.reflect.InvocationTargetException
- : The method is not staticjava.lang.IllegalAccessException
- : The method can not be invokedprotected void callOnInstance(java.lang.Object instance, org.osgi.framework.ServiceReference ref, java.lang.Object obj) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
instance
- : the instance on which call the callbackref
- : the service reference to send to the callbackobj
- : the service objectjava.lang.NoSuchMethodException
- : the method is not foundjava.lang.IllegalAccessException
- : the method could not be calledjava.lang.reflect.InvocationTargetException
- : an error happens in the called methodCopyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.