|
||||||||||
| 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,
String method,
int methodType)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
call(ServiceReference ref,
Object obj)
Call the callback method with a service reference. |
protected void |
callOnInstance(Object instance,
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). |
| 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,
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
method| Method Detail |
|---|
public int getMethodType()
public String getMethodName()
public void setArgument(String[] arg)
arg - : the array of argument types.protected void searchMethod()
searchMethod in class Callback
protected void call(ServiceReference ref,
Object obj)
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException
ref - : the service reference to send to the methodobj - : the service object
NoSuchMethodException - : Method is not found in the class
InvocationTargetException - : The method is not static
IllegalAccessException - : The method can not be invoked
protected void callOnInstance(Object instance,
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 object
NoSuchMethodException - : the method is not found
IllegalAccessException - : the method could not be called
InvocationTargetException - : an error happens in the called method
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||