com.sun.jini.mercury
Class EventID

java.lang.Object
  extended by com.sun.jini.mercury.EventID
All Implemented Interfaces:
Serializable

 class EventID
extends Object
implements Serializable

The EventID class is used to represent a unique event registration. This class maintains the two pieces of information that make a registration unique: the event's source and ID attributes. It's used by the mailbox code in order to maintain a list of EventIDs that caused an UnknownEventException to be received during an event notification attempt for a given event.

Since:
1.1
Author:
Sun Microsystems, Inc.

Field Summary
private  long id
          The event ID.
private static long serialVersionUID
           
private  Object source
          The event source
 
Constructor Summary
EventID(Object source, long id)
          Simple constructor that assigns the provided arguments to the appropriate internal fields
EventID(RemoteEvent evt)
          Convenience constructor.
 
Method Summary
 boolean equals(Object o)
          Return true if the given object is equal to this object and false otherwise.
 int hashCode()
           
private  void init(Object source, long id)
          Convenience initialization method.
private  void readObject(ObjectInputStream stream)
          Initialize id field using default semantics but then unmarshal the value of source from the stream.
 String toString()
           
private  void writeObject(ObjectOutputStream stream)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

source

private transient Object source
The event source


id

private long id
The event ID.

Constructor Detail

EventID

public EventID(Object source,
               long id)
Simple constructor that assigns the provided arguments to the appropriate internal fields


EventID

public EventID(RemoteEvent evt)
Convenience constructor. Initializes the object with attributes extracted from the given RemoteEvent argument.

Throws:
IllegalArgumentException - if a null argument is provided
Method Detail

init

private void init(Object source,
                  long id)
Convenience initialization method. Note: private scoping prevents a subclass from inadvertently overriding this method.

Throws:
IllegalArgumentException - if a null source argument is provided.

equals

public boolean equals(Object o)
Return true if the given object is equal to this object and false otherwise. Two EventID objects are considered equal if their source and ID attributes are equal.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

writeObject

private void writeObject(ObjectOutputStream stream)
                  throws IOException
Throws:
IOException - if an I/O error occurs

readObject

private void readObject(ObjectInputStream stream)
                 throws IOException,
                        ClassNotFoundException
Initialize id field using default semantics but then unmarshal the value of source from the stream.

Throws:
IOException - if an I/O error occurs
ClassNotFoundException - if a class of a serialized object cannot be found


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