Package com.db4o.ext
Interface ObjectCallbacks
-
public interface ObjectCallbacks
callback methods.
This interface only serves as a list of all available callback methods. Every method is called individually, independantly of implementing this interface.
Using callbacks
Simply implement one or more of the listed methods in your application classes to do tasks before activation, deactivation, delete, new or update, to cancel the action about to be performed and to respond to the performed task.
Callback methods are typically used for:
- cascaded delete
- cascaded update
- cascaded activation
- restoring transient members on instantiation
Callback methods follow regular calling conventions. Methods in superclasses need to be called explicitely.
All method calls are implemented to occur only once, upon one event.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
objectCanActivate(ObjectContainer container)
called before an Object is activated.boolean
objectCanDeactivate(ObjectContainer container)
called before an Object is deactivated.boolean
objectCanDelete(ObjectContainer container)
called before an Object is deleted.boolean
objectCanNew(ObjectContainer container)
called before an Object is stored the first time.boolean
objectCanUpdate(ObjectContainer container)
called before a persisted Object is updated.void
objectOnActivate(ObjectContainer container)
called upon activation of an object.void
objectOnDeactivate(ObjectContainer container)
called upon deactivation of an object.void
objectOnDelete(ObjectContainer container)
called after an object was deleted.void
objectOnNew(ObjectContainer container)
called after a new object was stored.void
objectOnUpdate(ObjectContainer container)
called after an object was updated.
-
-
-
Method Detail
-
objectCanActivate
boolean objectCanActivate(ObjectContainer container)
called before an Object is activated.- Parameters:
container
- the ObjectContainer the object is stored in.- Returns:
- false to prevent activation.
-
objectCanDeactivate
boolean objectCanDeactivate(ObjectContainer container)
called before an Object is deactivated.- Parameters:
container
- the ObjectContainer the object is stored in.- Returns:
- false to prevent deactivation.
-
objectCanDelete
boolean objectCanDelete(ObjectContainer container)
called before an Object is deleted.
In a client/server setup this callback method will be executed on the server.- Parameters:
container
- the ObjectContainer the object is stored in.- Returns:
- false to prevent the object from being deleted.
-
objectCanNew
boolean objectCanNew(ObjectContainer container)
called before an Object is stored the first time.- Parameters:
container
- the ObjectContainer is about to be stored to.- Returns:
- false to prevent the object from being stored.
-
objectCanUpdate
boolean objectCanUpdate(ObjectContainer container)
called before a persisted Object is updated.- Parameters:
container
- the ObjectContainer the object is stored in.- Returns:
- false to prevent the object from being updated.
-
objectOnActivate
void objectOnActivate(ObjectContainer container)
called upon activation of an object.- Parameters:
container
- the ObjectContainer the object is stored in.
-
objectOnDeactivate
void objectOnDeactivate(ObjectContainer container)
called upon deactivation of an object.- Parameters:
container
- the ObjectContainer the object is stored in.
-
objectOnDelete
void objectOnDelete(ObjectContainer container)
called after an object was deleted.
In a client/server setup this callback method will be executed on the server.- Parameters:
container
- the ObjectContainer the object was stored in.
-
objectOnNew
void objectOnNew(ObjectContainer container)
called after a new object was stored.- Parameters:
container
- the ObjectContainer the object is stored to.
-
objectOnUpdate
void objectOnUpdate(ObjectContainer container)
called after an object was updated.- Parameters:
container
- the ObjectContainer the object is stored in.
-
-