jgroup.relacs.events
Class Event

java.lang.Object
  extended by jgroup.relacs.events.Event
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, EventTags
Direct Known Subclasses:
DaemonFailureEvent, DeliveryAck, DeliveryEvent, InstallAck, InstallEvent, JoinRequest, LeaveRequest, MemberLeftEvent, MulticastRequest, PrepareAck, PrepareEvent

public class Event
extends java.lang.Object
implements EventTags, java.io.Externalizable

The Event class is the common superclass for all events that may be exchanged between the daemon and members. Different types of events are distinguished using an integer tag, that may be obtained using method getTag(). Each event is associated to a group identifier, that may be obtained using method getGid(). The group identifier is needed because an application may be member of most than one group at a time.

Since:
Jgroup 1.2
Author:
Alberto Montresor
See Also:
Serialized Form

Field Summary
protected  int gid
          Group identifier
protected  int tag
          Tag identifying the event
 
Fields inherited from interface jgroup.relacs.events.EventTags
DAEMON_FAILURE_EVENT, DELIVERY_ACK, DELIVERY_EVENT, INSTALL_ACK, INSTALL_EVENT, JOIN_REQUEST, LEAVE_REQUEST, MEMBER_LEFT_EVENT, MULTICAST_REQUEST, PREPARE_ACK, PREPARE_EVENT
 
Constructor Summary
Event()
          Default constructor for externalization.
Event(int tag, int gid)
          Constructs a new generic Event object.
 
Method Summary
 int getGid()
          Returns the group identifier associated with this event.
 int getTag()
          Returns the tag identifying this event.
 void readExternal(java.io.ObjectInput in)
          Restores the content of this object from the marshalled data contained in the specified input stream.
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
          Marshals the content of this object to the specified output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tag

protected int tag
Tag identifying the event


gid

protected int gid
Group identifier

Constructor Detail

Event

public Event()
Default constructor for externalization.


Event

public Event(int tag,
             int gid)
Constructs a new generic Event object.

Parameters:
tag - tag identifying the event
gid - group identifier
Method Detail

getTag

public int getTag()
Returns the tag identifying this event.


getGid

public int getGid()
Returns the group identifier associated with this event.


readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restores the content of this object from the marshalled data contained in the specified input stream.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - the stream to be read
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Marshals the content of this object to the specified output stream.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - the stream to be written
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.