Package com.db4o.internal.events
Class EventRegistryImpl
- java.lang.Object
-
- com.db4o.internal.events.EventRegistryImpl
-
- All Implemented Interfaces:
EventRegistry
,Callbacks
- Direct Known Subclasses:
ClientEventRegistryImpl
public class EventRegistryImpl extends java.lang.Object implements Callbacks, EventRegistry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
EventRegistryImpl.CommittedEvent
-
Field Summary
Fields Modifier and Type Field Description protected Event4Impl
_activated
protected Event4Impl
_activating
protected Event4Impl
_classRegistered
protected Event4Impl
_closing
protected Event4Impl
_committed
protected Event4Impl
_committing
protected Event4Impl
_created
protected Event4Impl
_creating
protected Event4Impl
_deactivated
protected Event4Impl
_deactivating
protected Event4Impl
_deleted
protected Event4Impl
_deleting
protected Event4Impl
_instantiated
protected Event4Impl
_opened
protected Event4Impl
_queryFinished
protected Event4Impl
_queryStarted
protected Event4Impl
_updated
protected Event4Impl
_updating
-
Constructor Summary
Constructors Constructor Description EventRegistryImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Event4
activated()
This event is fired after an object is activated.Event4
activating()
This event is fired before an object is activated.boolean
caresAboutCommitted()
boolean
caresAboutCommitting()
boolean
caresAboutDeleted()
boolean
caresAboutDeleting()
void
classOnRegistered(ClassMetadata clazz)
Event4
classRegistered()
This event is fired when a new class is registered with metadata.void
closeOnStarted(ObjectContainer container)
Event4
closing()
This event is fired when theObjectContainer.close()
is called.void
commitOnCompleted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections, boolean isOwnCommit)
void
commitOnStarted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections)
Event4
committed()
This event is fired after a transaction has been committed.Event4
committing()
This event is fired just before a transaction is committed.Event4
created()
This event is fired after an object is created (saved for the first time).Event4
creating()
This event is fired before an object is saved for the first time.Event4
deactivated()
This event is fired after an object is deactivated.Event4
deactivating()
This event is fired before an object is deactivated.Event4
deleted()
This event is fired after an object is deleted.Event4
deleting()
This event is fired before an object is deleted.static boolean
inCallback(InternalObjectContainer container)
Event4
instantiated()
This event is fired when a persistent object is instantiated.boolean
objectCanActivate(Transaction transaction, java.lang.Object obj)
boolean
objectCanDeactivate(Transaction transaction, ObjectInfo objectInfo)
boolean
objectCanDelete(Transaction transaction, ObjectInfo objectInfo)
boolean
objectCanNew(Transaction transaction, java.lang.Object obj)
boolean
objectCanUpdate(Transaction transaction, ObjectInfo objectInfo)
void
objectOnActivate(Transaction transaction, ObjectInfo obj)
void
objectOnDeactivate(Transaction transaction, ObjectInfo obj)
void
objectOnDelete(Transaction transaction, ObjectInfo obj)
void
objectOnInstantiate(Transaction transaction, ObjectInfo obj)
void
objectOnNew(Transaction transaction, ObjectInfo obj)
void
objectOnUpdate(Transaction transaction, ObjectInfo obj)
protected void
onCommittedListenerAdded()
Event4<ObjectContainerEventArgs>
opened()
This event is fired when theObjectContainer
has finished its startup procedure.void
openOnFinished(ObjectContainer container)
Event4
queryFinished()
This event is fired upon a query end and can be used to gather query statistics.void
queryOnFinished(Transaction transaction, Query query)
void
queryOnStarted(Transaction transaction, Query query)
Event4
queryStarted()
This event is fired upon a query start and can be used to gather query statistics.Event4
updated()
This event is fired after an object is updated.Event4
updating()
This event is fired before an object is updated.
-
-
-
Field Detail
-
_queryStarted
protected final Event4Impl _queryStarted
-
_queryFinished
protected final Event4Impl _queryFinished
-
_creating
protected final Event4Impl _creating
-
_activating
protected final Event4Impl _activating
-
_updating
protected final Event4Impl _updating
-
_deleting
protected final Event4Impl _deleting
-
_deactivating
protected final Event4Impl _deactivating
-
_created
protected final Event4Impl _created
-
_activated
protected final Event4Impl _activated
-
_updated
protected final Event4Impl _updated
-
_deleted
protected final Event4Impl _deleted
-
_deactivated
protected final Event4Impl _deactivated
-
_committing
protected final Event4Impl _committing
-
_committed
protected final Event4Impl _committed
-
_instantiated
protected final Event4Impl _instantiated
-
_classRegistered
protected final Event4Impl _classRegistered
-
_closing
protected final Event4Impl _closing
-
_opened
protected final Event4Impl _opened
-
-
Method Detail
-
queryOnFinished
public void queryOnFinished(Transaction transaction, Query query)
- Specified by:
queryOnFinished
in interfaceCallbacks
-
queryOnStarted
public void queryOnStarted(Transaction transaction, Query query)
- Specified by:
queryOnStarted
in interfaceCallbacks
-
objectCanNew
public boolean objectCanNew(Transaction transaction, java.lang.Object obj)
- Specified by:
objectCanNew
in interfaceCallbacks
-
objectCanActivate
public boolean objectCanActivate(Transaction transaction, java.lang.Object obj)
- Specified by:
objectCanActivate
in interfaceCallbacks
-
objectCanUpdate
public boolean objectCanUpdate(Transaction transaction, ObjectInfo objectInfo)
- Specified by:
objectCanUpdate
in interfaceCallbacks
-
objectCanDelete
public boolean objectCanDelete(Transaction transaction, ObjectInfo objectInfo)
- Specified by:
objectCanDelete
in interfaceCallbacks
-
objectCanDeactivate
public boolean objectCanDeactivate(Transaction transaction, ObjectInfo objectInfo)
- Specified by:
objectCanDeactivate
in interfaceCallbacks
-
objectOnActivate
public void objectOnActivate(Transaction transaction, ObjectInfo obj)
- Specified by:
objectOnActivate
in interfaceCallbacks
-
objectOnNew
public void objectOnNew(Transaction transaction, ObjectInfo obj)
- Specified by:
objectOnNew
in interfaceCallbacks
-
objectOnUpdate
public void objectOnUpdate(Transaction transaction, ObjectInfo obj)
- Specified by:
objectOnUpdate
in interfaceCallbacks
-
objectOnDelete
public void objectOnDelete(Transaction transaction, ObjectInfo obj)
- Specified by:
objectOnDelete
in interfaceCallbacks
-
classOnRegistered
public void classOnRegistered(ClassMetadata clazz)
- Specified by:
classOnRegistered
in interfaceCallbacks
-
objectOnDeactivate
public void objectOnDeactivate(Transaction transaction, ObjectInfo obj)
- Specified by:
objectOnDeactivate
in interfaceCallbacks
-
objectOnInstantiate
public void objectOnInstantiate(Transaction transaction, ObjectInfo obj)
- Specified by:
objectOnInstantiate
in interfaceCallbacks
-
commitOnStarted
public void commitOnStarted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections)
- Specified by:
commitOnStarted
in interfaceCallbacks
-
commitOnCompleted
public void commitOnCompleted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections, boolean isOwnCommit)
- Specified by:
commitOnCompleted
in interfaceCallbacks
-
closeOnStarted
public void closeOnStarted(ObjectContainer container)
- Specified by:
closeOnStarted
in interfaceCallbacks
-
openOnFinished
public void openOnFinished(ObjectContainer container)
- Specified by:
openOnFinished
in interfaceCallbacks
-
queryFinished
public Event4 queryFinished()
Description copied from interface:EventRegistry
This event is fired upon a query end and can be used to gather query statistics. The query object is available fromQueryEventArgs
event parameter.- Specified by:
queryFinished
in interfaceEventRegistry
- Returns:
- event
- See Also:
QueryEventArgs
-
queryStarted
public Event4 queryStarted()
Description copied from interface:EventRegistry
This event is fired upon a query start and can be used to gather query statistics. The query object is available fromQueryEventArgs
event parameter.- Specified by:
queryStarted
in interfaceEventRegistry
- Returns:
- event
- See Also:
QueryEventArgs
-
creating
public Event4 creating()
Description copied from interface:EventRegistry
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()
- Specified by:
creating
in interfaceEventRegistry
- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.store(Object)
-
activating
public Event4 activating()
Description copied from interface:EventRegistry
This event is fired before an object is activated. The object can be obtained fromCancellableObjectEventArgs
event parameter. The action can be cancelled usingCancellableObjectEventArgs.cancel()
- Specified by:
activating
in interfaceEventRegistry
- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.activate(Object, int)
-
updating
public Event4 updating()
Description copied from interface:EventRegistry
This event is fired before an object is updated. The object can be obtained fromCancellableObjectEventArgs
event parameter. The action can be cancelled usingCancellableObjectEventArgs.cancel()
- Specified by:
updating
in interfaceEventRegistry
- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.store(Object)
-
deleting
public Event4 deleting()
Description copied from interface:EventRegistry
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.- Specified by:
deleting
in interfaceEventRegistry
- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.delete(Object)
-
deactivating
public Event4 deactivating()
Description copied from interface:EventRegistry
This event is fired before an object is deactivated. The object can be obtained fromCancellableObjectEventArgs
event parameter. The action can be cancelled usingCancellableObjectEventArgs.cancel()
- Specified by:
deactivating
in interfaceEventRegistry
- Returns:
- event
- See Also:
CancellableObjectEventArgs
,ObjectContainer.deactivate(Object, int)
-
created
public Event4 created()
Description copied from interface:EventRegistry
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.- Specified by:
created
in interfaceEventRegistry
- Returns:
- event
- See Also:
ObjectEventArgs
,ObjectContainer.store(Object)
-
activated
public Event4 activated()
Description copied from interface:EventRegistry
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.- Specified by:
activated
in interfaceEventRegistry
- Returns:
- event
- See Also:
ObjectInfoEventArgs
,ObjectContainer.activate(Object, int)
-
updated
public Event4 updated()
Description copied from interface:EventRegistry
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.- Specified by:
updated
in interfaceEventRegistry
- Returns:
- event
- See Also:
ObjectInfoEventArgs
,ObjectContainer.store(Object)
-
deleted
public Event4 deleted()
Description copied from interface:EventRegistry
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.- Specified by:
deleted
in interfaceEventRegistry
- Returns:
- event
- See Also:
ObjectEventArgs
,ObjectContainer.delete(Object)
-
deactivated
public Event4 deactivated()
Description copied from interface:EventRegistry
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.- Specified by:
deactivated
in interfaceEventRegistry
- Returns:
- event
- See Also:
ObjectEventArgs
,ObjectContainer.delete(Object)
-
committing
public Event4 committing()
Description copied from interface:EventRegistry
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.- Specified by:
committing
in interfaceEventRegistry
- Returns:
- event
- See Also:
CommitEventArgs
,ObjectContainer.commit()
-
committed
public Event4 committed()
Description copied from interface:EventRegistry
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.- Specified by:
committed
in interfaceEventRegistry
- Returns:
- event
- See Also:
CommitEventArgs
,ObjectContainer.commit()
-
classRegistered
public Event4 classRegistered()
Description copied from interface:EventRegistry
This event is fired when a new class is registered with metadata. The class information can be obtained fromClassEventArgs
event parameter.- Specified by:
classRegistered
in interfaceEventRegistry
- Returns:
- event
- See Also:
ClassEventArgs
-
instantiated
public Event4 instantiated()
Description copied from interface:EventRegistry
This event is fired when a persistent object is instantiated. The object can be obtained from theObjectInfoEventArgs
event parameter.- Specified by:
instantiated
in interfaceEventRegistry
- Returns:
- event
- See Also:
ObjectInfoEventArgs
-
closing
public Event4 closing()
Description copied from interface:EventRegistry
This event is fired when theObjectContainer.close()
is called.- Specified by:
closing
in interfaceEventRegistry
- Returns:
- event
-
onCommittedListenerAdded
protected void onCommittedListenerAdded()
-
caresAboutCommitting
public boolean caresAboutCommitting()
- Specified by:
caresAboutCommitting
in interfaceCallbacks
-
caresAboutCommitted
public boolean caresAboutCommitted()
- Specified by:
caresAboutCommitted
in interfaceCallbacks
-
caresAboutDeleting
public boolean caresAboutDeleting()
- Specified by:
caresAboutDeleting
in interfaceCallbacks
-
caresAboutDeleted
public boolean caresAboutDeleted()
- Specified by:
caresAboutDeleted
in interfaceCallbacks
-
opened
public Event4<ObjectContainerEventArgs> opened()
Description copied from interface:EventRegistry
This event is fired when theObjectContainer
has finished its startup procedure.- Specified by:
opened
in interfaceEventRegistry
- Returns:
- event
-
inCallback
public static boolean inCallback(InternalObjectContainer container)
-
-