|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.chat1.Chat
public class Chat
Class Chat is a rudimentary M2MI-based chat application. The program displays
a simple chat UI (an instance of class ChatFrame
), and the program exports a chat object (an instance
of class Chat) that implements interface
ChatRef
. When the user sends a line of text in the UI, the line
is broadcast to all the chat objects by calling putLine() on an
omnihandle for interface ChatRef. When each chat object receives a
putLine() invocation, it displays the line of text in the chat log
in its UI. In this way the line of text appears in all the chat programs that
are running.
The chat demo is intended merely to demonstrate M2MI omnihandle invocations and is not intended to be a full-featured chat application.
Usage: java edu.rit.chat1.Chat username
When running the chat demo application, M2MI and M2MP must be configured, and the M2MP Daemon must be running if necessary. See packages edu.rit.m2mi and edu.rit.m2mp for further information.
The chat demo application displays this UI:
Type a line of text into any chat window on any machine and hit return or click the "Send" button. The line of text, prefixed by the user name, shows up in all the chat windows on all the machines.
Method Summary | |
---|---|
static void |
main(String[] args)
Main program. |
void |
putMessage(String line)
Display the given line of text in this chat object's chat log. |
void |
run(String[] args)
Run this chat application. |
void |
send(String line)
Process the given line of text entered by the user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void run(String[] args) throws Throwable
args
- Command line arguments.
Throwable
public void send(String line)
send
in interface ChatFrameListener
line
- Line of text.public void putMessage(String line)
putMessage
in interface ChatRef
line
- Line of text.public static void main(String[] args) throws Throwable
args
- Command line arguments.
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |