|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.ipojo.util.Callback
org.apache.felix.ipojo.handlers.dependency.DependencyCallback
public class DependencyCallback
This class allwos the creation of callback when service dependency arrives or disappear.
Field Summary | |
---|---|
static int |
BIND
Bind method (called when a service arrives). |
static int |
UNBIND
Unbind method (called when a service disappears). |
Fields inherited from class org.apache.felix.ipojo.util.Callback |
---|
m_methodObj |
Constructor Summary | |
---|---|
DependencyCallback(Dependency dep,
java.lang.String method,
int methodType)
Constructor. |
Method Summary | |
---|---|
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). |
Methods inherited from class org.apache.felix.ipojo.util.Callback |
---|
call, call, call, call, getMethod |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BIND
public static final int UNBIND
Constructor Detail |
---|
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
methodMethod Detail |
---|
public 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 object
java.lang.NoSuchMethodException
- : Method is not found in the class
java.lang.reflect.InvocationTargetException
- : The method is not static
java.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 object
java.lang.NoSuchMethodException
- : the method is not found
java.lang.IllegalAccessException
- : the method could not be called
java.lang.reflect.InvocationTargetException
- : an error happens in the called method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |