| java.lang.Object org.jgroups.blocks.DistributedQueue
All known Subclasses: org.jgroups.demos.DistributedQueueDemo,
DistributedQueue | public class DistributedQueue implements MessageListener,MembershipListener,Cloneable(Code) | | Provides the abstraction of a java.util.LinkedList that is replicated at several
locations. Any change to the list (reset, add, remove, etc.) will transparently be
propagated to all replicas in the group. All read-only methods will always access the
local replica.
Both keys and values added to the list must be serializable, the reason
being that they will be sent across the network to all replicas of the group.
An instance of this class will contact an existing member of the group to fetch its
initial state.
Beware to use a total protocol on initialization or elements would not be in same
order on all replicas.
author: Romuald du Song |
Inner Class :public interface Notification | |
Constructor Summary | |
public | DistributedQueue(String groupname, ChannelFactory factory, String properties, long state_timeout) Creates a DistributedQueue
Parameters: groupname - The name of the group to join Parameters: factory - The ChannelFactory which will be used to create a channel Parameters: properties - The property string to be used to define the channel Parameters: state_timeout - The time to wait until state is retrieved in milliseconds. | public | DistributedQueue(JChannel channel) | public | DistributedQueue(PullPushAdapter adapter, Serializable id) Uses a user-provided PullPushAdapter to create the dispatcher rather than a Channel. |
logger | protected Log logger(Code) | | |
stopped | protected boolean stopped(Code) | | |
DistributedQueue | public DistributedQueue(String groupname, ChannelFactory factory, String properties, long state_timeout) throws ChannelException(Code) | | Creates a DistributedQueue
Parameters: groupname - The name of the group to join Parameters: factory - The ChannelFactory which will be used to create a channel Parameters: properties - The property string to be used to define the channel Parameters: state_timeout - The time to wait until state is retrieved in milliseconds. A value of 0 means wait forever. |
DistributedQueue | public DistributedQueue(PullPushAdapter adapter, Serializable id)(Code) | | Uses a user-provided PullPushAdapter to create the dispatcher rather than a Channel. If id is non-null, it will be
used to register under that id. This is typically used when another building block is already using
PullPushAdapter, and we want to add this building block in addition. The id is the used to discriminate
between messages for the various blocks on top of PullPushAdapter. If null, we will assume we are the
first block created on PullPushAdapter.
The caller needs to call start(), before using the this block. It gives the opportunity for the caller
to register as a lessoner for Notifications events.
Parameters: adapter - The PullPushAdapter which to use as underlying transport Parameters: id - A serializable object (e.g. an Integer) used to discriminate (multiplex/demultiplex) betweenrequests/responses for different building blocks on top of PullPushAdapter. |
_private_reset | protected void _private_reset()(Code) | | |
_reset | public void _reset()(Code) | | |
add | public void add(Object value)(Code) | | Add the speficied element at the bottom of the queue
Parameters: value - |
addAll | public void addAll(Collection values)(Code) | | Add the speficied collection to the top of the queue.
Elements are added in the order that they are returned by the specified
collection's iterator.
Parameters: values - |
addAtHead | public void addAtHead(Object value)(Code) | | Add the speficied element at the top of the queue
Parameters: value - |
addNotifier | public void addNotifier(Notification n)(Code) | | |
block | public void block()(Code) | | Block sending and receiving of messages until ViewAccepted is called
|
getState | public byte[] getState()(Code) | | |
init | final protected void init()(Code) | | |
initSignatures | final void initSignatures()(Code) | | |
peek | public Object peek()(Code) | | returns the first object on the queue, without removing it.
If the queue is empty this object blocks until the first queue object has
been added
the first object on the queue |
remove | public Object remove()(Code) | | Try to return the first objet in the queue.It does not wait for an object.
the first object in the queue or null if none were found. |
remove | public Object remove(long timeout)(Code) | | Parameters: timeout - The time to wait until an entry is retrieved in milliseconds. A value of 0 means wait forever. the first object in the queue or null if none were found |
removeNotifier | public void removeNotifier(Notification n)(Code) | | |
reset | public void reset()(Code) | | |
sendViewChangeNotifications | void sendViewChangeNotifications(Vector new_mbrs, Vector old_mbrs)(Code) | | |
setState | public void setState(byte[] new_state)(Code) | | |
suspect | public void suspect(Address suspected_mbr)(Code) | | Called when a member is suspected
|
viewAccepted | public void viewAccepted(View new_view)(Code) | | |
|
|