Package org.exolab.castor.persist.spi
Interface CallbackInterceptor
- All Known Implementing Classes:
JDOCallback
,JPACallbackHandler
public interface CallbackInterceptor
A callback interceptor informs objects about changes to their
state. Different callbacks can cause different methods to be
called on the objects.
- Version:
- $Revision: 8623 $ $Date: 2005-04-17 04:29:33 -0600 (Sun, 17 Apr 2005) $
- Author:
- Assaf Arkin
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called to indicate that an object has been created.void
Called to indicate that an object is to be created in persistent storage.Class<?>
loaded
(Object object, AccessMode accessMode) Called to indicate that the object has been loaded from persistent storage.void
Called to indicate that an object has been modified and is up to storing.void
Called to indicate that an object has been made transient.void
Called to indicate that an object has been deleted.void
Called to indicate that an object is to be deleted.void
Called to indicate that an object is to be stored in persistent storage.void
Called to indicate that an object has been updated at the end of a "long" transaction.void
Called to indicate that an object has been made persistent.
-
Method Details
-
loaded
Called to indicate that the object has been loaded from persistent storage.- Parameters:
object
- The object- Returns:
- null or the extending Class. In the latter case Castor will reload the object of the given class with the same identity.
- Throws:
Exception
- An exception occured, the object cannot be loaded
-
modifying
Called to indicate that an object has been modified and is up to storing.- Parameters:
object
- The object- Throws:
Exception
- An exception occured, the object cannot be stored
-
storing
Called to indicate that an object is to be stored in persistent storage.- Parameters:
object
- The objectmodified
- Is the object modified?- Throws:
Exception
- An exception occured, the object cannot be stored
-
creating
Called to indicate that an object is to be created in persistent storage.- Parameters:
object
- The objectdb
- The database in which this object will be created- Throws:
Exception
-
created
Called to indicate that an object has been created.- Parameters:
object
- The object- Throws:
Exception
-
removing
Called to indicate that an object is to be deleted.This method is made at commit time on objects deleted during the transaction before setting their fields to null.
- Parameters:
object
- The object- Throws:
Exception
-
removed
Called to indicate that an object has been deleted.This method is called during db.remove().
- Parameters:
object
- The object- Throws:
Exception
-
releasing
Called to indicate that an object has been made transient.This method is made at commit or rollback time on all objects that were presistent during the life time of the transaction.
- Parameters:
object
- The objectcommitted
- True if the object has been commited, false if rollback or otherwise cancelled
-
using
Called to indicate that an object has been made persistent.- Parameters:
object
- The objectdb
- The database to which this object belongs
-
updated
Called to indicate that an object has been updated at the end of a "long" transaction.- Parameters:
object
- The object- Throws:
Exception
-