Package org.jboss.as.process.protocol
Interface MessageHandler
-
public interface MessageHandlerA message handler for asynchronous protocol messages.- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description static MessageHandlerNULL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidhandleFailure(Connection connection, IOException e)Handle an input failure condition.voidhandleFinished(Connection connection)Handle the condition where a connection is completely finished (both reads and writes).voidhandleMessage(Connection connection, InputStream dataStream)Handle a message.voidhandleShutdown(Connection connection)Handle the end-of-input condition.
-
-
-
Field Detail
-
NULL
static final MessageHandler NULL
-
-
Method Detail
-
handleMessage
void handleMessage(Connection connection, InputStream dataStream) throws IOException
Handle a message.- Parameters:
connection- the connection to the remote sidedataStream- the message bytes- Throws:
IOException- if an I/O error occurs
-
handleShutdown
void handleShutdown(Connection connection) throws IOException
Handle the end-of-input condition. The write side will still be writable.- Parameters:
connection- the connection to the remote side- Throws:
IOException- if an I/O error occurs
-
handleFailure
void handleFailure(Connection connection, IOException e) throws IOException
Handle an input failure condition. The write side is unlikely to be writable. When a failure is encountered, the socket should usually beConnection.close()d.- Parameters:
connection- the connection to the remote sidee- the read error received- Throws:
IOException- if an I/O error occurs
-
handleFinished
void handleFinished(Connection connection) throws IOException
Handle the condition where a connection is completely finished (both reads and writes). This is where any reconnect logic should live.- Parameters:
connection- the connection that ended- Throws:
IOException- if an I/O error occurs
-
-