public interface Connection extends Closeable
Modifier and Type | Interface and Description |
---|---|
static interface |
Connection.ClosedCallback
A callback that will be triggered once the connection is closed
|
Modifier and Type | Method and Description |
---|---|
void |
attach(Object attachment) |
void |
backupMessageHandler()
Records the current message handler, which can be reset using
restoreMessageHandler() |
void |
close()
Close the connection.
|
Object |
getAttachment() |
InetAddress |
getPeerAddress()
Get the remote peer address.
|
void |
restoreMessageHandler()
Resets the message handler to any that was backed up using
backupMessageHandler() . |
void |
setMessageHandler(MessageHandler messageHandler)
Change the current message handler.
|
void |
shutdownWrites()
Shut down writes once all messages are sent.
|
OutputStream |
writeMessage()
Write a protocol message.
|
OutputStream writeMessage() throws IOException
IOException
- if an I/O error occursvoid shutdownWrites() throws IOException
MessageHandler.handleShutdown(Connection)
method to be called.IOException
- if an I/O error occursvoid close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
- if the close failsvoid setMessageHandler(MessageHandler messageHandler)
messageHandler
- the new message handler to useInetAddress getPeerAddress()
void attach(Object attachment)
Object getAttachment()
void backupMessageHandler()
restoreMessageHandler()
void restoreMessageHandler()
backupMessageHandler()
. If no backup was done, MessageHandler.NULL
is usedCopyright © 2023 JBoss by Red Hat. All rights reserved.