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

Constructor Summary
JpaBamProcessorSupport(TransactionTemplate transactionTemplate, JpaTemplate template, Expression correlationKeyExpression, ActivityRules activityRules)
           
JpaBamProcessorSupport(TransactionTemplate transactionTemplate, JpaTemplate template, Expression correlationKeyExpression, ActivityRules activityRules, Class<T> entitytype)
           
 
Method Summary
protected  T createEntity(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()
           
 JpaTemplate getTemplate()
           
 boolean isCorrelationKeyIsPrimary()
           
protected  T loadEntity(Exchange exchange, Object key)
           
protected  void processEntity(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(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(TransactionTemplate transactionTemplate,
                              JpaTemplate template,
                              Expression correlationKeyExpression,
                              ActivityRules activityRules,
                              Class<T> entitytype)

JpaBamProcessorSupport

public JpaBamProcessorSupport(TransactionTemplate transactionTemplate,
                              JpaTemplate template,
                              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 JpaTemplate getTemplate()

setTemplate

public void setTemplate(JpaTemplate template)

isCorrelationKeyIsPrimary

public boolean isCorrelationKeyIsPrimary()

setCorrelationKeyIsPrimary

public void setCorrelationKeyIsPrimary(boolean correlationKeyIsPrimary)

loadEntity

protected T loadEntity(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(Exchange exchange,
                         Object key)
Create a new instance of the entity for the given key


processEntity

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

createFindByKeyQuery

protected String createFindByKeyQuery()


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