rmi
Interface ChatParticipantInterface

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
ChatClientInterface, ChatServerInterface
All Known Implementing Classes:
ChatClient, ChatParticipant, ChatServer

public interface ChatParticipantInterface
extends java.rmi.Remote

Interface for participants (server and clients) in simple chat application. This interface describes functionality needed/useful in both server and clients. Every participant has a list of clients currently participating in the chat.


Method Summary
 void addClient(ChatClientInterface c)
          Adds client.
 void broadcast(java.lang.String message)
          Sends message to all clients.
 void display(java.lang.String message)
          Displays message.
 void removeClient(ChatClientInterface c)
          Removes client.
 

Method Detail

addClient

void addClient(ChatClientInterface c)
               throws java.rmi.RemoteException
Adds client.

Parameters:
c - client to add
Throws:
java.rmi.RemoteException

removeClient

void removeClient(ChatClientInterface c)
                  throws java.rmi.RemoteException
Removes client.

Parameters:
c - client to remove
Throws:
java.rmi.RemoteException

broadcast

void broadcast(java.lang.String message)
               throws java.rmi.RemoteException
Sends message to all clients.

Parameters:
message - message to send to all
Throws:
java.rmi.RemoteException

display

void display(java.lang.String message)
             throws java.rmi.RemoteException
Displays message. This method could be implemented in a variety of ways, to display the message in a GUI, on standard output, etc.

Parameters:
message - message to display
Throws:
java.rmi.RemoteException