public abstract class AvailabilityEvent extends RemoteEvent
RemoteEvent
marking the transition of an
Entry
from unavailable to
available
.
Note, by the time the event is delivered, the
Entry
whose transition triggered this event may
have transitioned to a state where it is no longer visible
and/or available.
JavaSpace05
,
Serialized FormeventID, handback, seqNum, source
Modifier | Constructor and Description |
---|---|
protected |
AvailabilityEvent(JavaSpace source,
long eventID,
long seqNum,
MarshalledObject handback,
boolean visibilityTransition)
Create a new
AvailabilityEvent instance. |
Modifier and Type | Method and Description |
---|---|
abstract Entry |
getEntry()
Returns a copy of the
Entry whose transition
triggered this event. |
abstract Entry |
getSnapshot()
Returns a snapshot of the
Entry whose
transition triggered this event. |
boolean |
isVisibilityTransition()
Returns
true if the transition that triggered
this event was a transition from invisible to
visible as well as a transition from unavailable to
available, and false otherwise. |
getID, getRegistrationObject, getSequenceNumber
getSource, toString
protected AvailabilityEvent(JavaSpace source, long eventID, long seqNum, MarshalledObject handback, boolean visibilityTransition)
AvailabilityEvent
instance.source
- the event sourceeventID
- the event identifierseqNum
- the event sequence numberhandback
- the handback objectvisibilityTransition
- true
if this event
must also signal a transition from
invisible to visibleNullPointerException
- if source
is
null
public abstract Entry getEntry() throws UnusableEntryException
Entry
whose transition
triggered this event. The returned Entry
must
be unmarshalled in accordance with the Jini
Entry Specification.Entry
whose transition
triggered this eventUnusableEntryException
- if the Entry
can't be unmarshalled in the client. The next call
must re-attempt unmarshalling the
Entry
public abstract Entry getSnapshot()
Entry
whose
transition triggered this event. Snapshots are defined in
section JS.2.6 of the
JavaSpaces Service Specification and are an
alternative representation of a given Entry
produced by a particular space for use with that same
space. Passing a snapshot to a space is generally more
efficient than passing the original Entry
.
Any snapshot returned by this method will meet the same
contract as the object returned by passing the result of
getEntry
to JavaSpace.snapshot
.
Generally there is a cost associated with calling the
JavaSpace.snapshot
method and thus creating a
snapshot using that method is usually only worthwhile if
the resulting snapshot is used more than once. The cost of
invoking this method should be low and should be worthwhile
even if the resulting snapshot is used only once.
Entry
whose
transition triggered this eventpublic boolean isVisibilityTransition()
true
if the transition that triggered
this event was a transition from invisible to
visible as well as a transition from unavailable to
available, and false
otherwise. true
if the transition that triggered
this event was a transition from invisible to visible as
well as a transition from unavailable to available, and
false
otherwise