org.apache.servicemix.jbi.nmr.flow.seda
Class SedaFlow

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.seda.SedaFlow
All Implemented Interfaces:
javax.jbi.management.LifeCycleMBean, MBeanInfoProvider, Flow

public class SedaFlow
extends AbstractFlow

The SedaFlow introduces a simple event staging between the internal processes in the NMR Broker. A Seda flow (the default) is suited for general deployment, as the additional staging is well suited buffering exchanges between heavily routed to components (where state may be being used) for example.

Version:
$Revision: 665811 $

Field Summary
protected  ComponentListener listener
           
protected  Map<ComponentNameSpace,SedaQueue> queueMap
           
protected  AtomicBoolean started
           
 
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
 
Fields inherited from interface javax.jbi.management.LifeCycleMBean
SHUTDOWN, STARTED, STOPPED, UNKNOWN
 
Constructor Summary
SedaFlow()
           
 
Method Summary
 boolean canHandle(javax.jbi.messaging.MessageExchange me)
          Check if the flow can support the requested QoS for this exchange
protected  SedaQueue createQueue(ComponentNameSpace cns)
           
protected  void doRouting(MessageExchangeImpl me)
          Distribute an ExchangePacket
protected  void doSend(MessageExchangeImpl me)
          Distribute an ExchangePacket
protected  void enqueuePacket(MessageExchangeImpl me)
          Put the packet in the queue for later processing.
 MBeanAttributeInfo[] getAttributeInfos()
          Get an array of MBeanAttributeInfo
 String getDescription()
          The type of Flow
 int getQueueNumber()
          Get Queue number
 void init(Broker broker)
          Initialize the Region
 void onComponentShutdown(ComponentNameSpace cns)
          Process state changes in Components
protected  void registerQueue(ComponentNameSpace cns, SedaQueue queue)
           
 void release(SedaQueue queue)
          release a queue
protected  void resumeTx(MessageExchangeImpl me)
           
 void shutDown()
          shutDown the flow
 void start()
          start the flow
 void stop()
          stop the flow
protected  void suspendTx(MessageExchangeImpl me)
           
protected  void unregisterQueue(SedaQueue queue)
           
 
Methods inherited from class org.apache.servicemix.jbi.nmr.flow.AbstractFlow
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, toString, wait, wait, wait
 
Methods inherited from interface javax.jbi.management.LifeCycleMBean
getCurrentState
 

Field Detail

queueMap

protected Map<ComponentNameSpace,SedaQueue> queueMap

started

protected AtomicBoolean started

listener

protected ComponentListener listener
Constructor Detail

SedaFlow

public SedaFlow()
Method Detail

getDescription

public String getDescription()
The type of Flow

Returns:
the type

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

canHandle

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

Parameters:
me - the exchange to check
Returns:
true if this flow can handle the given exchange

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
shutDown the flow

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

doSend

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

Specified by:
doSend in class AbstractFlow
Parameters:
packet -
Throws:
javax.jbi.JBIException

doRouting

protected void doRouting(MessageExchangeImpl me)
                  throws javax.jbi.messaging.MessagingException
Description copied from class: AbstractFlow
Distribute an ExchangePacket

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

enqueuePacket

protected void enqueuePacket(MessageExchangeImpl me)
                      throws javax.jbi.JBIException
Put the packet in the queue for later processing.

Parameters:
packet -
Throws:
javax.jbi.JBIException

createQueue

protected SedaQueue createQueue(ComponentNameSpace cns)
                         throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

onComponentShutdown

public void onComponentShutdown(ComponentNameSpace cns)
Process state changes in Components

Parameters:
event -

release

public void release(SedaQueue queue)
release a queue

Parameters:
queue -

getQueueNumber

public int getQueueNumber()
Get Queue number

Returns:
number of running Queues

registerQueue

protected void registerQueue(ComponentNameSpace cns,
                             SedaQueue queue)

unregisterQueue

protected void unregisterQueue(SedaQueue queue)

getAttributeInfos

public MBeanAttributeInfo[] getAttributeInfos()
                                       throws JMException
Get an array of MBeanAttributeInfo

Specified by:
getAttributeInfos in interface MBeanInfoProvider
Overrides:
getAttributeInfos in class AbstractFlow
Returns:
array of AttributeInfos
Throws:
JMException

suspendTx

protected void suspendTx(MessageExchangeImpl me)
                  throws javax.jbi.messaging.MessagingException
Throws:
javax.jbi.messaging.MessagingException

resumeTx

protected void resumeTx(MessageExchangeImpl me)
                 throws javax.jbi.messaging.MessagingException
Throws:
javax.jbi.messaging.MessagingException


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