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

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

public class JpaBamProcessorSupport<T>
extends BamProcessorSupport<T>

A base class for JPA based BAM which can use any entity to store the process instance information which allows derived classes to specialise the process instance entity.

Version:

Constructor Summary
JpaBamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.springframework.orm.jpa.JpaTemplate template, org.apache.camel.Expression correlationKeyExpression, ActivityRules activityRules)
           
JpaBamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.springframework.orm.jpa.JpaTemplate template, org.apache.camel.Expression correlationKeyExpression, ActivityRules activityRules, Class<T> entitytype)
           
 
Method Summary
protected  T createEntity(org.apache.camel.Exchange exchange, Object key)
          Create a new instance of the entity for the given key
protected  String createFindByKeyQuery()
           
protected  T findEntityByCorrelationKey(Object key)
           
 ActivityRules getActivityRules()
           
 String getFindByKeyQuery()
           
 String getKeyPropertyName()
           
protected  Class<?> getKeyType()
           
 org.springframework.orm.jpa.JpaTemplate getTemplate()
           
 boolean isCorrelationKeyIsPrimary()
           
protected  T loadEntity(org.apache.camel.Exchange exchange, Object key)
           
protected  void processEntity(org.apache.camel.Exchange exchange, T entity)
           
 void setActivityRules(ActivityRules activityRules)
           
 void setCorrelationKeyIsPrimary(boolean correlationKeyIsPrimary)
           
 void setFindByKeyQuery(String findByKeyQuery)
           
protected  void setKeyProperty(T entity, Object key)
          Sets the key property on the new entity
 void setKeyPropertyName(String keyPropertyName)
           
protected  void setProcessDefinitionProperty(T entity, ProcessDefinition processDefinition)
           
 void setTemplate(org.springframework.orm.jpa.JpaTemplate template)
           
 
Methods inherited from class org.apache.camel.bam.processor.BamProcessorSupport
getCorrelationKey, getCorrelationKeyExpression, getEntityType, onError, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaBamProcessorSupport

public JpaBamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate,
                              org.springframework.orm.jpa.JpaTemplate template,
                              org.apache.camel.Expression correlationKeyExpression,
                              ActivityRules activityRules,
                              Class<T> entitytype)

JpaBamProcessorSupport

public JpaBamProcessorSupport(org.springframework.transaction.support.TransactionTemplate transactionTemplate,
                              org.springframework.orm.jpa.JpaTemplate template,
                              org.apache.camel.Expression correlationKeyExpression,
                              ActivityRules activityRules)
Method Detail

getFindByKeyQuery

public String getFindByKeyQuery()

setFindByKeyQuery

public void setFindByKeyQuery(String findByKeyQuery)

getActivityRules

public ActivityRules getActivityRules()

setActivityRules

public void setActivityRules(ActivityRules activityRules)

getKeyPropertyName

public String getKeyPropertyName()

setKeyPropertyName

public void setKeyPropertyName(String keyPropertyName)

getTemplate

public org.springframework.orm.jpa.JpaTemplate getTemplate()

setTemplate

public void setTemplate(org.springframework.orm.jpa.JpaTemplate template)

isCorrelationKeyIsPrimary

public boolean isCorrelationKeyIsPrimary()

setCorrelationKeyIsPrimary

public void setCorrelationKeyIsPrimary(boolean correlationKeyIsPrimary)

loadEntity

protected T loadEntity(org.apache.camel.Exchange exchange,
                       Object key)
                throws Exception
Specified by:
loadEntity in class BamProcessorSupport<T>
Throws:
Exception

findEntityByCorrelationKey

protected T findEntityByCorrelationKey(Object key)

getKeyType

protected Class<?> getKeyType()
Specified by:
getKeyType in class BamProcessorSupport<T>

setKeyProperty

protected void setKeyProperty(T entity,
                              Object key)
                       throws Exception
Sets the key property on the new entity

Throws:
Exception

setProcessDefinitionProperty

protected void setProcessDefinitionProperty(T entity,
                                            ProcessDefinition processDefinition)
                                     throws Exception
Throws:
Exception

createEntity

protected T createEntity(org.apache.camel.Exchange exchange,
                         Object key)
Create a new instance of the entity for the given key


processEntity

protected void processEntity(org.apache.camel.Exchange exchange,
                             T entity)
                      throws Exception
Specified by:
processEntity in class BamProcessorSupport<T>
Throws:
Exception

createFindByKeyQuery

protected String createFindByKeyQuery()


Apache Camel