org.apache.camel.impl
Class SynchronousDelegateProducer

java.lang.Object
  extended by org.apache.camel.impl.SynchronousDelegateProducer
All Implemented Interfaces:
IsSingleton, Processor, Producer, Service

public class SynchronousDelegateProducer
extends Object
implements Producer

To process the delegated producer in synchronous mode.

This is used to enforce asynchronous producers to run in synchronous mode when it has been configured to do so.

This delegate allows the component developers easily to support their existing asynchronous producer to behave synchronously by wrapping their producer in this synchronous delegate.

Version:

Constructor Summary
SynchronousDelegateProducer(Producer producer)
           
 
Method Summary
 Exchange createExchange()
          Creates a new exchange to send to this endpoint
 Exchange createExchange(Exchange exchange)
          Creates a new exchange for communicating with this exchange using the given exchange to pre-populate the values of the headers and messages
 Exchange createExchange(ExchangePattern pattern)
          Creates a new exchange of the given pattern to send to this endpoint
 Endpoint getEndpoint()
          Gets the endpoint this producer sends to.
 boolean isSingleton()
          Whether this class supports being singleton or not.
 void process(Exchange exchange)
          Processes the message exchange
 void start()
          Starts the service
 void stop()
          Stops the service
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SynchronousDelegateProducer

public SynchronousDelegateProducer(Producer producer)
Method Detail

getEndpoint

public Endpoint getEndpoint()
Description copied from interface: Producer
Gets the endpoint this producer sends to.

Specified by:
getEndpoint in interface Producer
Returns:
the endpoint

createExchange

public Exchange createExchange()
Description copied from interface: Producer
Creates a new exchange to send to this endpoint

Specified by:
createExchange in interface Producer
Returns:
a newly created exchange

createExchange

public Exchange createExchange(ExchangePattern pattern)
Description copied from interface: Producer
Creates a new exchange of the given pattern to send to this endpoint

Specified by:
createExchange in interface Producer
Parameters:
pattern - the exchange pattern
Returns:
a newly created exchange

createExchange

public Exchange createExchange(Exchange exchange)
Description copied from interface: Producer
Creates a new exchange for communicating with this exchange using the given exchange to pre-populate the values of the headers and messages

Specified by:
createExchange in interface Producer
Parameters:
exchange - the existing exchange
Returns:
the created exchange

process

public void process(Exchange exchange)
             throws Exception
Description copied from interface: Processor
Processes the message exchange

Specified by:
process in interface Processor
Parameters:
exchange - the message exchange
Throws:
Exception - if an internal processing error has occurred.

start

public void start()
           throws Exception
Description copied from interface: Service
Starts the service

Specified by:
start in interface Service
Throws:
Exception - is thrown if starting failed

stop

public void stop()
          throws Exception
Description copied from interface: Service
Stops the service

Specified by:
stop in interface Service
Throws:
Exception - is thrown if stopping failed

isSingleton

public boolean isSingleton()
Description copied from interface: IsSingleton
Whether this class supports being singleton or not.

Specified by:
isSingleton in interface IsSingleton
Returns:
true to be a single shared instance, false to create new instances.

toString

public String toString()
Overrides:
toString in class Object


Apache CAMEL