public class OsgiServiceLifecycleListenerAdapter extends java.lang.Object implements OsgiServiceLifecycleListener, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanFactoryAware
| Modifier and Type | Field and Description |
|---|---|
private org.springframework.beans.factory.BeanFactory |
beanFactory
target bean factory
|
private java.lang.String |
bindMethod |
private java.util.Map<java.lang.Class<?>,java.util.List<java.lang.reflect.Method>> |
bindMethods
Map of methods keyed by the first parameter which indicates the service type expected.
|
private java.lang.reflect.Method |
bindReference
anyName(ServiceReference reference) method signature.
|
private boolean |
initialized
init flag
|
private boolean |
isBlueprintCompliant |
private boolean |
isLifecycleListener
does the target implement the listener interface
|
private static org.apache.commons.logging.Log |
log |
private java.lang.Object |
target
target object (can be null at first when dealing with a cycle
|
private java.lang.String |
targetBeanName
used when dealing with a cycle
|
private java.lang.String |
unbindMethod |
private java.util.Map<java.lang.Class<?>,java.util.List<java.lang.reflect.Method>> |
unbindMethods
Map of methods keyed by the first parameter which indicates the service type expected.
|
private java.lang.reflect.Method |
unbindReference
anyName(ServiceReference reference) method signature.
|
| Constructor and Description |
|---|
OsgiServiceLifecycleListenerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
bind(java.lang.Object service,
java.util.Map properties)
Called when a service is being binded inside the proxy (be it single or multi value).
|
private java.lang.reflect.Method |
findServiceReferenceMethod(java.lang.Class<?> clazz,
java.lang.String methodName) |
private void |
initialize()
Initialise adapter.
|
private void |
invokeCustomServiceReferenceMethod(java.lang.Object target,
java.lang.reflect.Method method,
java.lang.Object service)
Invoke method with signature
bla(ServiceReference ref). |
private void |
retrieveTarget() |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setBindMethod(java.lang.String bindMethod) |
void |
setBlueprintCompliant(boolean compliant) |
void |
setTarget(java.lang.Object target) |
void |
setTargetBeanName(java.lang.String targetName) |
void |
setUnbindMethod(java.lang.String unbindMethod) |
void |
unbind(java.lang.Object service,
java.util.Map properties)
Called when a service is being unbinded inside the proxy (be it single or multi value).
|
private static final org.apache.commons.logging.Log log
private java.util.Map<java.lang.Class<?>,java.util.List<java.lang.reflect.Method>> bindMethods
private java.util.Map<java.lang.Class<?>,java.util.List<java.lang.reflect.Method>> unbindMethods
private boolean isBlueprintCompliant
private java.lang.reflect.Method bindReference
private java.lang.reflect.Method unbindReference
private java.lang.String bindMethod
private java.lang.String unbindMethod
private boolean isLifecycleListener
private org.springframework.beans.factory.BeanFactory beanFactory
private java.lang.String targetBeanName
private java.lang.Object target
private boolean initialized
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanprivate void retrieveTarget()
private void initialize()
private java.lang.reflect.Method findServiceReferenceMethod(java.lang.Class<?> clazz,
java.lang.String methodName)
private void invokeCustomServiceReferenceMethod(java.lang.Object target,
java.lang.reflect.Method method,
java.lang.Object service)
bla(ServiceReference ref).target - method - service - public void bind(java.lang.Object service,
java.util.Map properties)
throws java.lang.Exception
OsgiServiceLifecycleListenerMap which can be safely cast to a Dictionary if needed.bind in interface OsgiServiceLifecycleListenerservice - the OSGi service instanceproperties - the service propertiesjava.lang.Exception - custom exception that is logged but not propagated to other listenerspublic void unbind(java.lang.Object service,
java.util.Map properties)
throws java.lang.Exception
OsgiServiceLifecycleListenerMap which can be safely cast to a Dictionary if needed.unbind in interface OsgiServiceLifecycleListenerservice - the OSGi service instanceproperties - the service propertiesjava.lang.Exception - custom exception that is logged but not propagated to other listenerspublic void setBindMethod(java.lang.String bindMethod)
bindMethod - The bindMethod to set.public void setUnbindMethod(java.lang.String unbindMethod)
unbindMethod - The unbindMethod to set.public void setTarget(java.lang.Object target)
public void setTargetBeanName(java.lang.String targetName)
public void setBlueprintCompliant(boolean compliant)
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansException