org.datanucleus.jdo
Class JDOCallbackHandler

java.lang.Object
  extended by org.datanucleus.jdo.JDOCallbackHandler
All Implemented Interfaces:
CallbackHandler

public class JDOCallbackHandler
extends java.lang.Object
implements CallbackHandler

CallbackHandler implementation for JDO.


Field Summary
protected static Localiser LOCALISER
          Localiser for messages.
 
Constructor Summary
JDOCallbackHandler()
           
 
Method Summary
 void addListener(java.lang.Object listener, java.lang.Class[] classes)
          Adds a new listener to this handler.
 void close()
          Clear any objects to release resources.
protected  java.util.List getListenersWorkingCopy()
          Accessor for the working copy of the listeners (in case any are added/removed in the callbacks).
 void postAttach(java.lang.Object pc, java.lang.Object detachedPC)
          Callback after the object is attached.
 void postClear(java.lang.Object pc)
          Callback after the fields of the object are cleared.
 void postCreate(java.lang.Object pc)
          Callback after the object has been created.
 void postDelete(java.lang.Object pc)
          Callback after the object is deleted.
 void postDetach(java.lang.Object pc, java.lang.Object detachedPC)
          Callback after the object is detached.
 void postDirty(java.lang.Object pc)
          Callback after the object is made dirty.
 void postLoad(java.lang.Object pc)
          Callback after the fields of the object are loaded.
 void postRefresh(java.lang.Object pc)
          Callback after the fields of the object are refreshed.
 void postStore(java.lang.Object pc)
          Callback after the object is stored.
 void preAttach(java.lang.Object pc)
          Callback before the object is attached.
 void preClear(java.lang.Object pc)
          Callback before the fields of the object are cleared.
 void preDelete(java.lang.Object pc)
          Callback before the object is deleted.
 void preDetach(java.lang.Object pc)
          Callback before the object is detached.
 void preDirty(java.lang.Object pc)
          Callback before the object is made dirty.
 void prePersist(java.lang.Object pc)
          Callback before the object is persisted (just before the lifecycle state change).
 void preStore(java.lang.Object pc)
          Callback before the object is stored.
 void removeListener(java.lang.Object listener)
          Remove a listener for this handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localiser for messages.

Constructor Detail

JDOCallbackHandler

public JDOCallbackHandler()
Method Detail

postCreate

public void postCreate(java.lang.Object pc)
Callback after the object has been created.

Specified by:
postCreate in interface CallbackHandler
Parameters:
pc - The Object

prePersist

public void prePersist(java.lang.Object pc)
Callback before the object is persisted (just before the lifecycle state change).

Specified by:
prePersist in interface CallbackHandler
Parameters:
pc - The Object

preStore

public void preStore(java.lang.Object pc)
Callback before the object is stored.

Specified by:
preStore in interface CallbackHandler
Parameters:
pc - The Object

postStore

public void postStore(java.lang.Object pc)
Callback after the object is stored.

Specified by:
postStore in interface CallbackHandler
Parameters:
pc - The Object

preClear

public void preClear(java.lang.Object pc)
Callback before the fields of the object are cleared.

Specified by:
preClear in interface CallbackHandler
Parameters:
pc - The Object

postClear

public void postClear(java.lang.Object pc)
Callback after the fields of the object are cleared.

Specified by:
postClear in interface CallbackHandler
Parameters:
pc - The Object

preDelete

public void preDelete(java.lang.Object pc)
Callback before the object is deleted.

Specified by:
preDelete in interface CallbackHandler
Parameters:
pc - The Object

postDelete

public void postDelete(java.lang.Object pc)
Callback after the object is deleted.

Specified by:
postDelete in interface CallbackHandler
Parameters:
pc - The Object

preDirty

public void preDirty(java.lang.Object pc)
Callback before the object is made dirty.

Specified by:
preDirty in interface CallbackHandler
Parameters:
pc - The Object

postDirty

public void postDirty(java.lang.Object pc)
Callback after the object is made dirty.

Specified by:
postDirty in interface CallbackHandler
Parameters:
pc - The Object

postLoad

public void postLoad(java.lang.Object pc)
Callback after the fields of the object are loaded.

Specified by:
postLoad in interface CallbackHandler
Parameters:
pc - The Object

postRefresh

public void postRefresh(java.lang.Object pc)
Callback after the fields of the object are refreshed.

Specified by:
postRefresh in interface CallbackHandler
Parameters:
pc - The Object

preDetach

public void preDetach(java.lang.Object pc)
Callback before the object is detached.

Specified by:
preDetach in interface CallbackHandler
Parameters:
pc - The Object

postDetach

public void postDetach(java.lang.Object pc,
                       java.lang.Object detachedPC)
Callback after the object is detached.

Specified by:
postDetach in interface CallbackHandler
Parameters:
pc - The Object
detachedPC - The detached object

preAttach

public void preAttach(java.lang.Object pc)
Callback before the object is attached.

Specified by:
preAttach in interface CallbackHandler
Parameters:
pc - The Object

postAttach

public void postAttach(java.lang.Object pc,
                       java.lang.Object detachedPC)
Callback after the object is attached.

Specified by:
postAttach in interface CallbackHandler
Parameters:
pc - The attached Object
detachedPC - The detached object

addListener

public void addListener(java.lang.Object listener,
                        java.lang.Class[] classes)
Adds a new listener to this handler.

Specified by:
addListener in interface CallbackHandler
Parameters:
listener - the listener instance
classes - the persistent classes which events are fired for the listener

removeListener

public void removeListener(java.lang.Object listener)
Remove a listener for this handler.

Specified by:
removeListener in interface CallbackHandler
Parameters:
listener - the listener instance

close

public void close()
Clear any objects to release resources.

Specified by:
close in interface CallbackHandler

getListenersWorkingCopy

protected java.util.List getListenersWorkingCopy()
Accessor for the working copy of the listeners (in case any are added/removed in the callbacks).

Returns:
The working copy


Copyright © 2010. All Rights Reserved.