org.jgroups.demos
Class StompChat
java.lang.Object
org.jgroups.demos.StompChat
- All Implemented Interfaces:
- StompConnection.Listener
public class StompChat
- extends java.lang.Object
- implements StompConnection.Listener
Chat client using STOMP to talk to other clients
Constructor Summary |
StompChat(java.lang.String host,
int port,
java.lang.String user)
|
Method Summary |
protected void |
connect()
|
static void |
main(java.lang.String[] args)
|
void |
onInfo(java.util.Map<java.lang.String,java.lang.String> information)
|
void |
onMessage(java.util.Map<java.lang.String,java.lang.String> headers,
byte[] buf,
int offset,
int length)
|
protected void |
send(java.lang.String msg)
|
void |
sendGetUsers()
|
protected void |
showStatus(java.lang.String msg)
|
void |
start()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
username
protected java.lang.String username
users
protected final java.util.Set<java.lang.String> users
stomp_client
protected StompConnection stomp_client
MESSAGES
public static final java.lang.String MESSAGES
- See Also:
- Constant Field Values
CLIENT_JOINED
public static final java.lang.String CLIENT_JOINED
- See Also:
- Constant Field Values
CLIENT_LEFT
public static final java.lang.String CLIENT_LEFT
- See Also:
- Constant Field Values
CLIENTS
public static final java.lang.String CLIENTS
- See Also:
- Constant Field Values
USER_JOINED
public static final java.lang.String USER_JOINED
- See Also:
- Constant Field Values
USER_LEFT
public static final java.lang.String USER_LEFT
- See Also:
- Constant Field Values
GET_USERS
public static final java.lang.String GET_USERS
- See Also:
- Constant Field Values
USERS
public static final java.lang.String USERS
- See Also:
- Constant Field Values
ENDPOINTS
public static final java.lang.String ENDPOINTS
- See Also:
- Constant Field Values
VIEW
public static final java.lang.String VIEW
- See Also:
- Constant Field Values
CLIENTS_KW
public static final java.lang.String CLIENTS_KW
- See Also:
- Constant Field Values
DESTINATION
public static final java.lang.String DESTINATION
- See Also:
- Constant Field Values
USER
public static final java.lang.String USER
- See Also:
- Constant Field Values
USERS_KW
public static final java.lang.String USERS_KW
- See Also:
- Constant Field Values
CLIENT
public static final java.lang.String CLIENT
- See Also:
- Constant Field Values
StompChat
public StompChat(java.lang.String host,
int port,
java.lang.String user)
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
start
public void start()
throws java.lang.Exception
- Throws:
java.lang.Exception
connect
protected void connect()
throws java.lang.Exception
- Throws:
java.lang.Exception
send
protected void send(java.lang.String msg)
sendGetUsers
public void sendGetUsers()
showStatus
protected void showStatus(java.lang.String msg)
onInfo
public void onInfo(java.util.Map<java.lang.String,java.lang.String> information)
- Specified by:
onInfo
in interface StompConnection.Listener
onMessage
public void onMessage(java.util.Map<java.lang.String,java.lang.String> headers,
byte[] buf,
int offset,
int length)
- Specified by:
onMessage
in interface StompConnection.Listener
Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.