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:
$Revision: 16704 $

Constructor Summary
protected BamProcessorSupport(TransactionTemplate transactionTemplate, Expression correlationKeyExpression)
           
protected BamProcessorSupport(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(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(TransactionTemplate transactionTemplate,
                              Expression correlationKeyExpression)

BamProcessorSupport

protected BamProcessorSupport(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(TransactionStatus status,
                         Exception e)


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.