org.compass.gps.device.jpa.lifecycle
Class OpenJPAJpaEntityLifecycleInjector

java.lang.Object
  extended by org.compass.gps.device.jpa.lifecycle.OpenJPAJpaEntityLifecycleInjector
All Implemented Interfaces:
JpaEntityLifecycleInjector

public class OpenJPAJpaEntityLifecycleInjector
extends Object
implements JpaEntityLifecycleInjector

Injects lifecycle listeners directly into OpenJPA for mirroring operations.

Author:
kimchy

Constructor Summary
OpenJPAJpaEntityLifecycleInjector()
           
 
Method Summary
 void injectLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory, JpaGpsDevice device)
          Injects a global lifecycle listener into the concrete EntityManagerFactory implementation.
 void removeLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory, JpaGpsDevice device)
          Removes (if possible) lifecycle listeners injected using the inject method.
 void setClassLoader(ClassLoader classLoader)
           
 void setEventListener(Object eventListener)
          Allows to directly inject the event listener that will be used with Open JPA.
 void setUseSpecificClassEvents(boolean useSpecificClassEvents)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenJPAJpaEntityLifecycleInjector

public OpenJPAJpaEntityLifecycleInjector()
Method Detail

setUseSpecificClassEvents

public void setUseSpecificClassEvents(boolean useSpecificClassEvents)

setClassLoader

public void setClassLoader(ClassLoader classLoader)

setEventListener

public void setEventListener(Object eventListener)
Allows to directly inject the event listener that will be used with Open JPA. Will not use Compass default one (OpenJPAJpaEntityLifecycleInjector.OpenJPAEventListener.


injectLifecycle

public void injectLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory,
                            JpaGpsDevice device)
                     throws JpaGpsDeviceException
Description copied from interface: JpaEntityLifecycleInjector
Injects a global lifecycle listener into the concrete EntityManagerFactory implementation.

Specified by:
injectLifecycle in interface JpaEntityLifecycleInjector
Parameters:
entityManagerFactory - The EntityManagerFactory to inject the global lifecycle to.
device - The Jpa device calling this injector
Throws:
JpaGpsDeviceException

removeLifecycle

public void removeLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory,
                            JpaGpsDevice device)
                     throws JpaGpsDeviceException
Description copied from interface: JpaEntityLifecycleInjector
Removes (if possible) lifecycle listeners injected using the inject method.

Specified by:
removeLifecycle in interface JpaEntityLifecycleInjector
Parameters:
entityManagerFactory - The EMF to remove lifecycle from
device - The Jpa device calling
Throws:
JpaGpsDeviceException


Copyright (c) 2004-2008 The Compass Project.