public class FORWARD_TO_COORD extends Protocol
Modifier and Type | Class and Description |
---|---|
protected static class |
FORWARD_TO_COORD.ForwardHeader |
Modifier and Type | Field and Description |
---|---|
protected Address |
coord
the address of the current coordinator, all msgs are forwarded to it
|
protected java.util.concurrent.atomic.AtomicLong |
current_id
ID to be used to identify forwarded messages.
|
protected ForwardQueue |
fwd_queue |
protected Address |
local_addr |
protected boolean |
received_not_coord
Set when NOT_COORD message has been received.
|
protected long |
resend_delay
Deprecated.
|
after_creation_hook, down_prot, ergonomics, id, log, name, stack, stats, up_prot
Constructor and Description |
---|
FORWARD_TO_COORD() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
down(Event evt)
An event is to be sent down the stack.
|
int |
getDeliveryTableSize() |
int |
getForwardTableSize() |
protected long |
getNextId() |
protected void |
handleViewChange(View view) |
java.util.List<java.lang.Integer> |
providedUpServices()
List of events that are provided to layers above (they will be handled when sent down from above)
|
protected void |
send(Address target,
long ack_id,
byte type) |
protected void |
sendAck(Address target,
long ack_id) |
protected void |
sendNotCoord(Address target,
long ack_id) |
void |
start()
This method is called on a
Channel.connect(String) . |
void |
stop()
This method is called on a
Channel.disconnect() . |
java.lang.Object |
up(Event evt)
An event was received from the layer below.
|
accept, afterCreationHook, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, init, isErgonomics, level, parse, printStats, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled, up
@Deprecated protected long resend_delay
protected volatile Address coord
protected volatile Address local_addr
protected final java.util.concurrent.atomic.AtomicLong current_id
protected final ForwardQueue fwd_queue
protected volatile boolean received_not_coord
public int getForwardTableSize()
public int getDeliveryTableSize()
public java.util.List<java.lang.Integer> providedUpServices()
Protocol
providedUpServices
in class Protocol
public void start() throws java.lang.Exception
Protocol
Channel.connect(String)
. Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.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()
Protocol
Channel.disconnect()
. Stops work (e.g. by closing multicast socket).
Will be called from top to bottom. This means that at the time of the method invocation the
neighbor protocol below is still working. This method will replace the
STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
when this method is called all messages in the down queue will have been flushedpublic java.lang.Object down(Event evt)
Protocol
down_prot.down()
. 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 up_prot.up()
.public java.lang.Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.protected long getNextId()
protected void handleViewChange(View view)
protected void sendAck(Address target, long ack_id)
protected void sendNotCoord(Address target, long ack_id)
protected void send(Address target, long ack_id, byte type)
Copyright © 1998-2020 Red Hat. All Rights Reserved.