Package com.rabbitmq.client.impl
Interface FrameHandler
-
- All Superinterfaces:
NetworkConnection
- All Known Implementing Classes:
SocketChannelFrameHandler,SocketFrameHandler
public interface FrameHandler extends NetworkConnection
Interface to a frame handler.Concurrency
Implementations must be thread-safe, and not allow frames to be interleaved, either while reading or writing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close the underlying data connection (complaint not permitted).voidflush()Flush the underlying data connection.intgetTimeout()Get the underlying socket's read timeout in milliseconds.voidinitialize(AMQConnection connection)FramereadFrame()Read aFramefrom the underlying data connection.voidsendHeader()Send the initial connection header, thus kickstarting the AMQP protocol version negotiation process and putting the underlying connection in a state such that the next layer of startup can proceed.voidsetTimeout(int timeoutMs)Set the underlying socket's read timeout in milliseconds, if applicable.voidwriteFrame(Frame frame)Write aFrameto the underlying data connection.-
Methods inherited from interface com.rabbitmq.client.impl.NetworkConnection
getAddress, getLocalAddress, getLocalPort, getPort
-
-
-
-
Method Detail
-
setTimeout
void setTimeout(int timeoutMs) throws java.net.SocketExceptionSet the underlying socket's read timeout in milliseconds, if applicable.- Parameters:
timeoutMs- The timeout in milliseconds- Throws:
java.net.SocketException
-
getTimeout
int getTimeout() throws java.net.SocketExceptionGet the underlying socket's read timeout in milliseconds.- Returns:
- The timeout in milliseconds
- Throws:
java.net.SocketException
-
sendHeader
void sendHeader() throws java.io.IOExceptionSend the initial connection header, thus kickstarting the AMQP protocol version negotiation process and putting the underlying connection in a state such that the next layer of startup can proceed.- Throws:
java.io.IOException- if there is a problem accessing the connection
-
initialize
void initialize(AMQConnection connection)
-
readFrame
Frame readFrame() throws java.io.IOException
Read aFramefrom the underlying data connection.- Returns:
- an incoming Frame, or null if there is none
- Throws:
java.io.IOException- if there is a problem accessing the connectionjava.net.SocketTimeoutException- if the underlying read times out
-
writeFrame
void writeFrame(Frame frame) throws java.io.IOException
Write aFrameto the underlying data connection.- Parameters:
frame- the Frame to transmit- Throws:
java.io.IOException- if there is a problem accessing the connection
-
flush
void flush() throws java.io.IOExceptionFlush the underlying data connection.- Throws:
java.io.IOException- if there is a problem accessing the connection
-
close
void close()
Close the underlying data connection (complaint not permitted).
-
-