Purple Code

com.purpletech.message
Interface MessagePeer

All Known Implementing Classes:
AbstractPeer, MessageClient

public interface MessagePeer


Method Summary
 void addMessageListener(MessageListener listener)
          adds an event listener that receives all incoming messages received by this peer
 void bind(java.lang.String name)
           
 void connect()
          Try to connect to the server
 void disconnect()
          Try to disconnect from the server
 int getID()
          get the ID of this peer
 boolean isConnected()
          are we connected or not?
 int lookup(java.lang.String name)
          Look up a peer id that's been bound to a name
 void removeMessageListener(MessageListener listener)
           
 void sendMessage(Message message)
          sends a message out across the pipe
 void setSendSystemMessages(boolean doIt)
          If doSendSystemMessages is TRUE, then all system messages get dispatched to all listeners.
 void start()
          Spawn a thread to start receiving messages.
 void stop()
          Stop receiving messages.
 

Method Detail

connect

public void connect()
             throws java.io.IOException
Try to connect to the server

java.io.IOException

disconnect

public void disconnect()
Try to disconnect from the server


getID

public int getID()
get the ID of this peer


isConnected

public boolean isConnected()
are we connected or not?


sendMessage

public void sendMessage(Message message)
sends a message out across the pipe


start

public void start()
Spawn a thread to start receiving messages.


stop

public void stop()
Stop receiving messages. Stops the thread (maybe after a little while).


addMessageListener

public void addMessageListener(MessageListener listener)
adds an event listener that receives all incoming messages received by this peer


removeMessageListener

public void removeMessageListener(MessageListener listener)

setSendSystemMessages

public void setSendSystemMessages(boolean doIt)
If doSendSystemMessages is TRUE, then all system messages get dispatched to all listeners. (Default = FALSE)


bind

public void bind(java.lang.String name)
Parameters:
name - name to bind this client to

lookup

public int lookup(java.lang.String name)
Look up a peer id that's been bound to a name


Documentation generated March 5 2003