| |
|
| java.lang.Object nextapp.echo2.app.ApplicationInstance echo2example.chatclient.ChatApp
Method Summary | |
public boolean | connect(String userName) Attempts to connect to the chat server with the specified user name.
Displays a ChatScreen for the user if the user
is successfully connected. | public void | disconnect() Disconnects from the chat server and logs the current user out. | public static ChatApp | getApp() Returns the active ChatApp . | public ChatSession.Message[] | getNewMessages() Retrieves new messages from the ChatSession . | public String | getUserName() Returns the user name of the currently logged-in user. | public boolean | hasQueuedTasks() The hasQueuedTasks() method has been overridden such that we
can perform checks at every polling interval. | public Window | init() | public void | postMessage(String content) Posts a message to the chat server for the logged-in user. |
connect | public boolean connect(String userName)(Code) | | Attempts to connect to the chat server with the specified user name.
Displays a ChatScreen for the user if the user
is successfully connected. Performs no action if the user is not
successfully connected.
true if the operation was successfully completed,false otherwise |
disconnect | public void disconnect()(Code) | | Disconnects from the chat server and logs the current user out.
Displays the LoginScreen .
|
getApp | public static ChatApp getApp()(Code) | | Returns the active ChatApp .
the active ChatApp |
getNewMessages | public ChatSession.Message[] getNewMessages()(Code) | | Retrieves new messages from the ChatSession .
Once the new messages are deleted they are removed from the queue of
'new' messages.
Invoking this method thus alters the state of the new message queue.
an array of new messages |
getUserName | public String getUserName()(Code) | | Returns the user name of the currently logged-in user.
the user name |
hasQueuedTasks | public boolean hasQueuedTasks()(Code) | | The hasQueuedTasks() method has been overridden such that we
can perform checks at every polling interval. Alternatively tasks could
be added using threads running in the background, but for compliance
with earlier versions of the J2EE specification which do not allow
multi-threading, such work is accomplished in this method.
See Also: nextapp.echo2.app.ApplicationInstance.hasQueuedTasks |
postMessage | public void postMessage(String content)(Code) | | Posts a message to the chat server for the logged-in user.
Parameters: content - the content of the message to post |
|
|
|