| java.lang.Object org.jgroups.blocks.NotificationBus
All known Subclasses: org.jgroups.demos.NotificationBusDemo,
NotificationBus | public class NotificationBus implements Receiver(Code) | | This class provides notification sending and handling capability.
Producers can send notifications to all registered consumers.
Provides hooks to implement shared group state, which allows an
application programmer to maintain a local cache which is replicated
by all instances. NotificationBus sits on
top of a channel, however it creates its channel itself, so the
application programmers do not have to provide their own channel.
author: Bela Ban |
Inner Class :public interface Consumer | |
consumer | Consumer consumer(Code) | | |
log | final protected Log log(Code) | | |
block | public void block()(Code) | | |
getCacheFromCoordinator | public Serializable getCacheFromCoordinator(long timeout, int max_tries)(Code) | | Determines the coordinator and asks it for its cache. If there is no coordinator (because we are first member),
null will be returned. Used only internally by NotificationBus.
Parameters: timeout - Max number of msecs until the call returns Parameters: max_tries - Max number of attempts to fetch the cache from the coordinator |
getCacheFromMember | public Serializable getCacheFromMember(Address mbr, long timeout, int max_tries)(Code) | | Determines the coordinator and asks it for its cache. If there is no coordinator (because we are first member),
null will be returned. Used only internally by NotificationBus.
Parameters: mbr - The address of the member from which to fetch the state. If null, the current coordinatorwill be asked for the state Parameters: timeout - Max number of msecs until the call returns - if timeout elapsesnull will be returned Parameters: max_tries - Max number of attempts to fetch the cache from the coordinator (will be set to 1 if < 1) |
getChannel | public Channel getChannel()(Code) | | Answers the Channel.
Used to operate on the underlying channel directly, e.g. perform operations that are not
provided using only NotificationBus. Should be used sparingly.
underlying Channel |
getMembership | public Vector getMembership()(Code) | | Returns a reference to the real membership: don't modify.
If you need to modify, make a copy first !
Vector of Address objects |
getState | public byte[] getState()(Code) | | |
isCoordinator | public boolean isCoordinator()(Code) | | |
notifyConsumer | public void notifyConsumer(Serializable n)(Code) | | Don't multicast this to all members, just apply it to local consumers.
|
sendNotification | public void sendNotification(Serializable n)(Code) | | Pack the argument in a Info, serialize that one into the message buffer and send the message
|
sendNotification | public void sendNotification(Address dest, Serializable n)(Code) | | Pack the argument in a Info, serialize that one into the message buffer and send the message
|
setConsumer | public void setConsumer(Consumer c)(Code) | | |
setState | public void setState(byte[] state)(Code) | | |
viewAccepted | public synchronized void viewAccepted(View new_view)(Code) | | |
|
|