Package net.sf.freecol.client.control
Class ClientInputHandler
- java.lang.Object
-
- net.sf.freecol.client.control.FreeColClientHolder
-
- net.sf.freecol.client.control.ClientInputHandler
-
- All Implemented Interfaces:
MessageHandler
public final class ClientInputHandler extends FreeColClientHolder implements MessageHandler
Message handler implementation for the client side.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
-
Constructor Summary
Constructors Constructor Description ClientInputHandler(FreeColClient freeColClient)
The constructor to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Message
handle(Connection connection, Message message)
Handle an incoming message.Message
read(Connection connection)
Read an incoming Message.-
Methods inherited from class net.sf.freecol.client.control.FreeColClientHolder
askServer, currentPlayerIsMyPlayer, getClientOptions, getConnectController, getFreeColClient, getFreeColServer, getGame, getGUI, getMap, getMyPlayer, getSpecification, igc, pgc
-
-
-
-
Constructor Detail
-
ClientInputHandler
public ClientInputHandler(FreeColClient freeColClient)
The constructor to use.- Parameters:
freeColClient
- TheFreeColClient
for the game.
-
-
Method Detail
-
handle
public Message handle(Connection connection, Message message) throws FreeColException
Handle an incoming message.- Specified by:
handle
in interfaceMessageHandler
- Parameters:
connection
- TheConnection
the message arrived on.message
- TheMessage
to handle.- Returns:
- A reply message, if any.
- Throws:
FreeColException
- if the message is malformed.
-
read
public Message read(Connection connection) throws FreeColException, javax.xml.stream.XMLStreamException
Read an incoming Message.- Specified by:
read
in interfaceMessageHandler
- Parameters:
connection
- TheConnection
to read from.- Returns:
- The
Message
found, or null if none. - Throws:
FreeColException
- if the message can not be instantiated.javax.xml.stream.XMLStreamException
- if there is a problem reading the message.
-
-