org.apache.servicemix.jbi.nmr.flow
Class AbstractFlow

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
      extended by org.apache.servicemix.jbi.nmr.flow.AbstractFlow
All Implemented Interfaces:
javax.jbi.management.LifeCycleMBean, MBeanInfoProvider, Flow
Direct Known Subclasses:
AbstractJMSFlow, JCAFlow, SedaFlow, STFlow

public abstract class AbstractFlow
extends BaseLifeCycle
implements Flow

A simple Straight through flow

Version:
$Revision: 644037 $

Field Summary
protected  Broker broker
           
protected  org.apache.servicemix.executors.ExecutorFactory executorFactory
           
protected  Log 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
AbstractFlow()
           
 
Method Summary
protected  void doRouting(MessageExchangeImpl me)
          Distribute an ExchangePacket
protected abstract  void doSend(MessageExchangeImpl me)
          Do the Flow specific routing
 MBeanAttributeInfo[] getAttributeInfos()
          Get an array of MBeanAttributeInfo
 Broker getBroker()
          Get the broker associated with this flow
 org.apache.servicemix.executors.ExecutorFactory getExecutorFactory()
           
 String getName()
          Get the name of the item
 String getType()
          Get the type of the item
 void init(Broker br)
          Initialize the Region
protected  boolean isClustered(javax.jbi.messaging.MessageExchange me)
           
protected  boolean isPersistent(javax.jbi.messaging.MessageExchange me)
          Check if the given packet should be persisted or not.
protected  boolean isSynchronous(javax.jbi.messaging.MessageExchange me)
           
protected  boolean isTransacted(javax.jbi.messaging.MessageExchange me)
           
 void resume()
          resume message exchange processing
 void send(javax.jbi.messaging.MessageExchange me)
          Distribute an ExchangePacket
 void setName(String name)
           
 void shutDown()
          shutDown the flow
 void start()
          start the flow
 void stop()
          stop the flow
 void suspend()
          suspend the flow to prevent any message exchanges
 
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 org.apache.servicemix.jbi.nmr.flow.Flow
canHandle, getDescription
 
Methods inherited from interface javax.jbi.management.LifeCycleMBean
getCurrentState
 
Methods inherited from interface org.apache.servicemix.jbi.management.MBeanInfoProvider
getDescription
 

Field Detail

log

protected final Log log

broker

protected Broker broker

executorFactory

protected org.apache.servicemix.executors.ExecutorFactory executorFactory
Constructor Detail

AbstractFlow

public AbstractFlow()
Method Detail

init

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

Specified by:
init in interface Flow
Parameters:
br -
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 BaseLifeCycle
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 BaseLifeCycle
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 BaseLifeCycle
Throws:
javax.jbi.JBIException

send

public void send(javax.jbi.messaging.MessageExchange me)
          throws javax.jbi.JBIException
Distribute an ExchangePacket

Specified by:
send in interface Flow
Parameters:
packet -
Throws:
javax.jbi.JBIException

suspend

public void suspend()
suspend the flow to prevent any message exchanges

Specified by:
suspend in interface Flow

resume

public void resume()
resume message exchange processing

Specified by:
resume in interface Flow

doSend

protected abstract void doSend(MessageExchangeImpl me)
                        throws javax.jbi.JBIException
Do the Flow specific routing

Parameters:
packet -
Throws:
javax.jbi.JBIException

doRouting

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

Parameters:
packet -
Throws:
javax.jbi.messaging.MessagingException

getAttributeInfos

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

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

isPersistent

protected boolean isPersistent(javax.jbi.messaging.MessageExchange me)
Check if the given packet should be persisted or not.

Parameters:
packet -
Returns:

isTransacted

protected boolean isTransacted(javax.jbi.messaging.MessageExchange me)

isSynchronous

protected boolean isSynchronous(javax.jbi.messaging.MessageExchange me)

isClustered

protected boolean isClustered(javax.jbi.messaging.MessageExchange me)

getBroker

public Broker getBroker()
Description copied from interface: Flow
Get the broker associated with this flow

Specified by:
getBroker in interface Flow

getType

public String getType()
Get the type of the item

Specified by:
getType in interface MBeanInfoProvider
Overrides:
getType in class BaseLifeCycle
Returns:
the type

getName

public String getName()
Get the name of the item

Specified by:
getName in interface MBeanInfoProvider
Specified by:
getName in interface Flow
Overrides:
getName in class BaseLifeCycle
Returns:
the name

setName

public void setName(String name)

getExecutorFactory

public org.apache.servicemix.executors.ExecutorFactory getExecutorFactory()
Returns:
the executorFactory


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