public class DependencyCallback
extends org.apache.felix.ipojo.util.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).
|
Constructor and Description |
---|
DependencyCallback(Dependency dep,
String method,
int methodType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
call(org.osgi.framework.ServiceReference ref,
Object obj)
Call the callback method with a service reference.
|
protected void |
callOnInstance(Object instance,
org.osgi.framework.ServiceReference ref,
Object obj)
Call the callback on the given instance with the given argument.
|
String |
getMethodName() |
int |
getMethodType() |
protected void |
searchMethod()
Search the method object in the POJO by analyzing present method.
|
void |
setArgument(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, 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 String getMethodName()
public void setArgument(String[] arg)
arg
- : the array of argument types.protected void searchMethod()
searchMethod
in class org.apache.felix.ipojo.util.Callback
protected void call(org.osgi.framework.ServiceReference ref, Object obj) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
ref
- : the service reference to send to the methodobj
- : the service objectNoSuchMethodException
- : Method is not found in the classInvocationTargetException
- : The method is not staticIllegalAccessException
- : The method can not be invokedprotected void callOnInstance(Object instance, org.osgi.framework.ServiceReference ref, Object obj) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
instance
- : the instance on which call the callbackref
- : the service reference to send to the callbackobj
- : the service objectNoSuchMethodException
- : the method is not foundIllegalAccessException
- : the method could not be calledInvocationTargetException
- : an error happens in the called methodCopyright © 2012-2013 Adele Team | LIG. All Rights Reserved.