|
||||||||||
| 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.handler.temporal.TemporalDependency
public class TemporalDependency
Temporal dependency. A temporal dependency waits (block) for the availability of the service. If no provider arrives in the specified among of time, a runtime exception is thrown.
| Nested Class Summary | |
|---|---|
private class |
TemporalDependency.ProxyFactory
Creates proxy object for proxied scalar dependencies. |
| Field Summary | |
|---|---|
private boolean |
m_collection
The dependency is injected as a collection. |
private java.lang.String |
m_di
The default implementation. |
private PrimitiveHandler |
m_handler
The handler managing this dependency. |
private java.lang.Object |
m_nullableObject
The Nullable object or Default-Implementation instance if used. |
private int |
m_policy
The timeout policy. |
private boolean |
m_proxy
Enables the proxy mode. |
private java.lang.Object |
m_proxyObject
The proxy object. |
private long |
m_timeout
The timeout. |
private ServiceUsage |
m_usage
Service Usage (Thread Local). |
| 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 | |
|---|---|
TemporalDependency(java.lang.Class spec,
boolean agg,
boolean collection,
boolean proxy,
org.osgi.framework.Filter filter,
org.osgi.framework.BundleContext context,
long timeout,
int policy,
java.lang.String defaultImpl,
TemporalHandler handler)
Creates a temporal dependency. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getService()
Called by the proxy to get a service object to delegate a method. |
private java.lang.Object |
getServiceObjects(org.osgi.framework.ServiceReference[] refs)
Creates and returns object to inject in the dependency. |
(package private) long |
getTimeout()
|
void |
onDependencyReconfiguration(org.osgi.framework.ServiceReference[] arg0,
org.osgi.framework.ServiceReference[] arg1)
The dependency has been reconfigured. |
void |
onEntry(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.Object[] args)
A POJO method will be invoked. |
void |
onError(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.Throwable throwable)
A POJO method has thrown an error. |
void |
onExit(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.Object returnedObj)
A POJO method has returned. |
void |
onFinally(java.lang.Object pojo,
java.lang.reflect.Method method)
A POJO method is finished. |
java.lang.Object |
onGet(java.lang.Object arg0,
java.lang.String arg1,
java.lang.Object arg2)
The code require a value of the monitored field. |
void |
onServiceArrival(org.osgi.framework.ServiceReference ref)
A provider arrives. |
void |
onServiceDeparture(org.osgi.framework.ServiceReference arg0)
A provider leaves. |
void |
onServiceModification(org.osgi.framework.ServiceReference arg0)
A provider is modified. |
void |
onSet(java.lang.Object arg0,
java.lang.String arg1,
java.lang.Object arg2)
The monitored field receives a value. |
(package private) java.lang.Object |
onTimeout()
Implements the timeout policy according to the specified configuration. |
void |
start()
Start method. |
void |
stop()
Stop method. |
| 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, isFrozen, isOptional, loadSpecification, manageModification, match, modifiedService, removedService, setAggregate, setBindingPolicy, setBundleContext, setComparator, setFilter, setOptionality, setSpecification, unfreeze, ungetService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private long m_timeout
private java.lang.String m_di
private java.lang.Object m_nullableObject
Nullable object or Default-Implementation instance if used.
private PrimitiveHandler m_handler
private int m_policy
Nullable injects a nullable object or
an array with a nullable object, Default-Implementation injects an object
created from the specified injected implementation or an array with it
Empty array inject an empty array (must be an aggregate dependency) No
policy (0) throw a runtime exception when the timeout occurs *
private boolean m_collection
Collection type
private boolean m_proxy
private ServiceUsage m_usage
private java.lang.Object m_proxyObject
| Constructor Detail |
|---|
public TemporalDependency(java.lang.Class spec,
boolean agg,
boolean collection,
boolean proxy,
org.osgi.framework.Filter filter,
org.osgi.framework.BundleContext context,
long timeout,
int policy,
java.lang.String defaultImpl,
TemporalHandler handler)
spec - the service specificationagg - is the dependency aggregate ?collection - the dependency field is a collectionproxy - enable the proxy-modefilter - the LDAP filtercontext - service contexttimeout - timeouthandler - Handler managing this dependencydefaultImpl - class used as default-implementationpolicy - onTimeout policy| Method Detail |
|---|
public void onDependencyReconfiguration(org.osgi.framework.ServiceReference[] arg0,
org.osgi.framework.ServiceReference[] arg1)
onDependencyReconfiguration in class DependencyModelarg0 - new service referencesarg1 - old service referencesDependencyModel.onDependencyReconfiguration(org.osgi.framework.ServiceReference[],
org.osgi.framework.ServiceReference[])public void onServiceArrival(org.osgi.framework.ServiceReference ref)
onServiceArrival in class DependencyModelref - service reference of the new provider.DependencyModel.onServiceArrival(org.osgi.framework.ServiceReference)public void onServiceDeparture(org.osgi.framework.ServiceReference arg0)
onServiceDeparture in class DependencyModelarg0 - leaving service references.DependencyModel.onServiceDeparture(org.osgi.framework.ServiceReference)public void onServiceModification(org.osgi.framework.ServiceReference arg0)
onServiceModification in class DependencyModelarg0 - leaving service references.DependencyModel.onServiceDeparture(org.osgi.framework.ServiceReference)
public java.lang.Object onGet(java.lang.Object arg0,
java.lang.String arg1,
java.lang.Object arg2)
onGet in interface FieldInterceptorarg0 - POJO instance asking for the servicearg1 - field namearg2 - previous value
FieldInterceptor.onGet(java.lang.Object, java.lang.String, java.lang.Object)
public void onEntry(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.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(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.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(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.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(java.lang.Object pojo,
java.lang.reflect.Method method)
onFinally in interface MethodInterceptorpojo - : POJO object.method - : Method object.MethodInterceptor.onFinally(java.lang.Object, java.lang.reflect.Method)private java.lang.Object getServiceObjects(org.osgi.framework.ServiceReference[] refs)
refs - the available service references
public java.lang.Object getService()
public void start()
start in class DependencyModelDependencyModel.start()public void stop()
stop in class DependencyModelDependencyModel.stop()
public void onSet(java.lang.Object arg0,
java.lang.String arg1,
java.lang.Object arg2)
onSet in interface FieldInterceptorarg0 - POJO setting the value.arg1 - field namearg2 - received valueFieldInterceptor.onSet(java.lang.Object, java.lang.String, java.lang.Object)java.lang.Object onTimeout()
long getTimeout()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||