class TransactableAvailabilityWatcher extends AvailabilityRegistrationWatcher implements Transactable
AvailabilityRegistrationWatcher for
transactional availability event registrations.| Modifier and Type | Field and Description |
|---|---|
private RemoteEventListener |
listener
The listener that should be notified of matches
|
private Txn |
txn
The transaction (represented as a
Txn) this
event registration is associated with. |
cookie, eventID, expiration, handback, visibilityOnlystartOrdinalABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING| Constructor and Description |
|---|
TransactableAvailabilityWatcher(long timestamp,
long startOrdinal,
Uuid cookie,
boolean visibilityOnly,
MarshalledObject handback,
long eventID,
RemoteEventListener listener,
Txn txn)
Create a new
TransactableAvailabilityWatcher. |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(TransactableMgr mgr,
OutriggerServerImpl space)
Just need to terminate this registration.
|
void |
commit(TransactableMgr mgr,
OutriggerServerImpl space)
This should never happen since we always return
NOTCHANGED from prepare. |
(package private) RemoteEventListener |
getListener(ProxyPreparer preparer)
Return the remote listener associated with this
EventRegistrationWatcher. |
(package private) boolean |
isInterested(EntryTransition transition,
long ordinal)
Return
true if this watcher cares about a given
visibility transition. |
int |
prepare(TransactableMgr mgr,
OutriggerServerImpl space)
Just need to terminate this registration and return
NOTCHANGED. |
addTemplateHandle, cancel, cleanup, getCookie, getExpiration, process, removeIfExpired, setExpirationcompareToprivate final RemoteEventListener listener
private final Txn txn
Txn) this
event registration is associated with.TransactableAvailabilityWatcher(long timestamp,
long startOrdinal,
Uuid cookie,
boolean visibilityOnly,
MarshalledObject handback,
long eventID,
RemoteEventListener listener,
Txn txn)
TransactableAvailabilityWatcher.timestamp - the value that is used
to sort TransitionWatchers.startOrdinal - the highest ordinal associated
with operations that are considered to have occurred
before the operation associated with this watcher.cookie - The unique identifier associated
with this watcher. Must not be null.visibilityOnly - pass true if client
only wants visibility eventshandback - The handback object that
should be sent along with event
notifications to the the listener.eventID - The event ID for event type
represented by this object.listener - The object to notify of
matches.txn - The transaction this registration is
associated with.NullPointerException - if the cookie,
listener, or txn arguments are
null.boolean isInterested(EntryTransition transition, long ordinal)
TransitionWatchertrue if this watcher cares about a given
visibility transition. Assumes the transitioning entry matches
the template in the TemplateHandle associated with
this watcher. This method should return a value even if the
expiration time has been reached or remove has
been called. This call should not obtain any locks.isInterested in class TransitionWatchertransition - A EntryTransition that
describes the transition and what
entry is transitioning. This method
will assume that transition.getHandle
returns a non-null value.ordinal - The ordinal associated with transition.true if this watcher is interested
in the indicated transition and false
otherwise.RemoteEventListener getListener(ProxyPreparer preparer)
AvailabilityRegistrationWatcherEventRegistrationWatcher. Optionally
prepare the listener if it has been recovered from
the store and not yet re-prepared.getListener in class AvailabilityRegistrationWatcherEventRegistrationWatcherpublic int prepare(TransactableMgr mgr, OutriggerServerImpl space)
NOTCHANGED.prepare in interface Transactablepublic void commit(TransactableMgr mgr, OutriggerServerImpl space)
NOTCHANGED from prepare.commit in interface Transactablepublic void abort(TransactableMgr mgr, OutriggerServerImpl space)
abort in interface TransactableCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.