org.apache.camel.spring.spi
Class SpringTransactionPolicy

java.lang.Object
  extended by org.apache.camel.spring.spi.SpringTransactionPolicy
All Implemented Interfaces:
Policy, TransactedPolicy

public class SpringTransactionPolicy
extends Object
implements TransactedPolicy

Wraps the processor in a Spring transaction

Version:

Constructor Summary
SpringTransactionPolicy()
          Default constructor for easy spring configuration.
SpringTransactionPolicy(org.springframework.transaction.PlatformTransactionManager transactionManager)
           
SpringTransactionPolicy(org.springframework.transaction.support.TransactionTemplate template)
           
 
Method Summary
 void beforeWrap(RouteContext routeContext, ProcessorDefinition<?> definition)
          Hook invoked before the wrap.
protected  TransactionErrorHandler createTransactionErrorHandler(RouteContext routeContext, Processor processor, ErrorHandlerBuilder builder)
           
 String getPropagationBehaviorName()
           
 org.springframework.transaction.PlatformTransactionManager getTransactionManager()
           
 org.springframework.transaction.support.TransactionTemplate getTransactionTemplate()
           
 void setPropagationBehaviorName(String propagationBehaviorName)
           
 void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
           
 void setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate template)
           
 Processor wrap(RouteContext routeContext, Processor processor)
          Wraps any applicable interceptors around the given processor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringTransactionPolicy

public SpringTransactionPolicy()
Default constructor for easy spring configuration.


SpringTransactionPolicy

public SpringTransactionPolicy(org.springframework.transaction.support.TransactionTemplate template)

SpringTransactionPolicy

public SpringTransactionPolicy(org.springframework.transaction.PlatformTransactionManager transactionManager)
Method Detail

beforeWrap

public void beforeWrap(RouteContext routeContext,
                       ProcessorDefinition<?> definition)
Description copied from interface: Policy
Hook invoked before the wrap.

This allows you to do any custom logic before the processor is wrapped. For example to manipulate the definiton

Specified by:
beforeWrap in interface Policy
Parameters:
routeContext - the route context
definition - the processor definition

wrap

public Processor wrap(RouteContext routeContext,
                      Processor processor)
Description copied from interface: Policy
Wraps any applicable interceptors around the given processor.

Specified by:
wrap in interface Policy
Parameters:
routeContext - the route context
processor - the processor to be intercepted
Returns:
either the original processor or a processor wrapped in one or more processors

createTransactionErrorHandler

protected TransactionErrorHandler createTransactionErrorHandler(RouteContext routeContext,
                                                                Processor processor,
                                                                ErrorHandlerBuilder builder)

getTransactionTemplate

public org.springframework.transaction.support.TransactionTemplate getTransactionTemplate()

setTransactionTemplate

public void setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate template)

setTransactionManager

public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)

getTransactionManager

public org.springframework.transaction.PlatformTransactionManager getTransactionManager()

setPropagationBehaviorName

public void setPropagationBehaviorName(String propagationBehaviorName)

getPropagationBehaviorName

public String getPropagationBehaviorName()


Apache CAMEL