|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.javagroups.stack.Protocol | +--org.javagroups.protocols.TOTAL
Implements the total ordering layer using a message sequencer
The protocol guarantees that all bcast sent messages will be delivered in the same order to all members. For that it uses a sequencer which assignes monotonically increasing sequence ID to broadcasts. Then all group members deliver the bcasts in ascending sequence ID order.
Please note that once a BLOCK_OK
is acknowledged messages
coming from above are discarded! Either the application must stop
sending messages when a BLOCK
event is received from the
channel or a QUEUE layer should be placed above this one. Received messages
are still delivered above though.
bcast requests are retransmitted periodically until a bcast reply is received. In case a BCAST_REP is on its way during a BCAST_REQ retransmission, then the next BCAST_REP will be to a non-existing BCAST_REQ. So, a nulll BCAST message is sent to fill the created gap in the seqID of all members.
Nested Class Summary | |
---|---|
static class |
TOTAL.Header
The header processed by the TOTAL layer and intended for TOTAL inter-stack communication |
Field Summary |
---|
Fields inherited from class org.javagroups.stack.Protocol |
---|
down_handler, down_prot, down_queue, down_thread, down_thread_prio, observer, props, stack, up_handler, up_prot, up_queue, up_thread, up_thread_prio |
Constructor Summary | |
---|---|
TOTAL()
Create the TOTAL layer |
Method Summary | |
---|---|
void |
down(Event event)
An event is to be sent down the stack. |
java.lang.String |
getName()
|
java.util.Vector |
requiredDownServices()
List of events that are required to be answered by some layer below. |
java.util.Vector |
requiredUpServices()
List of events that are required to be answered by some layer above. |
boolean |
setProperties(java.util.Properties properties)
Configures the protocol initially. |
void |
start()
Prepare this layer to receive messages from above |
void |
stop()
Handle the stop() method travelling down the stack. |
void |
up(Event event)
An event was received from the layer below. |
Methods inherited from class org.javagroups.stack.Protocol |
---|
destroy, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, init, passDown, passUp, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, stopInternal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TOTAL()
Method Detail |
public void start() throws java.lang.Exception
start
in class Protocol
java.lang.Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String)
will throw an exceptionpublic void stop()
The local addr is set to null, since after a Start->Stop->Start sequence this member's addr is not guaranteed to be the same
stop
in class Protocol
public java.lang.String getName()
getName
in class Protocol
public boolean setProperties(java.util.Properties properties)
Protocol
"loopback=false;unicast_inport=4444"
setProperties
in class Protocol
public java.util.Vector requiredDownServices()
Protocol
requiredDownServices
in class Protocol
public java.util.Vector requiredUpServices()
Protocol
requiredUpServices
in class Protocol
public void up(Event event)
Protocol
passDown()
or c) the event (or another event) is sent up
the stack using passUp()
.
up
in class Protocol
public void down(Event event)
Protocol
passDown()
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using passUp()
.
down
in class Protocol
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |