|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.demos.Chat
public class Chat
Simple chat demo
Constructor Summary | |
---|---|
Chat(java.lang.String props)
|
Method Summary | |
---|---|
void |
block()
Called (usually by the FLUSH protocol), as an indication that the member should stop sending messages. |
byte[] |
getState()
Answers the group state; e.g., when joining. |
void |
getState(java.io.OutputStream os)
Allows an application to write a state through a provided OutputStream. |
byte[] |
getState(java.lang.String state_id)
Allows an application to provide a partial state as a byte array |
void |
getState(java.lang.String state_id,
java.io.OutputStream ostream)
Allows an application to write a partial state through a provided OutputStream. |
static void |
main(java.lang.String[] args)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
receive(Message msg)
Called when a message is received. |
void |
setState(byte[] state)
Sets the group state; e.g., when joining. |
void |
setState(java.io.InputStream is)
Allows an application to read a state through a provided InputStream. |
void |
setState(java.lang.String state_id,
byte[] state)
Allows an application to read a partial state indicated by state_id from a given state byte array parameter. |
void |
setState(java.lang.String state_id,
java.io.InputStream istream)
Allows an application to read a partial state through a provided InputStream. |
void |
start()
|
void |
suspect(Address suspected_mbr)
Called whenever a member is suspected of having crashed, but has not yet been excluded. |
void |
unblock()
Called after the FLUSH protocol has unblocked previously blocked senders, and messages can be sent again. |
void |
viewAccepted(View new_view)
Called when a change in membership has occurred. |
void |
windowActivated(java.awt.event.WindowEvent e)
|
void |
windowClosed(java.awt.event.WindowEvent e)
|
void |
windowClosing(java.awt.event.WindowEvent e)
|
void |
windowDeactivated(java.awt.event.WindowEvent e)
|
void |
windowDeiconified(java.awt.event.WindowEvent e)
|
void |
windowIconified(java.awt.event.WindowEvent e)
|
void |
windowOpened(java.awt.event.WindowEvent e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Chat(java.lang.String props)
Method Detail |
---|
public static void main(java.lang.String[] args)
public void start()
public void receive(Message msg)
MessageListener
receive
in interface MessageListener
public byte[] getState(java.lang.String state_id)
ExtendedMessageListener
getState
in interface ExtendedMessageListener
state_id
- id of the partial state requested
public byte[] getState()
MessageListener
getState
in interface MessageListener
public void setState(byte[] state)
MessageListener
setState
in interface MessageListener
public void setState(java.lang.String state_id, byte[] state)
ExtendedMessageListener
setState
in interface ExtendedMessageListener
state_id
- id of the partial state requestedstate
- partial state for the given state_idpublic void getState(java.io.OutputStream os)
ExtendedMessageListener
getState
in interface ExtendedMessageListener
os
- the OutputStreamOutputStream.close()
public void setState(java.io.InputStream is)
ExtendedMessageListener
setState
in interface ExtendedMessageListener
is
- the InputStreamInputStream.close()
public void getState(java.lang.String state_id, java.io.OutputStream ostream)
ExtendedMessageListener
getState
in interface ExtendedMessageListener
state_id
- id of the partial state requestedostream
- the OutputStreamOutputStream.close()
public void setState(java.lang.String state_id, java.io.InputStream istream)
ExtendedMessageListener
setState
in interface ExtendedMessageListener
state_id
- id of the partial state requestedistream
- the InputStreamInputStream.close()
public void viewAccepted(View new_view)
MembershipListener
viewAccepted
in interface MembershipListener
public void suspect(Address suspected_mbr)
MembershipListener
suspect
in interface MembershipListener
public void block()
MembershipListener
ExtendedMembershipListener.unblock()
.
Note that block() is the equivalent of reception of a BlockEvent in the pull mode.
block
in interface MembershipListener
public void unblock()
ExtendedMembershipListener
unblock
in interface ExtendedMembershipListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void windowActivated(java.awt.event.WindowEvent e)
windowActivated
in interface java.awt.event.WindowListener
public void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
public void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
public void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |