Package net.jini.core.lookup
Class ServiceEvent
java.lang.Object
java.util.EventObject
net.jini.core.event.RemoteEvent
net.jini.core.lookup.ServiceEvent
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RegistrarEvent
This class is used for remote events sent by the lookup service. It extends RemoteEvent with
methods to obtain the service ID of the matched item, the transition that triggered the event,
and the new state of the item.
Sequence numbers for a given event ID are strictly increasing. If there is no gap between two sequence numbers, no events have been missed; if there is a gap, events might (but might not) have been missed. For example, a gap might occur if the lookup service crashes, even if no events are lost due to the crash.
- Since:
- 1.0
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ServiceIDServiceID of the item that triggered the event.protected intOne of ServiceRegistrar.TRANSITION_*MATCH_*MATCH.Fields inherited from class net.jini.core.event.RemoteEvent
eventID, handback, seqNum, source -
Constructor Summary
ConstructorsConstructorDescriptionServiceEvent(Object source, long eventID, long seqNo, MarshalledObject handback, ServiceID serviceID, int transition) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the serviceID of the item that triggered the event.abstract ServiceItemReturns the new state of the item, or null if the item was deleted from the lookup service.intReturns the singleton transition that triggered the event.toString()Returns aStringrepresentation of thisServiceEvent.Methods inherited from class net.jini.core.event.RemoteEvent
getID, getRegistrationObject, getSequenceNumberMethods inherited from class java.util.EventObject
getSource
-
Field Details
-
serviceID
ServiceID of the item that triggered the event. -
transition
protected int transitionOne of ServiceRegistrar.TRANSITION_*MATCH_*MATCH.
-
-
Constructor Details
-
ServiceEvent
public ServiceEvent(Object source, long eventID, long seqNo, MarshalledObject handback, ServiceID serviceID, int transition) Simple constructor.- Parameters:
source- the source of this ServiceEventeventID- the registration eventIDseqNo- the sequence number of this eventhandback- the client handbackserviceID- the serviceID of the item that triggered the eventtransition- the transition that triggered the event
-
-
Method Details
-
getServiceID
Returns the serviceID of the item that triggered the event.- Returns:
- a ServiceID object representing the service ID value
-
getTransition
public int getTransition()Returns the singleton transition that triggered the event.- Returns:
- an int representing the transition value
-
toString
Returns aStringrepresentation of thisServiceEvent.- Overrides:
toStringin classEventObject- Returns:
- a
Stringrepresentation of this object
-
getServiceItem
Returns the new state of the item, or null if the item was deleted from the lookup service.- Returns:
- a ServiceItem object representing the service item value
-