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

java.lang.Object
  extended by it.imolinfo.jbi4corba.jbi.component.runtime.RuntimeContext

public class RuntimeContext
extends Object

This class is used to store and retrieve the information that should be available anywhere in the component runtime. Each instance variable of this class will be initialized at various points of the component runtime using setter methods on this class. For example, the ComponentContext and related resources from this class are not available to the component runtime until the jbi framework calls the init method of the ComponentLifeCycle of this component.

Author:
Marco Piraccini

Method Summary
 void closeDeliveryChannel()
          closes the delivery channel as part of the component shutdown process.
 javax.jbi.component.ComponentContext getComponentContext()
          Getter for property mComponentContext.
 String getComponentName()
          Returns the Component Name if the ComponentContext is set.
 javax.jbi.messaging.DeliveryChannel getDeliveryChannel()
          Getter for property DeliveryChannel.
static RuntimeContext getInstance()
           
 Logger getLogger()
          Returns the logger.
 MessageExchangeHandlerFactory getMessageExchangeHandlerFactory()
          Getter for property MessageExchangeHandlerFactory.
 MessageExchangeHandler newMessageExchangeHandler(javax.jbi.messaging.MessageExchange msgExchange)
          helper method to create a new message exchange handler using the message exchange factory set on the runtime context.
 void openDeliveryChannel()
          opens the delivery channel to accept the message exchange objects or send the message exchange objects
 void setComponentContext(javax.jbi.component.ComponentContext componentContext)
          Setter for property ComponentContext.
 void setLogger(String name, String resourceBundle)
          Sets the logger.
 void setMessageExchangeHandlerFactory(MessageExchangeHandlerFactory factory)
          Setter for property MessageExchangeHandlerFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RuntimeContext getInstance()

getComponentContext

public javax.jbi.component.ComponentContext getComponentContext()
Getter for property mComponentContext.

Returns:
Value of property mComponentContext.

setComponentContext

public void setComponentContext(javax.jbi.component.ComponentContext componentContext)
Setter for property ComponentContext.

Parameters:
componentContext - New value of property ComponentContext.

getDeliveryChannel

public javax.jbi.messaging.DeliveryChannel getDeliveryChannel()
Getter for property DeliveryChannel.

Returns:
Value of property DeliveryChannel.

openDeliveryChannel

public void openDeliveryChannel()
opens the delivery channel to accept the message exchange objects or send the message exchange objects


closeDeliveryChannel

public void closeDeliveryChannel()
closes the delivery channel as part of the component shutdown process.


setLogger

public void setLogger(String name,
                      String resourceBundle)
Sets the logger.

Parameters:
name - name for the Logger.
resourceBundle - resource bundle for the logger. can be null.

getLogger

public Logger getLogger()
Returns the logger.

Returns:
Logger

getComponentName

public String getComponentName()
Returns the Component Name if the ComponentContext is set. else null

Returns:
component name

getMessageExchangeHandlerFactory

public MessageExchangeHandlerFactory getMessageExchangeHandlerFactory()
Getter for property MessageExchangeHandlerFactory.

Returns:
Value of property MessageExchangeHandlerFactory.

setMessageExchangeHandlerFactory

public void setMessageExchangeHandlerFactory(MessageExchangeHandlerFactory factory)
Setter for property MessageExchangeHandlerFactory.

Parameters:
componentContext - New value of property MessageExchangeHandlerFactory.

newMessageExchangeHandler

public MessageExchangeHandler newMessageExchangeHandler(javax.jbi.messaging.MessageExchange msgExchange)
helper method to create a new message exchange handler using the message exchange factory set on the runtime context.



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