|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.blocks.NotificationBus
Class for dissemination of notifications. Producers can send notifications to all registered consumers. Provides hooks to implement shared group state (cache).
Nested Class Summary | |
static interface |
NotificationBus.Consumer
|
Field Summary | |
protected Log |
log
|
Constructor Summary | |
NotificationBus()
|
|
NotificationBus(java.lang.String bus_name)
|
|
NotificationBus(java.lang.String bus_name,
java.lang.String properties)
|
Method Summary | |
void |
block()
Block sending and receiving of messages until viewAccepted() is called |
java.io.Serializable |
getCache()
|
java.io.Serializable |
getCacheFromCoordinator(long timeout,
int max_tries)
Determines the coordinator and asks it for its cache. |
java.io.Serializable |
getCacheFromMember(Address mbr,
long timeout,
int max_tries)
Determines the coordinator and asks it for its cache. |
Channel |
getChannel()
Used to operate on the underlying channel directly, e.g. |
Address |
getLocalAddress()
|
java.util.Vector |
getMembership()
Returns a reference to the real membership: don't modify. |
byte[] |
getState()
|
boolean |
isCoordinator()
|
void |
notifyConsumer(java.io.Serializable n)
Don't multicast this to all members, just apply it to local consumers. |
void |
receive(Message msg)
|
void |
sendNotification(java.io.Serializable n)
Pack the argument in a Info, serialize that one into the message buffer and send the message |
void |
setConsumer(NotificationBus.Consumer c)
|
void |
setState(byte[] state)
|
void |
start()
|
void |
stop()
|
void |
suspect(Address suspected_mbr)
Called when a member is suspected |
void |
viewAccepted(View new_view)
Called by JGroups to notify the target object of a change of membership. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Log log
Constructor Detail |
public NotificationBus() throws java.lang.Exception
public NotificationBus(java.lang.String bus_name) throws java.lang.Exception
public NotificationBus(java.lang.String bus_name, java.lang.String properties) throws java.lang.Exception
Method Detail |
public void setConsumer(NotificationBus.Consumer c)
public Address getLocalAddress()
public java.util.Vector getMembership()
public Channel getChannel()
public boolean isCoordinator()
public void start() throws java.lang.Exception
java.lang.Exception
public void stop()
public void sendNotification(java.io.Serializable n)
public java.io.Serializable getCacheFromCoordinator(long timeout, int max_tries)
timeout
- Max number of msecs until the call returnsmax_tries
- Max number of attempts to fetch the cache from the coordinatorpublic java.io.Serializable getCacheFromMember(Address mbr, long timeout, int max_tries)
mbr
- The address of the member from which to fetch the state. If null, the current coordinator
will be asked for the statetimeout
- Max number of msecs until the call returns - if timeout elapses
null will be returnedmax_tries
- Max number of attempts to fetch the cache from the coordinator (will be set to 1 if < 1)public void notifyConsumer(java.io.Serializable n)
public void receive(Message msg)
receive
in interface MessageListener
public byte[] getState()
getState
in interface MessageListener
public void setState(byte[] state)
setState
in interface MessageListener
public void viewAccepted(View new_view)
MembershipListener
../Tests/QuoteServer.java
).
viewAccepted
in interface MembershipListener
public void suspect(Address suspected_mbr)
MembershipListener
suspect
in interface MembershipListener
public void block()
MembershipListener
block
in interface MembershipListener
public java.io.Serializable getCache()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |