|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.blocks.DistributedTree
public class DistributedTree
A tree-like structure that is replicated across several members. Updates will be multicast to all group members reliably and in the same order.
Nested Class Summary | |
---|---|
static interface |
DistributedTree.DistributedTreeListener
|
static interface |
DistributedTree.ViewListener
|
Field Summary | |
---|---|
protected Channel |
channel
|
protected RpcDispatcher |
disp
|
protected static Log |
log
|
protected boolean |
rc
|
protected boolean |
send_message
Determines when the updates have to be sent across the network, avoids sending unnecessary messages when there are no member in the group |
Constructor Summary | |
---|---|
DistributedTree()
|
|
DistributedTree(PullPushAdapter adapter,
java.io.Serializable id,
long state_timeout)
|
|
DistributedTree(java.lang.String groupname,
java.lang.String channel_properties)
|
Method Summary | |
---|---|
void |
_add(java.lang.String fqn)
|
void |
_add(java.lang.String fqn,
java.io.Serializable element)
|
void |
_remove(java.lang.String fqn)
|
void |
_reset(java.lang.String fqn,
java.io.Serializable element)
similar to set, but does not error if node does not exist, but rather does an add instead |
void |
_set(java.lang.String fqn,
java.io.Serializable element)
|
void |
add(java.lang.String fqn)
|
void |
add(java.lang.String fqn,
java.io.Serializable element)
|
void |
add(java.lang.String fqn,
java.io.Serializable element,
int timeout)
|
void |
addDistributedTreeListener(DistributedTree.DistributedTreeListener listener)
|
void |
addViewListener(DistributedTree.ViewListener listener)
|
void |
block()
Block sending and receiving of messages until ViewAccepted is called |
boolean |
exists(java.lang.String fqn)
|
java.io.Serializable |
get(java.lang.String fqn)
|
Channel |
getChannel()
Returns the Channel the DistributedTree is connected to |
java.util.Vector |
getChildrenNames(java.lang.String fqn)
Returns all children of a Node as strings |
int |
getGroupMembersNumber()
Returns the number of current members joined to the group |
java.lang.String |
getGroupName()
Returns the name of the group that the DistributedTree is connected to |
java.lang.Object |
getLocalAddress()
|
byte[] |
getState()
Return a copy of the tree |
java.lang.String |
print()
|
void |
receive(Message msg)
Called when a message is received. |
void |
remove(java.lang.String fqn)
|
void |
remove(java.lang.String fqn,
int timeout)
|
void |
removeDistributedTreeListener(DistributedTree.DistributedTreeListener listener)
|
void |
removeViewListener(DistributedTree.ViewListener listener)
|
void |
reset(java.lang.String fqn,
java.io.Serializable element)
resets an existing node, useful after a merge when you want to tell other members of your state, but do not wish to remove and then add as two separate calls |
void |
reset(java.lang.String fqn,
java.io.Serializable element,
int timeout)
resets an existing node, useful after a merge when you want to tell other members of your state, but do not wish to remove and then add as two separate calls |
void |
set(java.lang.String fqn,
java.io.Serializable element)
|
void |
set(java.lang.String fqn,
java.io.Serializable element,
int timeout)
|
void |
setDeadlockDetection(boolean flag)
|
void |
setState(byte[] data)
Sets the group state; e.g., when joining. |
void |
start()
|
void |
start(long timeout)
|
void |
stop()
|
void |
suspect(Address suspected_mbr)
Called when a member is suspected |
void |
viewAccepted(View new_view)
Called when a change in membership has occurred. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Channel channel
protected RpcDispatcher disp
protected boolean rc
protected boolean send_message
protected static final Log log
Constructor Detail |
---|
public DistributedTree()
public DistributedTree(java.lang.String groupname, java.lang.String channel_properties)
public DistributedTree(PullPushAdapter adapter, java.io.Serializable id, long state_timeout) throws ChannelException
ChannelException
Method Detail |
---|
public java.lang.Object getLocalAddress()
public void setDeadlockDetection(boolean flag)
public void start() throws java.lang.Exception
java.lang.Exception
public void start(long timeout) throws java.lang.Exception
java.lang.Exception
public void stop()
public void addDistributedTreeListener(DistributedTree.DistributedTreeListener listener)
public void removeDistributedTreeListener(DistributedTree.DistributedTreeListener listener)
public void addViewListener(DistributedTree.ViewListener listener)
public void removeViewListener(DistributedTree.ViewListener listener)
public void add(java.lang.String fqn)
public void add(java.lang.String fqn, java.io.Serializable element)
public void reset(java.lang.String fqn, java.io.Serializable element)
public void remove(java.lang.String fqn)
public void add(java.lang.String fqn, java.io.Serializable element, int timeout)
public void reset(java.lang.String fqn, java.io.Serializable element, int timeout)
public void remove(java.lang.String fqn, int timeout)
public boolean exists(java.lang.String fqn)
public java.io.Serializable get(java.lang.String fqn)
public void set(java.lang.String fqn, java.io.Serializable element)
public void set(java.lang.String fqn, java.io.Serializable element, int timeout)
public java.util.Vector getChildrenNames(java.lang.String fqn)
public java.lang.String print()
public java.lang.String getGroupName()
public Channel getChannel()
public int getGroupMembersNumber()
public void _add(java.lang.String fqn)
public void _add(java.lang.String fqn, java.io.Serializable element)
public void _remove(java.lang.String fqn)
public void _set(java.lang.String fqn, java.io.Serializable element)
public void _reset(java.lang.String fqn, java.io.Serializable element)
public void receive(Message msg)
MessageListener
receive
in interface MessageListener
public byte[] getState()
getState
in interface MessageListener
public void setState(byte[] data)
MessageListener
setState
in interface MessageListener
public void viewAccepted(View new_view)
MembershipListener
Channel.connect(String)
returns.
viewAccepted
in interface MembershipListener
public void suspect(Address suspected_mbr)
suspect
in interface MembershipListener
public void block()
block
in interface MembershipListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |