org.apache.servicemix.jbi.nmr.flow.jca
Class JCAFlow

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
      extended by org.apache.servicemix.jbi.nmr.flow.AbstractFlow
          extended by org.apache.servicemix.jbi.nmr.flow.jca.JCAFlow
All Implemented Interfaces:
javax.jbi.management.LifeCycleMBean, MessageListener, MBeanInfoProvider, Flow

public class JCAFlow
extends AbstractFlow
implements MessageListener

Use for message routing among a network of containers. All routing/registration happens automatically.

Version:
$Revision: 681324 $

Nested Class Summary
static class JCAFlow.RecoverableTransactionManagerWrapper
           
 
Field Summary
 
Fields inherited from class org.apache.servicemix.jbi.nmr.flow.AbstractFlow
broker, executorFactory, log
 
Fields inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
currentState, INITIALIZED, listener
 
Fields inherited from interface javax.jbi.management.LifeCycleMBean
SHUTDOWN, STARTED, STOPPED, UNKNOWN
 
Constructor Summary
JCAFlow()
           
JCAFlow(String jmsURL)
           
 
Method Summary
 boolean canHandle(javax.jbi.messaging.MessageExchange me)
          Check if the flow can support the requested QoS for this exchange
 void doRouting(MessageExchangeImpl me)
          Distribute an ExchangePacket
protected  void doSend(MessageExchangeImpl me)
          Distribute an ExchangePacket
 String getBroadcastDestinationName()
          Returns the Broadcast Destination Name for this flow
 org.apache.activemq.ActiveMQConnectionFactory getConnectionFactory()
          Returns the ConnectionFactory for this flow
 ConnectionManager getConnectionManager()
           
 String getDescription()
          The type of Flow
 String getJmsURL()
          Returns the JMS URL for this flow
 TransactionManager getTransactionManager()
           
 void init(Broker broker)
          Initialize the Region
 int numberInNetwork()
          useful for testing
protected  void onAdvisoryMessage(Object obj)
           
 void onComponentStarted(ComponentEvent event)
           
 void onComponentStopped(ComponentEvent event)
           
 void onInternalEndpointRegistered(EndpointEvent event, boolean broadcast)
           
 void onInternalEndpointUnregistered(EndpointEvent event, boolean broadcast)
           
 void onMessage(Message message)
          MessageListener implementation
 void onRemoteEndpointRegistered(EndpointEvent event)
           
 void onRemoteEndpointUnregistered(EndpointEvent event)
           
 void setBroadcastDestinationName(String broadcastDestinationName)
          Sets the Broadcast Destination Name for this flow
 void setConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory connectionFactory)
          Sets the ConnectionFactory for this flow
 void setConnectionManager(ConnectionManager connectionManager)
           
 void setJmsURL(String jmsURL)
          Sets the JMS URL for this flow
 void shutDown()
          shutDown the flow
 void start()
          start the flow
 void stop()
          stop the flow
 String toString()
           
 
Methods inherited from class org.apache.servicemix.jbi.nmr.flow.AbstractFlow
getAttributeInfos, getBroker, getExecutorFactory, getName, getType, isClustered, isPersistent, isSynchronous, isTransacted, resume, send, setName, suspend
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
firePropertyChanged, getCurrentState, getObjectToManage, getOperationInfos, getSubType, init, isInitialized, isShutDown, isStarted, isStopped, isUnknown, setCurrentState, setPropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jbi.management.LifeCycleMBean
getCurrentState
 

Constructor Detail

JCAFlow

public JCAFlow()

JCAFlow

public JCAFlow(String jmsURL)
Method Detail

getDescription

public String getDescription()
The type of Flow

Specified by:
getDescription in interface MBeanInfoProvider
Specified by:
getDescription in interface Flow
Returns:
the type

getJmsURL

public String getJmsURL()
Returns the JMS URL for this flow

Returns:
Returns the jmsURL.

