Package com.db4o.events
Interface EventRegistry
-
- All Known Implementing Classes:
ClientEventRegistryImpl
,EventRegistryImpl
public interface EventRegistry
Provides the interface to register event handlers forObjectContainer
events.
EventRegistry methods represent events available. An EventRegistry instance can be obtained from theEventRegistryFactory
.forObjectContainer
. A new callback can be registered for an event with the following code:EventRegistry registry = EventRegistryFactory.forObjectContainer(container);
registry.created().addListener(new EventListener4(){...});- See Also:
EventRegistryFactory
,EventListener4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Event4<ObjectInfoEventArgs>
activated()
This event is fired after an object is activated.Event4<CancellableObjectEventArgs>
activating()
This event is fired before an object is activated.Event4<ClassEventArgs>
classRegistered()
This event is fired when a new class is registered with metadata.Event4<ObjectContainerEventArgs>
closing()
This event is fired when theObjectContainer.close()
is called.Event4<CommitEventArgs>
committed()
This event is fired after a transaction has been committed.Event4<CommitEventArgs>
committing()
This event is fired just before a transaction is committed.Event4<ObjectInfoEventArgs>
created()
This event is fired after an object is created (saved for the first time).Event4<CancellableObjectEventArgs>
creating()
This event is fired before an object is saved for the first time.Event4<ObjectInfoEventArgs>
deactivated()
This event is fired after an object is deactivated.Event4
deactivating()
This event is fired before an object is deactivated.Event4<ObjectInfoEventArgs>
deleted()
This event is fired after an object is deleted.Event4<CancellableObjectEventArgs>
deleting()
This event is fired before an object is deleted.Event4<ObjectInfoEventArgs>
instantiated()
This event is fired when a persistent object is instantiated.Event4<ObjectContainerEventArgs>
opened()
This event is fired when theObjectContainer
has finished its startup procedure.Event4<QueryEventArgs>
queryFinished()
This event is fired upon a query end and can be used to gather query statistics.Event4<QueryEventArgs>
queryStarted()
This event is fired upon a query start and can be used to gather query statistics.Event4<ObjectInfoEventArgs>
updated()
This event is fired after an object is updated.Event4<CancellableObjectEventArgs>
updating()
This event is fired before an object is updated.
-
-
-
Method Detail
-
queryStarted
Event4<QueryEventArgs> queryStarted()
This event is fired upon a query start and can be used to gather query statistics. The query object is available fromQueryEventArgs
event parameter.- Returns:
- event
- See Also:
QueryEventArgs
-
queryFinished
Event4<QueryEventArgs> queryFinished()
This event is fired upon a query end and can be used to gather query statistics. The query object is available fromQueryEventArgs
event parameter.- Returns:
- event
- See Also:
QueryEventArgs
-
creating
Event4<CancellableObjectEventArgs> creating()
This event is fired before an object is saved for the first time. The object can be obtained fromCancellableObjectEventArgs
event parameter. The action can be cancelled usingCancellableObjectEventArgs.cancel()
- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.store(Object)
-
activating
Event4<CancellableObjectEventArgs> activating()
This event is fired before an object is activated. The object can be obtained fromCancellableObjectEventArgs
event parameter. The action can be cancelled usingCancellableObjectEventArgs.cancel()
- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.activate(Object, int)
-
updating
Event4<CancellableObjectEventArgs> updating()
This event is fired before an object is updated. The object can be obtained fromCancellableObjectEventArgs
event parameter. The action can be cancelled usingCancellableObjectEventArgs.cancel()
- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.store(Object)
-
deleting
Event4<CancellableObjectEventArgs> deleting()
This event is fired before an object is deleted. The object can be obtained fromCancellableObjectEventArgs
event parameter. The action can be cancelled usingCancellableObjectEventArgs.cancel()
Note, that this event is not available in networked client/server mode and will throw an exception when attached to a client ObjectContainer.- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.delete(Object)
-
deactivating
Event4 deactivating()
This event is fired before an object is deactivated. The object can be obtained fromCancellableObjectEventArgs
event parameter. The action can be cancelled usingCancellableObjectEventArgs.cancel()
- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.deactivate(Object, int)
-
activated
Event4<ObjectInfoEventArgs> activated()
This event is fired after an object is activated. The object can be obtained from theObjectInfoEventArgs
event parameter.
The event can be used to trigger some post-activation functionality.- Returns:
- event
- See Also:
ObjectInfoEventArgs
,ObjectContainer.activate(Object, int)
-
created
Event4<ObjectInfoEventArgs> created()
This event is fired after an object is created (saved for the first time). The object can be obtained from theObjectInfoEventArgs
event parameter.
The event can be used to trigger some post-creation functionality.- Returns:
- event
- See Also:
ObjectEventArgs
,ObjectContainer.store(Object)
-
updated
Event4<ObjectInfoEventArgs> updated()
This event is fired after an object is updated. The object can be obtained from theObjectInfoEventArgs
event parameter.
The event can be used to trigger some post-update functionality.- Returns:
- event
- See Also:
ObjectInfoEventArgs
,ObjectContainer.store(Object)
-
deleted
Event4<ObjectInfoEventArgs> deleted()
This event is fired after an object is deleted. The object can be obtained from theObjectInfoEventArgs
event parameter.
The event can be used to trigger some post-deletion functionality.
Note, that this event is not available in networked client/server mode and will throw an exception when attached to a client ObjectContainer.- Returns:
- event
- See Also:
ObjectEventArgs
,ObjectContainer.delete(Object)
-
deactivated
Event4<ObjectInfoEventArgs> deactivated()
This event is fired after an object is deactivated. The object can be obtained from theObjectInfoEventArgs
event parameter.
The event can be used to trigger some post-deactivation functionality.- Returns:
- event
- See Also:
ObjectEventArgs
,ObjectContainer.delete(Object)
-
committing
Event4<CommitEventArgs> committing()
This event is fired just before a transaction is committed. The transaction and a list of the modified objects can be obtained from theCommitEventArgs
event parameter.
Committing event gives a user a chance to interrupt the commit and rollback the transaction.- Returns:
- event
- See Also:
CommitEventArgs
,ObjectContainer.commit()
-
committed
Event4<CommitEventArgs> committed()
This event is fired after a transaction has been committed. The transaction and a list of the modified objects can be obtained from theCommitEventArgs
event parameter.
The event can be used to trigger some post-commit functionality.- Returns:
- event
- See Also:
CommitEventArgs
,ObjectContainer.commit()
-
instantiated
Event4<ObjectInfoEventArgs> instantiated()
This event is fired when a persistent object is instantiated. The object can be obtained from theObjectInfoEventArgs
event parameter.- Returns:
- event
- See Also:
ObjectInfoEventArgs
-
classRegistered
Event4<ClassEventArgs> classRegistered()
This event is fired when a new class is registered with metadata. The class information can be obtained fromClassEventArgs
event parameter.- Returns:
- event
- See Also:
ClassEventArgs
-
closing
Event4<ObjectContainerEventArgs> closing()
This event is fired when theObjectContainer.close()
is called.- Returns:
- event
-
opened
Event4<ObjectContainerEventArgs> opened()
This event is fired when theObjectContainer
has finished its startup procedure.- Returns:
- event
-
-