|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.ipojo.util.DependencyModel
org.apache.felix.ipojo.handlers.dependency.Dependency
public class Dependency
Represent a service dependency of the component instance.
| Field Summary |
|---|
| Fields inherited from class org.apache.felix.ipojo.util.DependencyModel |
|---|
BROKEN, DYNAMIC_BINDING_POLICY, DYNAMIC_PRIORITY_BINDING_POLICY, RESOLVED, STATIC_BINDING_POLICY, UNRESOLVED |
| Constructor Summary | |
|---|---|
Dependency(DependencyHandler handler,
String field,
Class spec,
Filter filter,
boolean isOptional,
boolean isAggregate,
boolean nullable,
String identity,
BundleContext context,
int policy,
Comparator cmp,
String defaultImplem)
Dependency constructor. |
|
| Method Summary | |
|---|---|
protected void |
addDependencyCallback(DependencyCallback callback)
Add a callback to the dependency. |
protected DependencyCallback[] |
getCallbacks()
|
String |
getDefaultImplementation()
|
String |
getField()
|
DependencyHandler |
getHandler()
|
String |
getId()
|
List |
getServiceReferencesAsList()
Get the used service references list. |
boolean |
isFrozen()
Is the reference set frozen (cannot change anymore)? This method must be override by concrete dependency to support the static binding policy. |
boolean |
isServiceLevelRequirement()
|
void |
onDependencyReconfiguration(ServiceReference[] departs,
ServiceReference[] arrivals)
The dependency has been reconfigured. |
void |
onEntry(Object pojo,
Method method,
Object[] args)
A POJO method will be invoked. |
void |
onError(Object pojo,
Method method,
Throwable throwable)
A POJO method has thrown an error. |
void |
onExit(Object pojo,
Method method,
Object returnedObj)
A POJO method has returned. |
void |
onFinally(Object pojo,
Method method)
A POJO method is finished. |
Object |
onGet(Object pojo,
String fieldName,
Object value)
This method is called by the replaced code in the component implementation class. |
protected void |
onObjectCreation(Object pojo)
Call the bind method. |
void |
onServiceArrival(ServiceReference reference)
A new service has to be injected. |
void |
onServiceDeparture(ServiceReference ref)
A used (already injected) service disappears. |
void |
onSet(Object pojo,
String fieldName,
Object value)
The field was set. |
void |
resetLocalCache()
Reset the thread local cache if used. |
void |
setServiceLevelDependency()
Set that this dependency is a service level dependency. |
void |
setSpecification(Class spec)
Set the specification of the current dependency. |
protected void |
setType(int type)
Set the type to inject. |
void |
start()
Start the dependency. |
void |
stop()
Stop the current dependency. |
boolean |
supportsNullable()
Gets true if the dependency use Nullable objects. |
| Methods inherited from class org.apache.felix.ipojo.util.DependencyModel |
|---|
addedService, addingService, getBindingPolicy, getComparator, getComparator, getFilter, getPolicy, getService, getServiceReference, getServiceReferences, getSize, getSpecification, getState, getUsedServiceReferences, isAggregate, isOptional, loadSpecification, match, modifiedService, onServiceModification, removedService, setAggregate, setBindingPolicy, setBundleContext, setComparator, setFilter, setOptionality, ungetService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Dependency(DependencyHandler handler,
String field,
Class spec,
Filter filter,
boolean isOptional,
boolean isAggregate,
boolean nullable,
String identity,
BundleContext context,
int policy,
Comparator cmp,
String defaultImplem)
handler - : the dependency handler managing this dependencyfield - : field of the dependencyspec - : required specificationfilter - : LDAP filter of the dependencyisOptional - : is the dependency an optional dependency ?isAggregate - : is the dependency an aggregate dependencynullable - : describe if the nullable ability is enable or disableidentity - : id of the dependency, may be nullcontext - : bundle context (or service context) to use.policy - : resolution policycmp - : comparator to sort referencesdefaultImplem - : default-implementation class| Method Detail |
|---|
public void setSpecification(Class spec)
setSpecification in class DependencyModelspec - : request service ClassDependencyModel.setSpecification(java.lang.Class)public String getField()
protected void addDependencyCallback(DependencyCallback callback)
callback - : callback to addpublic void stop()
stop in class DependencyModelDependencyModel.stop()public DependencyHandler getHandler()
public boolean isFrozen()
DependencyModelfalse by default.
The method must always return false for non-static dependencies.
isFrozen in class DependencyModeltrue if the reference set is frozen.protected void onObjectCreation(Object pojo)
pojo - : pojo instance on which calling the bind method.public void start()
start in class DependencyModelDependencyModel.computeDependencyState()protected DependencyCallback[] getCallbacks()
public void setServiceLevelDependency()
public String getId()
public boolean isServiceLevelRequirement()
public void onServiceArrival(ServiceReference reference)
onServiceArrival in class DependencyModelreference - : the new matching service reference.DependencyModel.onServiceArrival(org.osgi.framework.ServiceReference)public void onServiceDeparture(ServiceReference ref)
onServiceDeparture in class DependencyModelref - : leaving service reference.DependencyModel.onServiceDeparture(org.osgi.framework.ServiceReference)
public void onDependencyReconfiguration(ServiceReference[] departs,
ServiceReference[] arrivals)
onDependencyReconfiguration in class DependencyModeldeparts - : no more matching services.arrivals - : new servicesDependencyModel.onDependencyReconfiguration(org.osgi.framework.ServiceReference[], org.osgi.framework.ServiceReference[])public void resetLocalCache()
public List getServiceReferencesAsList()
public Object onGet(Object pojo,
String fieldName,
Object value)
onGet in interface FieldInterceptorpojo - : POJO object.fieldName - : fieldvalue - : last value.
FieldInterceptor.onGet(java.lang.Object, java.lang.String, java.lang.Object)
public void onSet(Object pojo,
String fieldName,
Object value)
onSet in interface FieldInterceptorpojo - : POJO objectfieldName - : field namevalue - : set value.FieldInterceptor.onSet(java.lang.Object, java.lang.String, java.lang.Object)
public void onEntry(Object pojo,
Method method,
Object[] args)
onEntry in interface MethodInterceptorpojo - : Pojo objectmethod - : called methodargs - : argumentsMethodInterceptor.onEntry(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
public void onError(Object pojo,
Method method,
Throwable throwable)
onError in interface MethodInterceptorpojo - : POJO object.method - : Method object.throwable - : thrown errorMethodInterceptor.onError(java.lang.Object, java.lang.reflect.Method, java.lang.Throwable)
public void onExit(Object pojo,
Method method,
Object returnedObj)
onExit in interface MethodInterceptorpojo - : POJO object.method - : Method object.returnedObj - : returned object (null for void method)MethodInterceptor.onExit(java.lang.Object, java.lang.reflect.Method, java.lang.Object)
public void onFinally(Object pojo,
Method method)
onFinally in interface MethodInterceptorpojo - : POJO object.method - : Method object.MethodInterceptor.onFinally(java.lang.Object, java.lang.reflect.Method)public boolean supportsNullable()
public String getDefaultImplementation()
protected void setType(int type)
type - either list of vector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||