A protocol consists of:
One use case for modifying the default set of protocols would be to set a custom SSL socket factory. This would look something like the following:
Protocol myHTTPS = new Protocol( "https", new MySSLSocketFactory(), 443 ); Protocol.registerProtocol( "https", myHTTPS );@author Michael Becke @author Jeff Dever @author Mike Bowler @since 2.0
JPA entity class for the MAILREADER_PROTOCOLS
table.
Protocol Interface Class
.up()
, Down
and getName
. Layers are stacked in a certain order to form a protocol stack. Events are passed from lower layers to upper ones and vice versa. E.g. a Message received by the UDP layer at the bottom will be passed to its higher layer as an Event. That layer will in turn pass the Event to its layer and so on, until a layer handles the Message and sends a response or discards it, the former resulting in another Event being passed down the stack. Each layer has 2 FIFO queues, one for up Events and one for down Events. When an Event is received by a layer (calling the internal upcall ReceiveUpEvent
), it is placed in the up-queue where it will be retrieved by the up-handler thread which will invoke method Up
of the layer. The same applies for Events traveling down the stack. Handling of the up-handler and down-handler threads and the 2 FIFO queues is donw by the Protocol class, subclasses will almost never have to override this behavior.
The important thing to bear in mind is that Events have to passed on between layers in FIFO order which is guaranteed by the Protocol implementation and must be guranteed by subclasses implementing their on Event queuing.
Note that each class implementing interface Protocol MUST provide an empty, public constructor !
If the {@link #printProtocol} flag is set to true {@link #verifyAll()} willalso print out the XML messages in the order they are sent to the console. This may be useful to inspect the whole protocol "by hand". @author Henning Staib
Protocol is effectively a {@link Message} factory. Implementations of this interfaceprovides Message objects that read and write according to a specific Redis protocol specification.
Implementations may use this interface to address issues regarding buffer management. [TODO: document me!] @author Joubin Houshyar (alphazero@sensesay.net) @version alpha.0, 04/02/09 @since alpha.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|