org.sharengo.wikitty.jpa
Class JtaPersistenceUnitPostProcessor

java.lang.Object
  extended by org.sharengo.wikitty.jpa.JtaPersistenceUnitPostProcessor
All Implemented Interfaces:
org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor

public class JtaPersistenceUnitPostProcessor
extends Object
implements org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor

the JtaPersistenceUnitPostProcessor enables us to define the JTA capable datasource which should be used by the JPA provider directly as a reference within the Spring configuration file.

Version:
$Revision: 1 $ Last update: $Date: 2010-04-16 10:29:38 +0200 (ven., 16 avril 2010) $ by : $Author: echatellier $
Author:
ruchaud

Constructor Summary
JtaPersistenceUnitPostProcessor()
           
 
Method Summary
 DataSource getJtaDataSource()
          getter for jtaDataSource
 void postProcessPersistenceUnitInfo(org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo mutablePersistenceUnitInfo)
          enrich the PersistenceUnitInfo read from the persistence.xml configuration file with a reference to the jtaDataSource injected via the Spring configuration. the JTA capable datasource is then used by the LocalContainerEntityManagerFactoryBean to create the EntityManagerFactory
 void setJtaDataSource(DataSource jtaDataSource)
          setter for jtaDataSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JtaPersistenceUnitPostProcessor

public JtaPersistenceUnitPostProcessor()
Method Detail

postProcessPersistenceUnitInfo

public void postProcessPersistenceUnitInfo(org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo mutablePersistenceUnitInfo)
enrich the PersistenceUnitInfo read from the persistence.xml configuration file with a reference to the jtaDataSource injected via the Spring configuration. the JTA capable datasource is then used by the LocalContainerEntityManagerFactoryBean to create the EntityManagerFactory

Specified by:
postProcessPersistenceUnitInfo in interface org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor
See Also:
PersistenceUnitPostProcessor.postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo)

getJtaDataSource

public DataSource getJtaDataSource()
getter for jtaDataSource

Returns:
the JTA capable datasource supplied via the setter

setJtaDataSource

public void setJtaDataSource(DataSource jtaDataSource)
setter for jtaDataSource

Parameters:
jtaDataSource - the JTA capable datasource added to the PersistenceUnitInfo during post processing


Copyright © 2009-2010 CodeLutin. All Rights Reserved.