it.imolinfo.jbi4corba.jbi.component.runtime
Class AbstractComponentLifeCycle

java.lang.Object
  extended by it.imolinfo.jbi4corba.jbi.component.runtime.AbstractComponentLifeCycle
All Implemented Interfaces:
javax.jbi.component.ComponentLifeCycle
Direct Known Subclasses:
DefaultComponentLifeCycle, Jbi4CorbaLifeCycle

public abstract class AbstractComponentLifeCycle
extends Object
implements javax.jbi.component.ComponentLifeCycle

This class is an abstract implemenation of the ComponentLifeCycle. It implements the component lifecycle methods and provides necessary hooks to the extended classes to supply the component specific implemenation for the lifecycle functionality.

Author:
Marco Piraccini
See Also:
javax.jbi.ComponentLifeCycle

Field Summary
static String[] JBI4CORBABC_PERF_CATEGORIES
           
protected  javax.jbi.component.ComponentContext jbiContext
           
protected  RuntimeConfiguration mRuntimeConfig
           
protected  com.sun.jbi.configuration.RuntimeConfigurationHelper mRuntimeConfigHelper
           
protected  com.sun.jbi.eManager.provider.StatusProviderHelper mStatusProviderHelper
           
static String PERF_CAT_DENORMALIZATION
           
static String PERF_CAT_NORMALIZATION
           
static String SHORT_DISPLAY_NAME
          A short display Name
 
Constructor Summary
protected AbstractComponentLifeCycle(ComponentRuntime compRuntime)
          constructor for the ComponentLifecycle implementation.
 
Method Summary
protected abstract  void activateServiceConsumers()
          service consumer initialization such as creating the service descriptions and activating the protocol specific external endpoints should be done.
protected abstract  void activateServiceProviders()
          service providers initialization such as creating the service descriptions and activating the service endpoints should be done.
protected abstract  StandardMBean createExtensionMBean()
          create mbean implemenation for the extension mbean as a StandardMBean
protected abstract  ObjectName createExtensionMBeanName()
          create jmx object name for the extension mbean
protected abstract  MessageExchangeReceiver createMessageExchangeReceiver()
          creates a message receiver object that handles receiving and processing the message exchanges from the delivery channel.
protected abstract  void deactivateServiceConsumers()
          disables the service consumers so that the service consumer can not send message exchange to the providers.
protected abstract  void deactivateServiceProviders()
          disable the service providers so that the service consumers can not find the service endpoints for this service provider.
 ComponentRuntime getComponentRuntime()
           
 ObjectName getExtensionMBeanName()
          this is a default implementation which does not have any extension mbeans.
 void init(javax.jbi.component.ComponentContext context)
          Initialize the component.
protected abstract  void initMessageExchangeHandlerFactory()
          initializes the message exchange handler factory.
protected  void onInit()
          chance to extended classes to do the component specific init
protected  void onShutDown()
          chance to extended classes to do the component specific shutdown
protected  void onStart()
          chance to extended classes to do the component specific start
protected  void onStop()
          chance to extended classes to do the component specific stop
 void shutDown()
          Shut down the component.
 void start()
          Start the component.
 void stop()
          Stop the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mRuntimeConfig

protected RuntimeConfiguration mRuntimeConfig

mRuntimeConfigHelper

protected com.sun.jbi.configuration.RuntimeConfigurationHelper mRuntimeConfigHelper

SHORT_DISPLAY_NAME

public static final String SHORT_DISPLAY_NAME
A short display Name

See Also:
Constant Field Values

PERF_CAT_NORMALIZATION

public static final String PERF_CAT_NORMALIZATION
See Also:
Constant Field Values

PERF_CAT_DENORMALIZATION

public static final String PERF_CAT_DENORMALIZATION
See Also:
Constant Field Values

JBI4CORBABC_PERF_CATEGORIES

public static final String[] JBI4CORBABC_PERF_CATEGORIES

jbiContext

protected javax.jbi.component.ComponentContext jbiContext

mStatusProviderHelper

protected com.sun.jbi.eManager.provider.StatusProviderHelper mStatusProviderHelper
Constructor Detail

AbstractComponentLifeCycle

protected AbstractComponentLifeCycle(ComponentRuntime compRuntime)
constructor for the ComponentLifecycle implementation.

Parameters:
compRuntime -
Method Detail

init