setJmsURL

public void setJmsURL(String jmsURL)
Sets the JMS URL for this flow

Parameters:
jmsURL - The jmsURL to set.

getConnectionFactory

public org.apache.activemq.ActiveMQConnectionFactory getConnectionFactory()
Returns the ConnectionFactory for this flow

Returns:
Returns the connectionFactory.

setConnectionFactory

public void setConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory connectionFactory)
Sets the ConnectionFactory for this flow

Parameters:
connectionFactory - The connectionFactory to set.

getBroadcastDestinationName

public String getBroadcastDestinationName()
Returns the Broadcast Destination Name for this flow

Returns:
Returns the broadcastDestinationName.

setBroadcastDestinationName

public void setBroadcastDestinationName(String broadcastDestinationName)
Sets the Broadcast Destination Name for this flow

Parameters:
broadcastDestinationName - The broadcastDestinationName to set.

getTransactionManager

public TransactionManager getTransactionManager()

init

public void init(Broker broker)
          throws javax.jbi.JBIException
Initialize the Region

Specified by:
init in interface Flow
Overrides:
init in class AbstractFlow
Parameters:
broker -
Throws:
javax.jbi.JBIException

start

public void start()
           throws javax.jbi.JBIException
start the flow

Specified by:
start in interface javax.jbi.management.LifeCycleMBean
Overrides:
start in class AbstractFlow
Throws:
javax.jbi.JBIException

stop

public void stop()
          throws javax.jbi.JBIException
stop the flow

Specified by:
stop in interface javax.jbi.management.LifeCycleMBean
Overrides:
stop in class AbstractFlow
Throws:
javax.jbi.JBIException

shutDown

public void shutDown()
              throws javax.jbi.JBIException
Description copied from class: AbstractFlow
shutDown the flow

Specified by:
shutDown in interface javax.jbi.management.LifeCycleMBean
Overrides:
shutDown in class AbstractFlow
Throws:
javax.jbi.JBIException - if the item fails to shut down.

numberInNetwork

public int numberInNetwork()
useful for testing

Returns:
number of containers in the network

canHandle

public boolean canHandle(javax.jbi.messaging.MessageExchange me)
Check if the flow can support the requested QoS for this exchange

Specified by:
canHandle in interface Flow
Parameters:
me - the exchange to check
Returns:
true if this flow can handle the given exchange

onInternalEndpointRegistered

public void onInternalEndpointRegistered(EndpointEvent event,
                                         boolean broadcast)

onInternalEndpointUnregistered

public void onInternalEndpointUnregistered(EndpointEvent event,
                                           boolean broadcast)

onComponentStarted

public void onComponentStarted(ComponentEvent event)

onComponentStopped

public void onComponentStopped(ComponentEvent event)

onRemoteEndpointRegistered

public void onRemoteEndpointRegistered(EndpointEvent event)

onRemoteEndpointUnregistered

public void onRemoteEndpointUnregistered(EndpointEvent event)

doSend

protected void doSend(MessageExchangeImpl me)
               throws javax.jbi.messaging.MessagingException
Distribute an ExchangePacket

Specified by:
doSend in class AbstractFlow
Parameters:
me -
Throws:
javax.jbi.messaging.MessagingException

doRouting

public void doRouting(MessageExchangeImpl me)
               throws javax.jbi.messaging.MessagingException
Distribute an ExchangePacket

Overrides:
doRouting in class AbstractFlow
Parameters:
me -
Throws:
javax.jbi.messaging.MessagingException

onMessage

public void onMessage(Message message)
MessageListener implementation

Specified by:
onMessage in interface MessageListener
Parameters:
message -

onAdvisoryMessage

protected void onAdvisoryMessage(Object obj)

getConnectionManager

public ConnectionManager getConnectionManager()
                                       throws Exception
Throws:
Exception

setConnectionManager

public void setConnectionManager(ConnectionManager connectionManager)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.