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.Loggerlogger
-
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 Messagehandle(Connection connection, Message message)Handle an incoming message.Messageread(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- TheFreeColClientfor the game.
-
-
Method Detail
-
handle
public Message handle(Connection connection, Message message) throws FreeColException
Handle an incoming message.- Specified by:
handlein interfaceMessageHandler- Parameters:
connection- TheConnectionthe message arrived on.message- TheMessageto 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:
readin interfaceMessageHandler- Parameters:
connection- TheConnectionto read from.- Returns:
- The
Messagefound, 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.
-
-