|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectGridEventListener
This interface is used to create an implementation of an event listener for
an ObjectGrid. Instances of ObjectGridEventListener
s are set
on the ObjectGrid
interface. Any significant events are
communicated to the application using the methods outlined below.
When using Java 5, this callback also supports new callback annotation mechanism.
ObjectGrid.addEventListener(EventListener)
,
ObjectGrid.removeEventListener(EventListener)
,
EventListener
Method Summary | |
---|---|
void |
destroy()
Called when the ObjectGrid associated with this listener is
destroyed. |
void |
initialize(Session session)
Invoked when an ObjectGrid is initialized. |
void |
transactionBegin(String txid,
boolean isWriteThroughEnabled)
Signals the beginning of a Session transaction. |
void |
transactionEnd(String txid,
boolean isWriteThroughEnabled,
boolean committed,
Collection changes)
Signals the ending of a Session transaction. |
Method Detail |
---|
void initialize(Session session)
ObjectGrid
is initialized.
A usable Session
instance is passed to this listener to
provide all of the necessary access to the various ObjectGrid objects.
session
- a Session instance that this listener is associated with.ObjectGrid.initialize()
void transactionBegin(String txid, boolean isWriteThroughEnabled)
Session
transaction.
A stringified version of the TxID is provided for correlating with the end of the transaction, if so desired. The type of transaction is also provided by the isWriteThroughEnabled boolean parameter.
txid
- Stringified version of the TxIDisWriteThroughEnabled
- boolean flag indicating whether the Session
transaction was started using the
Session.beginNoWriteThrough()
.
method. false
is passed if
beginNoWriteThrough()
was used.Session.begin()
,
Session.beginNoWriteThrough()
void transactionEnd(String txid, boolean isWriteThroughEnabled, boolean committed, Collection changes)
Signals the ending of a Session
transaction.
A string version of the TxID is provided for correlating with the
begin of the transaction, if so desired. Map changes are also reported
with the collection of LogSequence
s passed to this method.
Typical uses of this event are for customers doing custom peer
invalidation or peer commit push. This event listener gives them the
changes. Calls to this method are made after commit and are sequenced so
that they are delivered one by one, not in parallel. The event order is
the commit and rollback order.
For an ObjectGridEventListener receiving changes in an ObjectMap
that is
configured to use a OutputFormat.RAW
for the keys or values,
the keys and values objects in the LogSequences
will be SerializedKey
or SerializedValue
objects respectively. If required, you
can use the SerializedEntry.getObject()
method to retrieve (possibly inflating
the serialized object) the original key or value object.
To override the map's output format configuration, use the PluginOutputFormat
annotation in the implementation class.
txid
- string version of the TxIDisWriteThroughEnabled
- boolean flag indicating whether the Session
transaction was started using the
Session.beginNoWriteThrough()
.
method. false
is passed if
beginNoWriteThrough()
was used.committed
- a boolean flag indicating whether the transaction was
committed (true
) or rolled back
(false
)changes
- a Collection of LogSequences representing the changes
that were committed or rolled back.LogSequence.isRollback()
,
Session.begin()
,
Session.beginNoWriteThrough()
,
Session.commit()
,
Session.rollback()
void destroy()
Called when the ObjectGrid
associated with this listener is
destroyed.
This method is the opposite of the initialize
method. When
it is called, the listener can free up any resources it uses.
ObjectGrid.destroy()
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |