Voyager ORB

com.objectspace.voyager.space
Interface ISubspace

All Known Implementing Classes:
Subspace

public abstract interface ISubspace

ISubspace is the interface implemented by Subspace.

Version:
3.0

Method Summary
 void add(java.lang.Object object)
          Add the specified object to this subspace.
 void addSubspaceListener(SubspaceListener listener)
          Add the specified listener.
 void connect(ISubspace subspace)
          Create a bidirectional connection with the specified subspace.
 boolean contains(java.lang.Object object)
          Return true if I contain the specified object.
 void disconnect(ISubspace subspace)
          Break the bidirectional connection with the specified subspace.
 java.lang.Object[] getContents()
          Return an array of my objects.
 java.lang.Object getMarker(java.lang.Object key)
          Return the value associated with the key, or null if there is none.
 Proxy getMulticastProxy(java.lang.String classname)
          Return a multicast proxy associated with the specified class.
 ISubspace[] getNeighbors()
          Return an array of references to all my neighboring subspaces.
 byte getPurgePolicy()
          Return my current purge policy.
 boolean isNeighbor(ISubspace subspace)
          Return true if the subspace given is a neighbor of this subspace.
 void purge(byte rule)
          Purge myself using the specified rule.
 java.lang.Object putMarker(java.lang.Object key, java.lang.Object value, long lifetime)
          Add and remember the key/value pair until the specified number of seconds has elapsed.
 boolean remove(java.lang.Object object)
          Remove the specified object from this subspace.
 void removeSubspaceListener(SubspaceListener listener)
          Remove the specified listener.
 void setPurgePolicy(byte policy)
          Set my purge policy.
 int size()
          Return the number of objects I contain.
 

Method Detail

getMulticastProxy

public Proxy getMulticastProxy(java.lang.String classname)
                        throws java.lang.ClassNotFoundException
Return a multicast proxy associated with the specified class. All messages sent to this proxy are multicast to all objects in my space that are type-compatible with the specified class.
Parameters:
classname - The class whose instances will receive oneway messages.
Throws:
java.lang.ClassNotFoundException - The specified class could not be found.

connect

public void connect(ISubspace subspace)
Create a bidirectional connection with the specified subspace. This operation makes the two subspaces neighbors and part of the same logical space.
Parameters:
subspace - The subspace to connect with.

disconnect

public void disconnect(ISubspace subspace)
Break the bidirectional connection with the specified subspace. At this point, the subspaces cease to be neighbors.
Parameters:
subspace - The subspace to disconnect from.

getNeighbors

public ISubspace[] getNeighbors()
Return an array of references to all my neighboring subspaces.

isNeighbor

public boolean isNeighbor(ISubspace subspace)
Return true if the subspace given is a neighbor of this subspace.
Parameters:
subspace - The subspace to test against.

add

public void add(java.lang.Object object)
Add the specified object to this subspace.
Parameters:
reference - The object to add.

remove

public boolean remove(java.lang.Object object)
Remove the specified object from this subspace. Return true if the object was found.
Parameters:
object - The object to remove.

getContents

public java.lang.Object[] getContents()
Return an array of my objects.

contains

public boolean contains(java.lang.Object object)
Return true if I contain the specified object.
Parameters:
object - The object to find.

size

public int size()
Return the number of objects I contain.

addSubspaceListener

public void addSubspaceListener(SubspaceListener listener)
Add the specified listener.
Parameters:
listener - The listener to add.

removeSubspaceListener

public void removeSubspaceListener(SubspaceListener listener)
Remove the specified listener.
Parameters:
listener - The listener to remove.

setPurgePolicy

public void setPurgePolicy(byte policy)
Set my purge policy.
Parameters:
policy - The new purge policy

getPurgePolicy

public byte getPurgePolicy()
Return my current purge policy.

purge

public void purge(byte rule)
Purge myself using the specified rule. If rule is DIED, remove dead neighbors and contents. If rule is DISCONNECTED, remove disconnected neighbors and contents. If rule is ALL, remove dead and disconnected neighbors and contents.
Parameters:
rule - The purge rule to use.

putMarker

public java.lang.Object putMarker(java.lang.Object key,
                                  java.lang.Object value,
                                  long lifetime)
Add and remember the key/value pair until the specified number of seconds has elapsed. Return the previous value that was associated with the key, or null if there was none. The ability to add a key/value marker is often used by messages to ensure that they don't visit a subspace more that once. Neither the key or the value receive messages or events that propagate through a space.
Parameters:
key - The key.
value - The value to associate with the key.
lifetime - The number of seconds that the key/value pair should be remembered.

getMarker

public java.lang.Object getMarker(java.lang.Object key)
Return the value associated with the key, or null if there is none.
Parameters:
key - The key.

ObjectSpace Inc.

(c) Copyright 1997-1999 ObjectSpace, Inc.
14850 Quorum Drive, Suite 500
Dallas, Texas 75240