org.apache.camel.processor
Class UnitOfWorkProducer

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

public final class UnitOfWorkProducer
extends Object
implements Producer

Ensures a Producer is executed within an UnitOfWork.

Version:
$Revision: 20038 $

Constructor Summary
UnitOfWorkProducer(Producer producer)
          The producer which should be executed within an UnitOfWork.
 
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

UnitOfWorkProducer

public UnitOfWorkProducer(Producer producer)
The producer which should be executed within an UnitOfWork.

Parameters:
producer - the 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