public class STATE_TRANSFER extends Protocol
STATE
,
STATE_SOCK
Modifier and Type | Class and Description |
---|---|
static class |
STATE_TRANSFER.StateHeader
Wraps data for a state request/response.
|
Modifier and Type | Field and Description |
---|---|
protected AtomicBoolean |
barrier_closed
Used to prevent spurious open and close barrier calls
|
Constructor and Description |
---|
STATE_TRANSFER() |
Modifier and Type | Method and Description |
---|---|
void |
closeBarrierAndSuspendStable() |
Object |
down(Event evt)
An event is to be sent down the stack.
|
double |
getAverageStateSize() |
long |
getNumberOfStateBytesSent() |
int |
getNumberOfStateRequests() |
protected void |
getStateFromApplication(Address requester,
Digest digest) |
protected void |
handleException(Throwable exception) |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
void |
openBarrierAndResumeStable() |
List<Integer> |
requiredDownServices()
List of events that are required to be answered by some layer below.
|
void |
resetStats() |
protected void |
sendException(Address requester,
Throwable exception) |
void |
start()
This method is called on a
Channel.connect(String) . |
void |
stop()
This method is called on a
Channel.disconnect() . |
Object |
up(Event evt)
An event was received from the layer below.
|
destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, isErgonomics, printStats, providedDownServices, providedUpServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled
protected AtomicBoolean barrier_closed
public int getNumberOfStateRequests()
public long getNumberOfStateBytesSent()
public double getAverageStateSize()
public List<Integer> requiredDownServices()
Protocol
requiredDownServices
in class Protocol
public void resetStats()
resetStats
in class Protocol
public void init() throws Exception
Protocol
public void start() throws 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
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 void closeBarrierAndSuspendStable()
public void openBarrierAndResumeStable()
public Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.public 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()
.protected void handleException(Throwable exception)
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.