|
Voyager ORB | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.objectspace.voyager.space.Subspace
A Subspace is the building block of Space(tm), which is Voyager's backbone for scaleable distributed computing. A subspace can hold zero or more objects and can be connected to zero or more neighboring subspaces. A network of subspaces formed in this manner forms a single logical space which is in essence a distributed container.
When a message/event is sent into a subspace, it is cloned to each of the neighboring subspaces before it is delivered to every object in the local subspace. This results in a very rapid parallel fanout of the message/event to every object in the space. A special mechanism in each subspace ensures that no message/event is accidentally processed more than once, regardless of how the subspaces are linked together.
Subspaces may be linked to form a highly interconnected topology to avoid single points of failure and thus ensure fault tolerance.
A subspace is serializable and therefore may be persisted.
Field Summary | |
static byte |
ALL
Purge references to neighbors and objects that are dead or unreachable. |
static byte |
DIED
Purge references to dead neighbors and objects. |
static byte |
DISCONNECTED
Purge references to unreachable neighbors and objects. |
static byte |
NONE
Do not purge any references. |
Constructor Summary | |
Subspace()
Create a new empty Subspace with no neighbors. |
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 bi-directional 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 bi-directional 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 milliseconds 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. |
java.lang.String |
toString()
Return a string that describes me. |
Field Detail |
public static final byte DIED
public static final byte DISCONNECTED
public static final byte ALL
public static final byte NONE
Constructor Detail |
public Subspace()
Method Detail |
public java.lang.String toString()
public Proxy getMulticastProxy(java.lang.String classname) throws java.lang.ClassNotFoundException
classname
- The class whose instances will receive oneway messages.public void connect(ISubspace subspace)
subspace
- The subspace to connect with.public void disconnect(ISubspace subspace)
subspace
- The subspace to disconnect from.public ISubspace[] getNeighbors()
public boolean isNeighbor(ISubspace subspace)
subspace
- The subspace to test against.public void add(java.lang.Object object)
reference
- The object to add.public boolean remove(java.lang.Object object)
object
- The object to remove.public java.lang.Object[] getContents()
public boolean contains(java.lang.Object object)
object
- The object to find.public int size()
public void addSubspaceListener(SubspaceListener listener)
listener
- The listener to add.public void removeSubspaceListener(SubspaceListener listener)
listener
- The listener to remove.public java.lang.Object putMarker(java.lang.Object key, java.lang.Object value, long lifetime)
key
- The key.value
- The value to associate with the key.lifetime
- The number of milliseconds that the key/value pair should be remembered.public java.lang.Object getMarker(java.lang.Object key)
key
- The key.public void setPurgePolicy(byte policy)
policy
- The new purge policypublic byte getPurgePolicy()
public void purge(byte rule)
rule
- The purge rule to use.
|
ObjectSpace Inc. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |