org.sapia.ubik.mcast
Class RemoteEvent

java.lang.Object
  extended by org.sapia.ubik.mcast.RemoteEvent
All Implemented Interfaces:
java.io.Serializable

public class RemoteEvent
extends java.lang.Object
implements java.io.Serializable

Models a multicast event. An instance of this class strictly encapsulates its data in the form of strings, in order to avoid classloading issues when serializing/deserializing in a networked environment. A multicast is sent to a domain, or to all domains, according to the domain name information that is kept an the event.

Furthermore, a multicast event has a "type", which provides the event's logical type - and allows applications to register for events of a given logical type.

Finally, data can also be passed.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site
See Also:
Serialized Form

Constructor Summary
RemoteEvent(java.lang.String type, java.lang.Object data)
          Creates an instance of this class that is targeted at all domains.
RemoteEvent(java.lang.String domain, java.lang.String type, java.lang.Object data)
          Creates an instance of this class.
 
Method Summary
 java.lang.Object getData()
          Returns this instance's data.
 java.lang.String getDomainName()
          Returns this instance's domain name.
 long getId()
          Returns this event's unique identifier.
 java.lang.String getNode()
          Returns the identifier of the node that sent this event.
 java.lang.String getType()
          Returns this instance's logical typeentifier.
 boolean hasDomainName()
          Returns true if this instance was created with a domain name - meaning that it was targeted at a single domain.
 boolean isSync()
          Returns true if this instance represents an event that necessitates a synchronous response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteEvent

public RemoteEvent(java.lang.String domain,
                   java.lang.String type,
                   java.lang.Object data)
            throws java.io.IOException
Creates an instance of this class.

Parameters:
the - name of the domain to which this instance is targeted.
type - the event's type, which in fact is its logical type.
data - the event's data.
Throws:
java.io.IOException

RemoteEvent

public RemoteEvent(java.lang.String type,
                   java.lang.Object data)
            throws java.io.IOException
Creates an instance of this class that is targeted at all domains.

Parameters:
type - the event's type, which in fact is its logical type.
data - the event's data.
Throws:
java.io.IOException
Method Detail

getDomainName

public java.lang.String getDomainName()
Returns this instance's domain name.

Returns:
a domain name, or null if this instance is not targeted at a single domain.

getType

public java.lang.String getType()
Returns this instance's logical typeentifier.

Returns:
a logical typeentifier.

getId

public long getId()
Returns this event's unique identifier.

Returns:
a unique ID, as a string.

getData

public java.lang.Object getData()
                         throws java.io.IOException
Returns this instance's data.

Returns:
this event's data, or null if this instance has no data.
Throws:
java.io.IOException

hasDomainName

public boolean hasDomainName()
Returns true if this instance was created with a domain name - meaning that it was targeted at a single domain.

Returns:
true if this instance has a domain name.

isSync

public boolean isSync()
Returns true if this instance represents an event that necessitates a synchronous response.


getNode

public java.lang.String getNode()
Returns the identifier of the node that sent this event.

Returns:
a node identifier,


Copyright © 2010 Sapia OSS. All Rights Reserved.