com.rabbitmq.client.impl
Interface FrameHandler

All Known Implementing Classes:
SocketFrameHandler

public interface FrameHandler

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
 void close()
          Close the underlying data connection (complaint not permitted).
 void flush()
          Flush the underlying data connection.
 java.net.InetAddress getAddress()
          Retrieve address of peer.
 int getPort()
          Retrieve port number of peer.
 int getTimeout()
          Get the underlying socket's read timeout in milliseconds.
 Frame readFrame()
          Read a Frame from the underlying data connection.
 void sendHeader()
          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.
 void setTimeout(int timeoutMs)
          Set the underlying socket's read timeout in milliseconds, if applicable.
 void writeFrame(Frame frame)
          Write a Frame to the underlying data connection.
 

Method Detail

getAddress

java.net.InetAddress getAddress()
Retrieve address of peer.


getPort

int getPort()
Retrieve port number of peer.


setTimeout

void setTimeout(int timeoutMs)
                throws java.net.SocketException
Set 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.SocketException
Get the underlying socket's read timeout in milliseconds.

Returns:
The timeout in milliseconds
Throws:
java.net.SocketException

sendHeader

void sendHeader()
                throws java.io.IOException
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.

Throws:
java.io.IOException - if there is a problem accessing the connection

readFrame

Frame readFrame()
                throws java.io.IOException
Read a Frame from 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 connection
java.net.SocketTimeoutException - if the underlying read times out

writeFrame

void writeFrame(Frame frame)
                throws java.io.IOException
Write a Frame to 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.IOException
Flush 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).