Package net.sf.freecol.common.networking
Interface MessageHandler
-
- All Known Implementing Classes:
AIInGameInputHandler,ClientInputHandler,MetaServerHandler,MetaServerUtils.MetaInputHandler,ServerInputHandler,UserConnectionHandler
public interface MessageHandlerRead and handle incoming messages.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Messagehandle(Connection connection, Message message)Handle an incoming message.Messageread(Connection connection)Read an incoming Message.
-
-
-
Method Detail
-
handle
Message handle(Connection connection, Message message) throws FreeColException
Handle an incoming message.- Parameters:
connection- TheConnectionthe message arrived on.message- TheMessageto handle.- Returns:
- A reply message, if any.
- Throws:
FreeColException- if the message is malformed.
-
read
Message read(Connection connection) throws FreeColException, javax.xml.stream.XMLStreamException
Read an incoming Message.- 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.
-
-