com.sun.jini.reggie
Class RegistrarEvent

java.lang.Object
  extended by java.util.EventObject
      extended by net.jini.core.event.RemoteEvent
          extended by net.jini.core.lookup.ServiceEvent
              extended by com.sun.jini.reggie.RegistrarEvent
All Implemented Interfaces:
Serializable

 class RegistrarEvent
extends ServiceEvent

Concrete implementation class for abstract ServiceEvent.

Author:
Sun Microsystems, Inc.

Field Summary
protected  Object item
          The new state of the item, or null if the item has been deleted from the lookup service.
private static long serialVersionUID
           
protected  ServiceID servID
          The service ID of the item that triggered the event.
 
Fields inherited from class net.jini.core.lookup.ServiceEvent
serviceID, transition
 
Fields inherited from class net.jini.core.event.RemoteEvent
eventID, handback, seqNum, source
 
Constructor Summary
RegistrarEvent(Object source, long eventID, long seqNo, MarshalledObject handback, ServiceID serviceID, int transition, Item item)
          Simple constructor.
 
Method Summary
 ServiceID getServiceID()
          Returns the serviceID of the item that triggered the event.
 ServiceItem getServiceItem()
          Returns the new state of the item, or null if the item was deleted from the lookup service.
private  void readObject(ObjectInputStream in)
          Reads the default serializable field value for this instance, followed by the item's service ID encoded as specified by the ServiceID.writeBytes method.
private  void writeObject(ObjectOutputStream out)
          Writes the default serializable field value for this instance, followed by the item's service ID encoded as specified by the ServiceID.writeBytes method.
 
Methods inherited from class net.jini.core.lookup.ServiceEvent
getTransition, toString
 
Methods inherited from class net.jini.core.event.RemoteEvent
getID, getRegistrationObject, getSequenceNumber
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

item

protected Object item
The new state of the item, or null if the item has been deleted from the lookup service. This is either a ServiceItem or an Item (to be converted to a ServiceItem when unmarshalled).


servID

protected transient ServiceID servID
The service ID of the item that triggered the event. This field is used instead of the inherited serviceID field (which is set to null) and is written directly as a 128-bit value in order to avoid potential codebase annotation loss (see bug 4745728).

Constructor Detail

RegistrarEvent

public RegistrarEvent(Object source,
                      long eventID,
                      long seqNo,
                      MarshalledObject handback,
                      ServiceID serviceID,
                      int transition,
                      Item item)
Simple constructor.

Parameters:
source - the ServiceRegistrar that generated the event
eventID - the registration eventID
seqNo - the sequence number of this event
handback - the client handback
serviceID - the serviceID of the item that triggered the event
transition - the transition that triggered the event
item - the new state of the item, or null if deleted
Method Detail

getServiceItem

public ServiceItem getServiceItem()
Returns the new state of the item, or null if the item was deleted from the lookup service.

Specified by:
getServiceItem in class ServiceEvent
Returns:
a ServiceItem object representing the service item value

getServiceID

public ServiceID getServiceID()
Description copied from class: ServiceEvent
Returns the serviceID of the item that triggered the event.

Overrides:
getServiceID in class ServiceEvent
Returns:
a ServiceID object representing the service ID value

writeObject

private void writeObject(ObjectOutputStream out)
                  throws IOException
Writes the default serializable field value for this instance, followed by the item's service ID encoded as specified by the ServiceID.writeBytes method.

Throws:
IOException

readObject

private void readObject(ObjectInputStream in)
                 throws IOException,
                        ClassNotFoundException
Reads the default serializable field value for this instance, followed by the item's service ID encoded as specified by the ServiceID.writeBytes method. If the value of the item field is an Item instance, converts it to a ServiceItem.

Throws:
IOException
ClassNotFoundException


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.