org.apache.camel.bam.processor
Class BamProcessorSupport<T>

java.lang.Object
  extended by org.apache.camel.bam.processor.BamProcessorSupport<T>
All Implemented Interfaces:
Processor
Direct Known Subclasses:
JpaBamProcessorSupport

public abstract class BamProcessorSupport<T>
extends Object
implements Processor

A base Processor for working on BAM which a derived class would do the actual persistence such as the JpaBamProcessor

Version:

Constructor Summary
protected BamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate, Expression correlationKeyExpression)
           
protected BamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate, Expression correlationKeyExpression, Class<T> entitytype)
           
 
Method Summary
protected  Object getCorrelationKey(Exchange exchange)
           
 Expression getCorrelationKeyExpression()
           
 Class<T> getEntityType()
           
protected abstract  Class<?> getKeyType()
           
protected abstract  T loadEntity(Exchange exchange, Object key)
           
protected  Object onError(org.springframework.transaction.TransactionStatus status, Exception e)
           
 void process(Exchange exchange)
          Processes the message exchange
protected abstract  void processEntity(Exchange exchange, T entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BamProcessorSupport

protected BamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate,
                              Expression correlationKeyExpression)

BamProcessorSupport

protected BamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate,
                              Expression correlationKeyExpression,
                              Class<T> entitytype)
Method Detail

process

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

Specified by:
process in interface Processor
Parameters:
exchange - the message exchange

getCorrelationKeyExpression

public Expression getCorrelationKeyExpression()

getEntityType

public Class<T> getEntityType()

processEntity

protected abstract void processEntity(Exchange exchange,
                                      T entity)
                               throws Exception
Throws:
Exception

loadEntity

protected abstract T loadEntity(Exchange exchange,
                                Object key)
                         throws Exception
Throws:
Exception

getKeyType

protected abstract Class<?> getKeyType()

getCorrelationKey

protected Object getCorrelationKey(Exchange exchange)
                            throws NoCorrelationKeyException
Throws:
NoCorrelationKeyException

onError

protected Object onError(org.springframework.transaction.TransactionStatus status,
                         Exception e)


Apache CAMEL