GigaSpaces XAP 10.0.1 API

net.jini.space
Class AvailabilityEvent

java.lang.Object
  extended by java.util.EventObject
      extended by net.jini.core.event.RemoteEvent
          extended by net.jini.space.AvailabilityEvent
All Implemented Interfaces:
Serializable

public abstract class AvailabilityEvent
extends RemoteEvent

A 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.

Since:
2.1
See Also:
JavaSpace05, Serialized Form

Field Summary
 
Fields inherited from class net.jini.core.event.RemoteEvent
eventID, handback, seqNum, source
 
Constructor Summary
protected AvailabilityEvent(JavaSpace source, long eventID, long seqNum, MarshalledObject handback, boolean visibilityTransition)
          Create a new AvailabilityEvent instance.
 
Method Summary
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.
 
Methods inherited from class net.jini.core.event.RemoteEvent
getID, getRegistrationObject, getSequenceNumber
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AvailabilityEvent

protected AvailabilityEvent(JavaSpace source,
                            long eventID,
                            long seqNum,
                            MarshalledObject handback,
                            boolean visibilityTransition)
Create a new AvailabilityEvent instance.

Parameters:
source - the event source
eventID - the event identifier
seqNum - the event sequence number
handback - the handback object
visibilityTransition - true if this event must also signal a transition from invisible to visible
Throws:
NullPointerException - if source is null
Method Detail

getEntry

public abstract Entry getEntry()
                        throws UnusableEntryException
Returns a copy of the Entry whose transition triggered this event. The returned Entry must be unmarshalled in accordance with the Jini(TM) Entry Specification.

Returns:
a copy of the Entry whose transition triggered this event
Throws:
UnusableEntryException - if the Entry can't be unmarshalled in the client. The next call must re-attempt unmarshalling the Entry

getSnapshot

public abstract Entry getSnapshot()
Returns a snapshot of the Entry whose transition triggered this event. Snapshots are defined in section JS.2.6 of the JavaSpaces(TM) 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.

Returns:
a snapshot of the Entry whose transition triggered this event

isVisibilityTransition

public 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.

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

GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.