public final void init(javax.jbi.component.ComponentContext context)
                throws javax.jbi.JBIException
Initialize the component.

Specified by:
init in interface javax.jbi.component.ComponentLifeCycle
Parameters:
context -
Throws:
javax.jbi.JBIException
See Also:
ComponentLifeCycle.init(javax.jbi.component.ComponentContext)

start

public final void start()
                 throws javax.jbi.JBIException
Start the component.

Specified by:
start in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException
See Also:
ComponentLifeCycle.start()

stop

public final void stop()
                throws javax.jbi.JBIException
Stop the component.

Specified by:
stop in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException
See Also:
ComponentLifeCycle.stop()

shutDown

public final void shutDown()
                    throws javax.jbi.JBIException
Shut down the component.

Specified by:
shutDown in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException
See Also:
ComponentLifeCycle.shutDown()

getExtensionMBeanName

public final ObjectName getExtensionMBeanName()
this is a default implementation which does not have any extension mbeans. extended classes can return the mbean name for the extension mbeans if the component supports.

Specified by:
getExtensionMBeanName in interface javax.jbi.component.ComponentLifeCycle
Returns:
See Also:
ComponentLifeCycle.getExtensionMBeanName()

getComponentRuntime

public final ComponentRuntime getComponentRuntime()
Returns:

createExtensionMBeanName

protected abstract ObjectName createExtensionMBeanName()
create jmx object name for the extension mbean


createExtensionMBean

protected abstract StandardMBean createExtensionMBean()
create mbean implemenation for the extension mbean as a StandardMBean


initMessageExchangeHandlerFactory

protected abstract void initMessageExchangeHandlerFactory()
                                                   throws javax.jbi.JBIException
initializes the message exchange handler factory. components implement this method to provide their own handler factory

Throws:
javax.jbi.JBIException

createMessageExchangeReceiver

protected abstract MessageExchangeReceiver createMessageExchangeReceiver()
                                                                  throws Exception
creates a message receiver object that handles receiving and processing the message exchanges from the delivery channel. Component should implement this method to provide the MessageReceiver. Component may return null indicating that they don't need the message receiver that can receive and process message exchanges from delivery channel. For example, components that have only service consumers which send a synchronous messages to providers don't need this.

Returns:
Throws:
Exception

activateServiceProviders

protected abstract void activateServiceProviders()
                                          throws javax.jbi.JBIException
service providers initialization such as creating the service descriptions and activating the service endpoints should be done. If the component supports deployment, deployment manager should be notified to active service providers from the deployed service units. This method is invoked in the implementation of ComponentLifeCycle start method

Throws:
javax.jbi.JBIException

deactivateServiceProviders

protected abstract void deactivateServiceProviders()
                                            throws javax.jbi.JBIException
disable the service providers so that the service consumers can not find the service endpoints for this service provider. This method is invoked in the implementation of ComponentLifeCycle stop method

Throws:
javax.jbi.JBIException

activateServiceConsumers

protected abstract void activateServiceConsumers()
                                          throws javax.jbi.JBIException
service consumer initialization such as creating the service descriptions and activating the protocol specific external endpoints should be done. If the component supports deployment, deployment manager should be notified to initialize service consumers from the deployed service units. This method is invoked in the implementation of ComponentLifeCycle start method

Throws:
javax.jbi.JBIException

deactivateServiceConsumers

protected abstract void deactivateServiceConsumers()
                                            throws javax.jbi.JBIException
disables the service consumers so that the service consumer can not send message exchange to the providers. This is called in the implemenation of component lifecycle stop method This method is invoked in the implementation of ComponentLifeCycle stop method

Throws:
javax.jbi.JBIException

onInit

protected void onInit()
               throws javax.jbi.JBIException
chance to extended classes to do the component specific init

Throws:
javax.jbi.JBIException

onStart

protected void onStart()
                throws javax.jbi.JBIException
chance to extended classes to do the component specific start

Throws:
javax.jbi.JBIException

onStop

protected void onStop()
               throws javax.jbi.JBIException
chance to extended classes to do the component specific stop

Throws:
javax.jbi.JBIException

onShutDown

protected void onShutDown()
                   throws javax.jbi.JBIException
chance to extended classes to do the component specific shutdown

Throws:
javax.jbi.JBIException


Copyright © 2005-2010 Imola Informatica. All Rights Reserved.