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
protected AbstractLifecycleInterceptorService(org.osgi.framework.BundleContext context)
           
 
Method Summary
protected  void addInterceptor(LifecycleInterceptor interceptor)
          Add a LifecycleInterceptor to the service.
 void close()
           
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.
 void open()
           
protected  void removeInterceptor(LifecycleInterceptor interceptor)
          Remove an LifecycleInterceptor to the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLifecycleInterceptorService

protected AbstractLifecycleInterceptorService(org.osgi.framework.BundleContext context)
Method Detail

open

public void open()

close

public void close()

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.