net.jini.core.lookup
Class ServiceEvent
java.lang.Object
|
+--java.util.EventObject
|
+--net.jini.core.event.RemoteEvent
|
+--net.jini.core.lookup.ServiceEvent
- public abstract class ServiceEvent
- extends RemoteEvent
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.
- See Also:
- Serialized Form
Field Summary |
protected ServiceID |
serviceID
ServiceID of the item that triggered the event. |
protected int |
transition
One of ServiceRegistrar.TRANSITION_*MATCH_*MATCH |
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
ServiceEvent(java.lang.Object source,
long eventID,
long seqNo,
java.rmi.MarshalledObject handback,
ServiceID serviceID,
int transition)
Simple constructor. |
Method Summary |
ServiceID |
getServiceID()
Returns the serviceID of the item that triggered the event |
abstract ServiceItem |
getServiceItem()
Returns the new state of the item, or null if the item was deleted
from the lookup service. |
int |
getTransition()
Returns the singleton transition that triggered the event |
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 |
serviceID
protected ServiceID serviceID
- ServiceID of the item that triggered the event.
transition
protected int transition
- One of ServiceRegistrar.TRANSITION_*MATCH_*MATCH
ServiceEvent
public ServiceEvent(java.lang.Object source,
long eventID,
long seqNo,
java.rmi.MarshalledObject handback,
ServiceID serviceID,
int transition)
- Simple constructor.
- Parameters:
source
- the ServiceRegistrar that generated the eventeventID
- 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
getServiceID
public ServiceID getServiceID()
- Returns the serviceID of the item that triggered the event
getTransition
public int getTransition()
- Returns the singleton transition that triggered the event
getServiceItem
public abstract ServiceItem getServiceItem()
- Returns the new state of the item, or null if the item was deleted
from the lookup service.
Copyright © 1999 Sun Microsystems, Inc. All rights reserved