org.compass.gps.device.jpa.embedded.openjpa
Class EmbeddedOpenJPAEventListener

java.lang.Object
  extended by org.compass.gps.device.jpa.AbstractCompassJpaEntityListener
      extended by org.compass.gps.device.jpa.AbstractDeviceJpaEntityListener
          extended by org.compass.gps.device.jpa.embedded.openjpa.EmbeddedOpenJPAEventListener
All Implemented Interfaces:
org.apache.openjpa.event.DeleteListener, org.apache.openjpa.event.PersistListener, org.apache.openjpa.event.StoreListener

public class EmbeddedOpenJPAEventListener
extends AbstractDeviceJpaEntityListener
implements org.apache.openjpa.event.DeleteListener, org.apache.openjpa.event.PersistListener, org.apache.openjpa.event.StoreListener

The embedded open JPA event listener listens for after delete/store/persist events and applies them to the index. No transaction handling is perfomed (assumes that it is a managed transaction) and usees OpenJPAHelper.getCurrentCompassSession(javax.persistence.EntityManager) in order to get the actual compass session.

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.gps.device.jpa.AbstractCompassJpaEntityListener
log
 
Constructor Summary
EmbeddedOpenJPAEventListener(JpaGpsDevice device)
           
 
Method Summary
 void afterDelete(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
           
 void afterPersist(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
           
 void afterStore(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
           
 void beforeDelete(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
           
 void beforePersist(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
           
 void beforeStore(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
           
protected  JpaGpsDevice getDevice()
           
 
Methods inherited from class org.compass.gps.device.jpa.AbstractDeviceJpaEntityListener
disable, getCompass
 
Methods inherited from class org.compass.gps.device.jpa.AbstractCompassJpaEntityListener
hasMappingForEntity, hasMappingForEntity, postPersist, postRemove, postUpdate, throwExceptionOnError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedOpenJPAEventListener

public EmbeddedOpenJPAEventListener(JpaGpsDevice device)
Method Detail

getDevice

protected JpaGpsDevice getDevice()
Specified by:
getDevice in class AbstractDeviceJpaEntityListener

beforeDelete

public void beforeDelete(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
Specified by:
beforeDelete in interface org.apache.openjpa.event.DeleteListener

afterDelete

public void afterDelete(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
Specified by:
afterDelete in interface org.apache.openjpa.event.DeleteListener

beforePersist

public void beforePersist(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
Specified by:
beforePersist in interface org.apache.openjpa.event.PersistListener

afterPersist

public void afterPersist(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
Specified by:
afterPersist in interface org.apache.openjpa.event.PersistListener

beforeStore

public void beforeStore(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
Specified by:
beforeStore in interface org.apache.openjpa.event.StoreListener

afterStore

public void afterStore(org.apache.openjpa.event.LifecycleEvent lifecycleEvent)
Specified by:
afterStore in interface org.apache.openjpa.event.StoreListener


Copyright (c) 2004-2009 The Compass Project.