org.eclipse.gemini.blueprint.config.internal.adapter
Class OsgiServiceLifecycleListenerAdapter

java.lang.Object
  extended by org.eclipse.gemini.blueprint.config.internal.adapter.OsgiServiceLifecycleListenerAdapter
All Implemented Interfaces:
OsgiServiceLifecycleListener, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean

public class OsgiServiceLifecycleListenerAdapter
extends Object
implements OsgiServiceLifecycleListener, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanFactoryAware

OsgiServiceLifecycleListener wrapper for custom beans, useful when custom methods are being used.

Note: To support cyclic injection, this adapter does dependency lookup for the actual listener.

Author:
Costin Leau

Constructor Summary
OsgiServiceLifecycleListenerAdapter()
           
 
Method Summary
 void afterPropertiesSet()
           
 void bind(Object service, Map properties)
          Called when a service is being binded inside the proxy (be it single or multi value).
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 void setBindMethod(String bindMethod)
           
 void setBlueprintCompliant(boolean compliant)
           
 void setTarget(Object target)
           
 void setTargetBeanName(String targetName)
           
 void setUnbindMethod(String unbindMethod)
           
 void unbind(Object service, Map properties)
          Called when a service is being unbinded inside the proxy (be it single or multi value).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiServiceLifecycleListenerAdapter

public OsgiServiceLifecycleListenerAdapter()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

bind

public void bind(Object service,
                 Map properties)
          throws Exception
Description copied from interface: OsgiServiceLifecycleListener
Called when a service is being binded inside the proxy (be it single or multi value). The service properties are made available as a Map which can be safely cast to a Dictionary if needed.

Specified by:
bind in interface OsgiServiceLifecycleListener
Parameters:
service - the OSGi service instance
properties - the service properties
Throws:
Exception - custom exception that is logged but not propagated to other listeners

unbind

public void unbind(Object service,
                   Map properties)
            throws Exception
Description copied from interface: OsgiServiceLifecycleListener
Called when a service is being unbinded inside the proxy (be it single or multi value). The service properties are made available as a Map which can be safely cast to a Dictionary if needed.

Specified by:
unbind in interface OsgiServiceLifecycleListener
Parameters:
service - the OSGi service instance
properties - the service properties
Throws:
Exception - custom exception that is logged but not propagated to other listeners

setBindMethod

public void setBindMethod(String bindMethod)
Parameters:
bindMethod - The bindMethod to set.

setUnbindMethod

public void setUnbindMethod(String unbindMethod)
Parameters:
unbindMethod - The unbindMethod to set.

setTarget

public void setTarget(Object target)

setTargetBeanName

public void setTargetBeanName(String targetName)

setBlueprintCompliant

public void setBlueprintCompliant(boolean compliant)

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                    throws org.springframework.beans.BeansException
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Throws:
org.springframework.beans.BeansException


Copyright © 2006-2013. All Rights Reserved.