org.apache.camel.component.jpa
Class JpaTemplateTransactionStrategy

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.component.jpa.JpaTemplateTransactionStrategy
All Implemented Interfaces:
TransactionStrategy, Service

public class JpaTemplateTransactionStrategy
extends ServiceSupport
implements TransactionStrategy

Delegates the strategy to the JpaTemplate and TransactionTemplate for transaction handling

Version:
$Revision: 769677 $

Constructor Summary
JpaTemplateTransactionStrategy(JpaTemplate jpaTemplate, TransactionTemplate transactionTemplate)
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 Object execute(JpaCallback callback)
           
static JpaTemplateTransactionStrategy newInstance(EntityManagerFactory emf)
          Creates a new implementation from the given JPA factory
static JpaTemplateTransactionStrategy newInstance(EntityManagerFactory emf, JpaTemplate template)
          Creates a new implementation from the given JPA factory and JPA template
static JpaTemplateTransactionStrategy newInstance(PlatformTransactionManager transactionManager, JpaTemplate template)
          Creates a new implementation from the given Transaction Manager and JPA template
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

JpaTemplateTransactionStrategy

public JpaTemplateTransactionStrategy(JpaTemplate jpaTemplate,
                                      TransactionTemplate transactionTemplate)
Method Detail

newInstance

public static JpaTemplateTransactionStrategy newInstance(EntityManagerFactory emf)
Creates a new implementation from the given JPA factory


newInstance

public static JpaTemplateTransactionStrategy newInstance(EntityManagerFactory emf,
                                                         JpaTemplate template)
Creates a new implementation from the given JPA factory and JPA template


newInstance

public static JpaTemplateTransactionStrategy newInstance(PlatformTransactionManager transactionManager,
                                                         JpaTemplate template)
Creates a new implementation from the given Transaction Manager and JPA template


execute

public Object execute(JpaCallback callback)
Specified by:
execute in interface TransactionStrategy

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception


Apache CAMEL