Current and proposed network interfacesPage edited by Aidan SkinnerPurposeThis design page describes the low level design for the new interface which is aimed at facilitating encapsulation for the Network code in both the Java Broker & Client. This is the first step in decoupling the exsiting IO layer from both the surrounding Qpid code and more specifically from the current tie-in to MINA. This document will provide sufficient information for architecture review and also for input to task breakdown & planning. Interface Requirements
Design DetailsData FlowAt the start of a connection the the NetworkDriver will pass data to a ProtocolEngine which will handle protocol negotiation and return the ProtocolEngine to use or throw an exception if no driver is available. The implementation will use the existing Sender and Reciever interfaces in org.apache.qpid.transport which will allow the use of the existing alternate transport layer implementations. The thread of control remains with the network driver. Data comes in from the operating system, is read from the socket by the NetworkDriver and given to the ProtocolEngines received method. The ProtocolEngine is responsible for processing the bytes and interfacing to the rest of the broker or client. The ProtocolEngine will write bytes to the wire using the NetworkDriver which implements the Sender interface. Sender:
public interface Sender<T>
{
void setIdleTimeout(long l);
void send(T msg);
void flush();
void close();
}
The ProtocolEngine will implement the Reciever interface to be given bytes by the NetworkDriver. Receiever:
public interface Receiver<T>
{
void received(T msg);
void exception(Throwable t);
void closed();
}
The ProtocolEngine will implement the following interface:
public interface ProtocolEngine implements Receiver
{
void setSender(Sender sender)
void SocketAddress getRemoteAddress()
long getWrittenBytes()
long getReadBytes()
long close()
}
The NetworkDriver will implement the following interface:
public interface NetworkDriver implements Sender
{
void setNetworkDriverConfiguration(NetworkDriverConfiguration config)
void open(InetAddress destination);
void bind(int port, InetAddress[] addresses);
}
The NetworkConfiguration interface provides configuration data for the NetworkDriver:
public interface NetworkDriverConfiguration
{
// Taken from Socket
void getKeepAlive(boolean on)
void getOOBInline(boolean on)
void getReceiveBufferSize(int size)
void getReuseAddress(boolean on)
void getSendBufferSize(int size)
void getSoLinger(boolean on, int linger)
void getSoTimeout(int timeout)
void getTcpNoDelay(boolean on)
void getTrafficClass(int tc)
void getReceiveBufferSize(int size);
void getSendBufferSize(int size);
}
Change Notification Preferences
View Online
|
View Change
|
Add Comment
|
- [CONF] Apache Qpid > Current and proposed network interfaces confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence
- [CONF] Apache Qpid > Current and proposed network inter... confluence