|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcz.cuni.pogamut.communication.MediatorForClient
public class MediatorForClient
This class stands between Client and Mediator, used by RemoteParser when creating new Mediator.
| Field Summary | |
|---|---|
private java.net.Socket |
clientSocket
Socket to the Client. |
protected java.io.BufferedReader |
input
Used to read messages from the Client, which should be delivered to the GameBots. |
private java.util.concurrent.BlockingQueue<MessageObject> |
messagesForClient
|
private java.io.ObjectOutputStream |
output
Used for sending messages to the Client. |
| Constructor Summary | |
|---|---|
MediatorForClient(java.net.Socket clientSocket)
|
|
| Method Summary | |
|---|---|
void |
closeClient()
Closes the client's socket. |
java.lang.String |
receiveMessageFromClient()
Reads message from the Client (command to the GameBots). |
void |
sendMessageToClient(MessageObject msg)
Sends parsed message from the Parser to the Client. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.concurrent.BlockingQueue<MessageObject> messagesForClient
private java.net.Socket clientSocket
protected java.io.BufferedReader input
private java.io.ObjectOutputStream output
| Constructor Detail |
|---|
public MediatorForClient(java.net.Socket clientSocket)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public java.lang.String receiveMessageFromClient()
throws CantReadException
receiveMessageFromClient in interface MediatorClientInterfaceCantReadException
public void sendMessageToClient(MessageObject msg)
throws CantWriteException
sendMessageToClient in interface MediatorClientInterfaceCantWriteException
public void closeClient()
throws CantCloseConnectionException
closeClient in interface MediatorClientInterfaceCantCloseConnectionException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||