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

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

public abstract class BamProcessorSupport<T>
extends Object
implements org.apache.camel.Processor

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

Version:
$Revision: $

Constructor Summary
protected BamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.apache.camel.Expression<org.apache.camel.Exchange> correlationKeyExpression)
           
protected BamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.apache.camel.Expression<org.apache.camel.Exchange> correlationKeyExpression, Class<T> entitytype)
           
 
Method Summary
protected  Object getCorrelationKey(org.apache.camel.Exchange exchange)
           
 org.apache.camel.Expression<org.apache.camel.Exchange> getCorrelationKeyExpression()
           
 Class<T> getEntityType()
           
 int getMaximumRetries()
           
protected abstract  T loadEntity(org.apache.camel.Exchange exchange, Object key)
           
protected  Object onError(org.springframework.transaction.TransactionStatus status, Throwable e)
           
 void process(org.apache.camel.Exchange exchange)
           
protected abstract  void processEntity(org.apache.camel.Exchange exchange, T entity)
           
protected  Object retryDueToDuplicate(org.springframework.transaction.TransactionStatus status)
           
 void setMaximumRetries(int maximumRetries)
           
 
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,
                              org.apache.camel.Expression<org.apache.camel.Exchange> correlationKeyExpression)

BamProcessorSupport

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

getMaximumRetries

public int getMaximumRetries()

setMaximumRetries

public void setMaximumRetries(int maximumRetries)

process

public void process(org.apache.camel.Exchange exchange)
Specified by:
process in interface org.apache.camel.Processor

getCorrelationKeyExpression

public org.apache.camel.Expression<org.apache.camel.Exchange> getCorrelationKeyExpression()

getEntityType

public Class<T> getEntityType()

processEntity

protected abstract void processEntity(org.apache.camel.Exchange exchange,
                                      T entity)
                               throws Exception
Throws:
Exception

loadEntity

protected abstract T loadEntity(org.apache.camel.Exchange exchange,
                                Object key)

getCorrelationKey

protected Object getCorrelationKey(org.apache.camel.Exchange exchange)
                            throws NoCorrelationKeyException
Throws:
NoCorrelationKeyException

retryDueToDuplicate

protected Object retryDueToDuplicate(org.springframework.transaction.TransactionStatus status)

onError

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


Copyright © 2007 Apache Software Foundation. All Rights Reserved.