org.javagroups.blocks
Class DistributedTree
java.lang.Object
|
+--org.javagroups.blocks.DistributedTree
- All Implemented Interfaces:
- java.lang.Cloneable, MembershipListener, MessageListener
- public class DistributedTree
- extends java.lang.Object
- implements MessageListener, MembershipListener, java.lang.Cloneable
A tree-like structure that is replicated across several members. Updates will be multicast to all group
members reliably and in the same order.
- Author:
- Bela Ban
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributedTree
public DistributedTree()
DistributedTree
public DistributedTree(java.lang.String groupname,
java.lang.String channel_properties)
getLocalAddress
public java.lang.Object getLocalAddress()
start
public void start()
throws java.lang.Exception
start
public void start(long timeout)
throws java.lang.Exception
stop
public void stop()
addDistributedTreeListener
public void addDistributedTreeListener(DistributedTree.DistributedTreeListener listener)
removeDistributedTreeListener
public void removeDistributedTreeListener(DistributedTree.DistributedTreeListener listener)
addMembershipListener
public void addMembershipListener(DistributedTree.MembershipListener listener)
removeMembershipListener
public void removeMembershipListener(DistributedTree.MembershipListener listener)
add
public void add(java.lang.String fqn)
add
public void add(java.lang.String fqn,
java.io.Serializable element)
remove
public void remove(java.lang.String fqn)
exists
public boolean exists(java.lang.String fqn)
get
public java.io.Serializable get(java.lang.String fqn)
set
public void set(java.lang.String fqn,
java.io.Serializable element)
getChildrenNames
public java.util.Vector getChildrenNames(java.lang.String fqn)
- Returns all children of a Node as strings
print
public java.lang.String print()
_add
public void _add(java.lang.String fqn)
_add
public void _add(java.lang.String fqn,
java.io.Serializable element)
_remove
public void _remove(java.lang.String fqn)
_set
public void _set(java.lang.String fqn,
java.io.Serializable element)
receive
public void receive(Message msg)
- Specified by:
receive
in interface MessageListener
getState
public java.lang.Object getState()
- Return a copy of the tree
- Specified by:
getState
in interface MessageListener
setState
public void setState(java.lang.Object new_state)
- Specified by:
setState
in interface MessageListener
viewAccepted
public void viewAccepted(View new_view)
- Description copied from interface:
MembershipListener
- Called by JavaGroups to notify the target object of a change of membership.
No long running actions should be done in this callback in the case of Ensemble,
as this would block Ensemble. If some long running action needs to be performed,
it should be done in a separate thread (cf.
../Tests/QuoteServer.java
).
- Specified by:
viewAccepted
in interface MembershipListener
suspect
public void suspect(Address suspected_mbr)
- Called when a member is suspected
- Specified by:
suspect
in interface MembershipListener
block
public void block()
- Block sending and receiving of messages until ViewAccepted is called
- Specified by:
block
in interface MembershipListener
Copyright © 2001,2002 www.javagroups.com . All Rights Reserved.