org.apache.servicemix.components.util
Class OutBinding

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
      extended by org.apache.servicemix.components.util.PojoSupport
          extended by org.apache.servicemix.components.util.ComponentSupport
              extended by org.apache.servicemix.components.util.OutBinding
All Implemented Interfaces:
Runnable, javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle, javax.jbi.management.LifeCycleMBean, org.apache.servicemix.jbi.listener.MessageExchangeListener, MBeanInfoProvider
Direct Known Subclasses:
ASInOutBinding, ASOutBinding, DroolsComponent, FeedWriter, FileWriter, FileWriter, FTPSender, JabberComponentSupport, JaxRpcInBinding, JmsSenderComponent, MimeMailSender, ReflectionOutBinding, SimpleMailSender, StreamWriterComponent, WSIFOutBinding, XFireBinding, XFireOutBinding

public abstract class OutBinding
extends ComponentSupport
implements Runnable, MessageExchangeListener

A base class for bindings which process inbound JBI messages

Version:
$Revision: 2153 $

Field Summary
 
Fields inherited from class org.apache.servicemix.components.util.PojoSupport
logger
 
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
OutBinding()
           
 
Method Summary
 void onMessageExchange(javax.jbi.messaging.MessageExchange exchange)
           
protected abstract  void process(javax.jbi.messaging.MessageExchange messageExchange, javax.jbi.messaging.NormalizedMessage message)
          Process incoming exchange.
 void run()
          Runnable implementation
 void shutDown()
          shutdown
 void start()
          start
 void stop()
          stop
 
Methods inherited from class org.apache.servicemix.components.util.ComponentSupport
createComponentLifeCycle, createInOnlyExchange, createInOnlyExchange, createInOnlyExchange, createInOptionalOutExchange, createInOutExchange, createInOutExchange, createRobustInOnlyExchange, createServiceUnitManager, creatInOutExchange, forwardToExchange, forwardToExchange, getInMessage, getLifeCycle, getMessageTransformer, getServiceDescription, getServiceUnitManager, initializeServiceUnitManager, invoke, isExchangeWithConsumerOkay, isExchangeWithProviderOkay, propagateCorrelationId, resolveEndpointReference, setMessageTransformer
 
Methods inherited from class org.apache.servicemix.components.util.PojoSupport
answer, done, fail, fail, getBody, getContext, getDeliveryChannel, getDescription, getEndpoint, getExchangeFactory, getExtensionMBeanName, getService, init, init, isInAndOut, send, sendSync, sendSync, setBody, setEndpoint, setExtensionMBeanName, setService
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
firePropertyChanged, getAttributeInfos, getCurrentState, getName, getObjectToManage, getOperationInfos, getSubType, getType, 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
 

Constructor Detail

OutBinding

public OutBinding()
Method Detail

onMessageExchange

public void onMessageExchange(javax.jbi.messaging.MessageExchange exchange)
                       throws javax.jbi.messaging.MessagingException
Specified by:
onMessageExchange in interface org.apache.servicemix.jbi.listener.MessageExchangeListener
Throws:
javax.jbi.messaging.MessagingException

run

public void run()
Runnable implementation

Specified by:
run in interface Runnable

shutDown

public void shutDown()
              throws javax.jbi.JBIException
shutdown

Specified by:
shutDown in interface javax.jbi.component.ComponentLifeCycle
Specified by:
shutDown in interface javax.jbi.management.LifeCycleMBean
Overrides:
shutDown in class PojoSupport
Throws:
javax.jbi.JBIException

stop

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

Specified by:
stop in interface javax.jbi.component.ComponentLifeCycle
Specified by:
stop in interface javax.jbi.management.LifeCycleMBean
Overrides:
stop in class BaseLifeCycle
Throws:
javax.jbi.JBIException

start

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

Specified by:
start in interface javax.jbi.component.ComponentLifeCycle
Specified by:
start in interface javax.jbi.management.LifeCycleMBean
Overrides:
start in class BaseLifeCycle
Throws:
javax.jbi.JBIException - if the item fails to start.

process

protected abstract void process(javax.jbi.messaging.MessageExchange messageExchange,
                                javax.jbi.messaging.NormalizedMessage message)
                         throws Exception
Process incoming exchange. The exchange is in the ACTIVE state. The method should end by a call to done() or answer(). When an exception is thrown, the fail() method will be called.

Parameters:
messageExchange - the exchange to process
message - the input message of the exchange
Throws:
Exception - if an error occurs


Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.