T
- Managed type parameter@Managed public abstract class Extent<T> extends java.lang.Object
ManagedObject.extent(java.lang.Class<T>)
calls.
An Extent
notifier does not directly return results.
The notification provides an opportunity to change the contents of
a Managed object extent (creating or deleting Managed objects)
before the extent iteration is done.
For example, it could be used for creating Managed objects from data
in a database.
Modifier | Constructor and Description |
---|---|
protected |
Extent(java.lang.Class<T> klass)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
extent(java.lang.Class<? extends T> klass,
LockMode lockMode)
Notifier method for
ManagedObject.extent(Class) calls. |
static Extent<?> |
getNotifier(java.lang.Class<?> klass)
Return the currently installed notifier for a Managed class.
|
protected Extent(java.lang.Class<T> klass) throws ManagedClassError
Creating an instance automatically installs it
as the extent notifier for Managed class T
.
If a notifier is already installed for the class, the new instance replaces the previous instance.
Deleting a notifier automatically uninstalls it.
Notifiers are automatically deleted when the JVM shuts down. Notifiers created in other JVMs are not affected.
A separate notifier may be set for each class in a hierarchy.
If no notifier is installed for a class, it inherits the notifier of its parent.
When a ManagedObject.extent(java.lang.Class<T>)
result set is iterated,
the installed notifier for its type and subtypes are called
before executing the extent call.
The notifiers are called starting at the most extended
subtype up through the type hierarchy ending on the class
passed to the extent call.
The order of notifier invocation for multiple types at the
same level of the type hierarchy is undefined.
klass
- The Managed class base to receive
ManagedObject.extent() notifications for.ManagedClassError
- klass
is not managed.public static Extent<?> getNotifier(java.lang.Class<?> klass)
If there is no notifier for the Managed class null is returned.
klass
- The class to search.ManagedClassError
- If
klass
is not managed.public abstract void extent(java.lang.Class<? extends T> klass, LockMode lockMode)
ManagedObject.extent(Class)
calls.
May be used to create (or delete) objects in the extent before
the extent is iterated.
Called by the system when a ManagedObject.extent(java.lang.Class<T>)
result set is
iterated, before executing the extent call.
Called on each of the nodes in the
QueryScope
of the extent call.
Called before the ManagedObject.extent() is performed.
Work done within Extent.extent() will not generate calls to com.kabira.store notifiers on the local node.
Note: work done within Extent.extent() will generate calls to com.kabira.store notifiers on remote nodes.
klass
- The Managed class for the extent() call.
This may be a subtype of the notifier's managed
class type.lockMode
- The lock mode for the extent call. The notifier
implementation should attempt to honor this lock mode,
but there is no enforcement.