org.jboss.osgi.deployment.interceptor
Class AbstractLifecycleInterceptorService

java.lang.Object
  extended by org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptorService
All Implemented Interfaces:
LifecycleInterceptorService

public abstract class AbstractLifecycleInterceptorService
extends Object
implements LifecycleInterceptorService

A basic service that manages bundle lifecycle interceptors.

Since:
15-Oct-2009
Author:
thomas.diesler@jboss.com

Constructor Summary
AbstractLifecycleInterceptorService()
           
 
Method Summary
protected  void addInterceptor(LifecycleInterceptor interceptor)
          Add a LifecycleInterceptor to the service.
protected  List<LifecycleInterceptor> getInterceptorChain()
           
protected abstract  InvocationContext getInvocationContext(org.osgi.framework.Bundle bundle)
          Get the InvocationContext for the given bundle.
 void handleStateChange(int state, org.osgi.framework.Bundle bundle)
          Invoke the registered set of interceptors for the given bundle state change.
protected  void removeInterceptor(LifecycleInterceptor interceptor)
          Remove an LifecycleInterceptor to the service.
 void start(org.osgi.framework.BundleContext context)
          Start tracking LifecycleInterceptor services
 void stop()
          Start tracking LifecycleInterceptor services
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLifecycleInterceptorService

public AbstractLifecycleInterceptorService()
Method Detail

start

public void start(org.osgi.framework.BundleContext context)
Description copied from interface: LifecycleInterceptorService
Start tracking LifecycleInterceptor services

Specified by:
start in interface LifecycleInterceptorService

stop

public void stop()
Description copied from interface: LifecycleInterceptorService
Start tracking LifecycleInterceptor services

Specified by:
stop in interface LifecycleInterceptorService

addInterceptor

protected void addInterceptor(LifecycleInterceptor interceptor)
Add a LifecycleInterceptor to the service. The interceptor is added according to its input requirements and relative order.

Parameters:
interceptor - The interceptor

removeInterceptor

protected void removeInterceptor(LifecycleInterceptor interceptor)
Remove an LifecycleInterceptor to the service.

Parameters:
interceptor - The interceptor

getInterceptorChain

protected List<LifecycleInterceptor> getInterceptorChain()

handleStateChange

public void handleStateChange(int state,
                              org.osgi.framework.Bundle bundle)
Invoke the registered set of interceptors for the given bundle state change.

Specified by:
handleStateChange in interface LifecycleInterceptorService
Parameters:
state - The future state of the bundle
bundle - The bundle that changes state
Throws:
LifecycleInterceptorException - if the invocation of an interceptor fails

getInvocationContext

protected abstract InvocationContext getInvocationContext(org.osgi.framework.Bundle bundle)
Get the InvocationContext for the given bundle.



Copyright © 2012 JBoss by Red Hat. All Rights Reserved.