casa.JION.event
Class RemoteEvent

java.lang.Object
  extended by java.util.EventObject
      extended by net.jini.core.event.RemoteEvent
          extended by casa.JION.event.RemoteEvent
All Implemented Interfaces:
java.io.Serializable

public class RemoteEvent
extends net.jini.core.event.RemoteEvent

The base class or superclass for remote events.

The abstract state contained in a RemoteEvent object includes a reference to the object in which the event occurred, a long which identifies the kind of event relative to the object in which the event occurred, a long which indicates the sequence number of this instance of the event kind, and a MarshalledObject that is to be handed back when the notification occurs. The combination of the event identifier and the object reference obtained from the RemoteEvent object should uniquely identify the event type.

The sequence number obtained from the RemoteEvent object is an increasing value that can act as a hint to the number of occurrences of this event relative to some earlier sequence number. Any object that generates a RemoteEvent is required to insure that for any two RemoteEvent objects with the same event identifier, the sequence number of those events differ if and only if the RemoteEvent objects are a response to different events. This guarantee is required to allow notification calls to be idempotent. A further guarantee is that if two RemoteEvents, x and y, come from the same source and have the same event identifier, then x occurred before y if and only if the sequence number of x is lower than the sequence number of y.

A stronger guarantee is possible for those generators of RemoteEvents that can support it. This guarantee states that not only do sequence numbers increase, but they are not skipped. In such a case, if RemoteEvent x and y have the same source and the same event identifier, and x has sequence number m and y has sequence number n, then if m < n there were exactly n-m-1 events of the same event type between the event that triggered x and the event that triggered y. Such sequence numbers are said to be "fully ordered".

An event registration that occurs within a transaction is considered to be scoped by that transaction. This means that any occurrence of the kind of event of interest that happens as part of the transaction will cause a notification to be sent to the recipients indicated by the registration that occurred in the transaction. Such events must have a separate event identifier to allow third-party store and forward entities to distinguish between an event that happens within a transaction and those that happen outside of the transaction. Notifications of these events will not be sent to entities that registered interest in this kind of event outside the scope of the transaction until and unless the transaction is committed.

Because of this, notifications sent from inside a transaction will have a different sequence number than the notifications of the same events would have outside of the transaction. Within a transaction, all RemoteEvent objects for a given kind of event are given a sequence number relative to the transaction. This is true even if the event that triggered the RemoteEvent object being sent occurs outside of the scope of the transaction (but is visible within the transaction).

Since:
1.0
Author:
Sun Microsystems, Inc.
See Also:
Serialized Form

Constructor Summary
RemoteEvent(java.lang.Object source, long eventID, long seqNum, java.rmi.MarshalledObject<java.lang.Object> handback)
          Constructs a RemoteEvent object.
RemoteEvent(net.jini.core.event.RemoteEvent remoteEvent)
          Instantiates a new remote event.
 
Method Summary
 java.lang.String 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteEvent

public RemoteEvent(java.lang.Object source,
                   long eventID,
                   long seqNum,
                   java.rmi.MarshalledObject<java.lang.Object> handback)
Constructs a RemoteEvent object.

The abstract state contained in a RemoteEvent object includes a reference to the object in which the event occurred, a long which identifies the kind of event relative to the object in which the event occurred, a long which indicates the sequence number of this instance of the event kind, and a MarshalledObject that is to be handed back when the notification occurs. The combination of the event identifier and the object reference obtained from the RemoteEvent object should uniquely identify the event type.

Parameters:
source - an Object representing the event source
eventID - a long containing the event identifier
seqNum - a long containing the event sequence number
handback - a MarshalledObject that was passed in as part of the original event registration.

RemoteEvent

public RemoteEvent(net.jini.core.event.RemoteEvent remoteEvent)
Instantiates a new remote event.

Parameters:
remoteEvent - the remote event
Method Detail

toString

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