Package net.sf.freecol.common.networking
Interface MessageHandler
-
- All Known Implementing Classes:
AIInGameInputHandler
,ClientInputHandler
,MetaServerHandler
,MetaServerUtils.MetaInputHandler
,ServerInputHandler
,UserConnectionHandler
public interface MessageHandler
Read and handle incoming messages.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Message
handle(Connection connection, Message message)
Handle an incoming message.Message
read(Connection connection)
Read an incoming Message.
-
-
-
Method Detail
-
handle
Message handle(Connection connection, Message message) throws FreeColException
Handle an incoming message.- 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
Message read(Connection connection) throws FreeColException, javax.xml.stream.XMLStreamException
Read an incoming Message.- 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.
-
-