Class JChannel
- All Implemented Interfaces:
Transport
- Direct Known Subclasses:
MuxChannel
Properties
Properties are used to configure a channel, and are accepted in several forms; the String form is described here. A property string consists of a number of properties separated by colons. For example:
"<prop1>(arg1=val1):<prop2>(arg1=val1;arg2=val2):<prop3>:<propn>"
Each property relates directly to a protocol layer, which is
implemented as a Java class. When a protocol stack is to be created
based on the above property string, the first property becomes the
bottom-most layer, the second one will be placed on the first, etc.:
the stack is created from the bottom to the top, as the string is
parsed from left to right. Each property has to be the name of a
Java class that resides in the
org.jgroups.protocols package.
Note that only the base name has to be given, not the fully specified class name (e.g., UDP instead of org.jgroups.protocols.UDP).
Each layer may have 0 or more arguments, which are specified as a list of name/value pairs in parentheses directly after the property. In the example above, the first protocol layer has 1 argument, the second 2, the third none. When a layer is created, these properties (if there are any) will be set in a layer by invoking the layer's setProperties() method
As an example the property string below instructs JGroups to create a JChannel with protocols UDP, PING, FD and GMS:
"UDP(mcast_addr=228.10.9.8;mcast_port=5678):PING:FD:GMS"
The UDP protocol layer is at the bottom of the stack, and it
should use mcast address 228.10.9.8. and port 5678 rather than
the default IP multicast address and port. The only other argument
instructs FD to output debug information while executing.
Property UDP refers to a class UDP,
which is subsequently loaded and an instance of which is created as protocol layer.
If any of these classes are not found, an exception will be thrown and
the construction of the stack will be aborted.
- Version:
- $Id: JChannel.java,v 1.158.2.25 2009/03/30 12:35:18 belaban Exp $
- Author:
- Bela Ban
-
Field Summary
FieldsModifier and TypeFieldDescriptionProvides storage for arbitrary objects.protected booleanprotected org.jgroups.JChannel.CloserThreadThread responsible for closing a channel and potentially reconnecting to it (e.g., when shunned).protected booleanstatic final StringThe default protocol stack used by the default constructor.protected final ConcurrentMap<String, Object> protected final org.apache.commons.logging.Logprotected longprotected longprotected longprotected longprotected booleanCollect statisticsFields inherited from class Channel
AUTO_GETSTATE, AUTO_RECONNECT, BLOCK, channel_listeners, GET_STATE_EVENTS, LOCAL, receiver, SUSPECT, up_handler, VIEW -
Constructor Summary
ConstructorsModifierConstructorDescriptionJChannel()Constructs aJChannelinstance with the protocol stack specified by theDEFAULT_PROTOCOL_STACKmember.protectedJChannel(boolean no_op) Used by subclass to create a JChannel without a protocol stack, don't use as application programmerConstructs aJChannelinstance with the protocol stack configuration contained by the specified file.Deprecated.Use the constructors with specific parameter types instead.Constructs aJChannelinstance with the protocol stack configuration based upon the specified properties parameter.Constructs aJChannelinstance with the protocol stack configuration indicated by the specified URL.JChannel(ProtocolStackConfigurator configurator) Constructs aJChannelinstance with the protocol stack configuration contained by the protocol stack configurator parameter.Constructs aJChannelinstance with the protocol stack configuration contained by the specified XML element. -
Method Summary
Modifier and TypeMethodDescriptionprotected void_close(boolean disconnect, boolean close_mq) Disconnects and closes the channel.voidblockOk()Called to acknowledge a block() (callback inMembershipListenerorBlockEventreceived from call toreceive()).protected voidhealth check
throws a ChannelClosed exception if the channel is closedprotected voidvoidclose()Destroys the channel.final voidcloseMessageQueue(boolean flush_entries) voidConnects the channel to a group.voidConnects this channel to a group and gets a state from a specified state provider.voidDisconnects the channel if it is connected.voidSends a message through the protocol stack if the stack is availableCan be used instead of down() when a return value is expected.Returns a map of statistics of the various protocols and of the channel itself.voidenableStats(boolean stats) booleanbooleangetAllStates(Vector targets, long timeout) Deprecated.Not really needed - we always want to get the state from a single member, usegetState(org.jgroups.Address, long)insteadDeprecated.UsegetClusterName()insteadReturns the cluster name of the group of which the channel is a member.getInfo()returns the local address of the channel returns null if the channel is closedprotected org.apache.commons.logging.LoggetLog()intintReturns the number of messages that are waiting.getOpt(int option) returns the value of an option.returns the protocol stack configuration in string format.Returns the protocol stack.longlonglonglongbooleanRetrieves a full state from the target member.booleanRetrieves a substate (or partial state) indicated by state_id from the target member.booleanRetrieves a substate (or partial state) indicated by state_id from the target member.protected booleanRetrieves a substate (or partial state) indicated by state_id from the target member.intgetView()Returns the current view.protected final voidinit(ProtocolStackConfigurator configurator) booleanreturns true if the Connect operation has been called successfullybooleanisOpen()returns true if the Open operation has been called successfullyvoidopen()Opens the channel.peek(long timeout) Just peeks at the next message, view or block.printProtocolSpec(boolean include_properties) Returns a pretty-printed form of all the protocols.receive(long timeout) Deprecated.Use aReceiverinsteadvoidvoidreturnState(byte[] state) Called by the application is response to receiving agetState()object when callingreceive().voidreturnState(byte[] state, String state_id) Returns a substate as indicated by state_idvoidsend(Address dst, Address src, Serializable obj) creates a new message with the destination address, and the source address and the object as the message valuevoidSends a message through the protocol stack.voidvoidSets a channel option.voidshutdown()Shuts down the channel without disconnectingbooleanstartFlush(boolean automatic_resume) Will perform a flush of the system, ie.booleanstartFlush(long timeout, boolean automatic_resume) Will perform a flush of the system, ie.booleanstartFlush(List<Address> flushParticipants, boolean automatic_resume) Performs a partial flush in a cluster for flush participants.booleanvoidvoidprotected voidstopStack(boolean disconnect, boolean destroy) toString(boolean details) Callback method
Called by the ProtocolStack when a message is received.
-
Field Details
-
DEFAULT_PROTOCOL_STACK
The default protocol stack used by the default constructor.- See Also:
-
closer
protected org.jgroups.JChannel.CloserThread closerThread responsible for closing a channel and potentially reconnecting to it (e.g., when shunned). -
connected
protected volatile boolean connected -
closed
protected volatile boolean closed -
additional_data
Provides storage for arbitrary objects. Protocols can send up CONFIG events, and all key-value pairs of a CONFIG event will be added to additional_data. On reconnect, a CONFIG event will be sent down by the channel, containing all key-value pairs of additional_data -
info
-
log
protected final org.apache.commons.logging.Log log -
stats
protected boolean statsCollect statistics -
sent_msgs
protected long sent_msgs -
received_msgs
protected long received_msgs -
sent_bytes
protected long sent_bytes -
received_bytes
protected long received_bytes
-
-
Constructor Details
-
JChannel
protected JChannel(boolean no_op) Used by subclass to create a JChannel without a protocol stack, don't use as application programmer -
JChannel
Constructs aJChannelinstance with the protocol stack specified by theDEFAULT_PROTOCOL_STACKmember.- Throws:
ChannelException- if problems occur during the initialization of the protocol stack.
-
JChannel
Constructs aJChannelinstance with the protocol stack configuration contained by the specified file.- Parameters:
properties- a file containing a JGroups XML protocol stack configuration.- Throws:
ChannelException- if problems occur during the configuration or initialization of the protocol stack.
-
JChannel
Constructs aJChannelinstance with the protocol stack configuration contained by the specified XML element.- Parameters:
properties- a XML element containing a JGroups XML protocol stack configuration.- Throws:
ChannelException- if problems occur during the configuration or initialization of the protocol stack.
-
JChannel
Constructs aJChannelinstance with the protocol stack configuration indicated by the specified URL.- Parameters:
properties- a URL pointing to a JGroups XML protocol stack configuration.- Throws:
ChannelException- if problems occur during the configuration or initialization of the protocol stack.
-
JChannel
Constructs aJChannelinstance with the protocol stack configuration based upon the specified properties parameter.- Parameters:
properties- an old style property string, a string representing a system resource containing a JGroups XML configuration, a string representing a URL pointing to a JGroups XML XML configuration, or a string representing a file name that contains a JGroups XML configuration.- Throws:
ChannelException- if problems occur during the configuration and initialization of the protocol stack.
-
JChannel
Constructs aJChannelinstance with the protocol stack configuration contained by the protocol stack configurator parameter.All of the public constructors of this class eventually delegate to this method.
- Parameters:
configurator- a protocol stack configurator containing a JGroups protocol stack configuration.- Throws:
ChannelException- if problems occur during the initialization of the protocol stack.
-
JChannel
Deprecated.Use the constructors with specific parameter types instead.Creates a new JChannel with the protocol stack as defined in the properties parameter. an example of this parameter is
"UDP:PING:FD:STABLE:NAKACK:UNICAST:FRAG:FLUSH:GMS:VIEW_ENFORCER:STATE_TRANSFER:QUEUE"
Other examples can be found in the ./conf directory- Parameters:
properties- the protocol stack setup; if null, the default protocol stack will be used. The properties can also be a java.net.URL object or a string that is a URL spec. The JChannel will validate any URL object and String object to see if they are a URL. In case of the parameter being a url, the JChannel will try to load the xml from there. In case properties is a org.w3c.dom.Element, the ConfiguratorFactory will parse the DOM tree with the element as its root element.- Throws:
ChannelException
-
-
Method Details
-
getProtocolStack
Returns the protocol stack. Currently used by Debugger. Specific to JChannel, therefore not visible in Channel -
getLog
-
getProperties
returns the protocol stack configuration in string format. an example of this property is
"UDP:PING:FD:STABLE:NAKACK:UNICAST:FRAG:FLUSH:GMS:VIEW_ENFORCER:STATE_TRANSFER:QUEUE" -
statsEnabled
public boolean statsEnabled() -
enableStats
public void enableStats(boolean stats) -
resetStats
public void resetStats() -
getSentMessages
public long getSentMessages() -
getSentBytes
public long getSentBytes() -
getReceivedMessages
public long getReceivedMessages() -
getReceivedBytes
public long getReceivedBytes() -
getNumberOfTasksInTimer
public int getNumberOfTasksInTimer() -
getTimerThreads
public int getTimerThreads() -
dumpTimerQueue
-
printProtocolSpec
Returns a pretty-printed form of all the protocols. If include_properties is set, the properties for each protocol will also be printed. -
connect
Connects the channel to a group. If the channel is already connected, an error message will be printed to the error log. If the channel is closed a ChannelClosed exception will be thrown. This method starts the protocol stack by calling ProtocolStack.start, then it sends an Event.CONNECT event down the stack and waits for the return value. Once the call returns, the channel listeners are notified and the channel is considered connected.- Specified by:
connectin classChannel- Parameters:
cluster_name- AStringdenoting the group name. Cannot be null.- Throws:
ChannelException- The protocol stack cannot be startedChannelClosedException- The channel is closed and therefore cannot be used any longer. A new channel has to be created first.- See Also:
-
connect
public void connect(String cluster_name, Address target, String state_id, long timeout) throws ChannelException Connects this channel to a group and gets a state from a specified state provider.This method essentially invokes
connectandgetStatemethods successively. If FLUSH protocol is in channel's stack definition only one flush is executed for both connecting and fetching state rather than two flushes if we invokeconnectandgetStatein succesion. If the channel is already connected, an error message will be printed to the error log. If the channel is closed a ChannelClosed exception will be thrown.- Specified by:
connectin classChannel- Parameters:
cluster_name- the cluster name to connect to. Cannot be null.target- the state provider. If null state will be fetched from coordinator, unless this channel is coordinator.state_id- the substate id for partial state transfer. If null entire state will be transferred.timeout- the timeout for state transfer.- Throws:
ChannelException- The protocol stack cannot be startedChannelException- Connecting to cluster was not successfulChannelClosedException- The channel is closed and therefore cannot be used any longer. A new channel has to be created first.StateTransferException- State transfer was not successful
-
disconnect
public void disconnect()Disconnects the channel if it is connected. If the channel is closed, this operation is ignored
Otherwise the following actions happen in the listed order
- The JChannel sends a DISCONNECT event down the protocol stack
- Blocks until the event has returned
- Sends a STOP_QUEING event down the stack
- Stops the protocol stack by calling ProtocolStack.stop()
- Notifies the listener, if the listener is available
- Specified by:
disconnectin classChannel- See Also:
- The JChannel sends a DISCONNECT event down the protocol stack
-
close
-
shutdown
-
open
Opens the channel. Note that the channel is only open, but not connected. This does the following actions:- Resets the receiver queue by calling Queue.reset
- Sets up the protocol stack by calling ProtocolStack.setup
- Sets the closed flag to false
- Overrides:
openin classChannel- Throws:
ChannelException
-
isOpen
-
isConnected
public boolean isConnected()returns true if the Connect operation has been called successfully- Specified by:
isConnectedin classChannel
-
getNumMessages
public int getNumMessages()Description copied from class:ChannelReturns the number of messages that are waiting. Those messages can be removed byChannel.receive(long). Note that this number could change after calling this method and before calling receive() (e.g. the latter method might be called by a different thread).- Overrides:
getNumMessagesin classChannel- Returns:
- The number of messages on the queue, or -1 if the queue/channel is closed/disconnected.
-
dumpQueue
-
dumpStats
Returns a map of statistics of the various protocols and of the channel itself. -
dumpStats
-
dumpChannelStats
-
send
Sends a message through the protocol stack. Implements the Transport interface.- Specified by:
sendin interfaceTransport- Specified by:
sendin classChannel- Parameters:
msg- the message to be sent through the protocol stack, the destination of the message is specified inside the message itself- Throws:
ChannelNotConnectedExceptionChannelClosedException
-
send
public void send(Address dst, Address src, Serializable obj) throws ChannelNotConnectedException, ChannelClosedException creates a new message with the destination address, and the source address and the object as the message value- Specified by:
sendin classChannel- Parameters:
dst- - the destination address of the message, null for all memberssrc- - the source address of the messageobj- - the value of the message- Throws:
ChannelNotConnectedExceptionChannelClosedException- See Also:
-
receive
public Object receive(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException Deprecated.Use aReceiverinsteadBlocking receive method. This method returns the object that was first received by this JChannel and that has not been received before. After the object is received, it is removed from the receive queue.
If you only want to inspect the object received without removing it from the queue call JChannel.peek
If no messages are in the receive queue, this method blocks until a message is added or the operation times out
By specifying a timeout of 0, the operation blocks forever, or until a message has been received.- Specified by:
receivein interfaceTransport- Specified by:
receivein classChannel- Parameters:
timeout- the number of milliseconds to wait if the receive queue is empty. 0 means wait forever- Returns:
- A Message, View, BlockEvent, SuspectEvent, GetStateEvent, SetStateEvent or ExitEvent, depending on what is on top of the internal queue.
- Throws:
TimeoutException- if a timeout occured prior to a new message was receivedChannelNotConnectedExceptionChannelClosedException- See Also:
-
peek
public Object peek(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException Just peeks at the next message, view or block. Does not install new view if view is received
Does the same thing as JChannel.receive but doesn't remove the object from the receiver queue- Specified by:
peekin classChannel- Parameters:
timeout- Value in milliseconds. Value invalid input: '<'= 0 means wait forever- Returns:
- A Message, View, BlockEvent, SuspectEvent, GetStateEvent or SetStateEvent object, depending on what is on top of the internal queue.
- Throws:
ChannelNotConnectedException- The channel must be connected to receive messages.ChannelClosedException- The channel is closed and therefore cannot be used any longer. A new channel has to be created first.TimeoutException- Thrown when a timeout has occurred.- See Also:
-
getView
-
getLocalAddress
returns the local address of the channel returns null if the channel is closed- Specified by:
getLocalAddressin classChannel- Returns:
- The channel's address. Generated by the underlying transport, and opaque.
Addresses can be used as destination in the
Sendoperation.
-
getLocalAddressAsString
-
getChannelName
Deprecated.UsegetClusterName()insteadreturns the name of the channel if the channel is not connected or if it is closed it will return null- Specified by:
getChannelNamein classChannel- Returns:
- The group address
-
getClusterName
Description copied from class:ChannelReturns the cluster name of the group of which the channel is a member. This is the object that was the argument toconnect(). Calling this method on a closed channel returnsnull.- Specified by:
getClusterNamein classChannel- Returns:
- The cluster name
-
setOpt
Sets a channel option. The options can be one of the following:- Channel.BLOCK
- Channel.LOCAL
- Channel.AUTO_RECONNECT
- Channel.AUTO_GETSTATE
There are certain dependencies between the options that you can set, I will try to describe them here.
Option: Channel.BLOCK
Value: java.lang.Boolean
Result: set to true will set setOpt(VIEW, true) and the JChannel will receive BLOCKS and VIEW events
Option: LOCAL
Value: java.lang.Boolean
Result: set to true the JChannel will receive messages that it self sent out.
Option: AUTO_RECONNECT
Value: java.lang.Boolean
Result: set to true and the JChannel will try to reconnect when it is being closed
Option: AUTO_GETSTATE
Value: java.lang.Boolean
Result: set to true, the AUTO_RECONNECT will be set to true and the JChannel will try to get the state after a close and reconnect happens
-
getOpt
-
blockOk
public void blockOk()Called to acknowledge a block() (callback inMembershipListenerorBlockEventreceived from call toreceive()). After sending blockOk(), no messages should be sent until a new view has been received. Calling this method on a closed channel has no effect. -
getState
public boolean getState(Address target, long timeout) throws ChannelNotConnectedException, ChannelClosedException Retrieves a full state from the target member.State transfer is initiated by invoking getState on this channel, state receiver, and sending a GET_STATE message to a target member - state provider. State provider passes GET_STATE message to application that is using the state provider channel which in turn provides an application state to a state receiver. Upon successful installation of a state at state receiver this method returns true.
- Specified by:
getStatein classChannel- Parameters:
target- State provider. If null, coordinator is usedtimeout- the number of milliseconds to wait for the operation to complete successfully. 0 waits until the state has been receivedstate_id- The ID of the substate. If null, the entire state will be transferred- Returns:
- true if state transfer was successful, false otherwise
- Throws:
ChannelNotConnectedException- if channel was not connected at the time state retrieval was initiatedChannelClosedException- if channel was closed at the time state retrieval was initiatedIllegalStateException- if one of state transfer protocols is not present in this channelIllegalStateException- if flush is used in this channel and cluster could not be flushed- See Also:
-
getState
public boolean getState(Address target, String state_id, long timeout) throws ChannelNotConnectedException, ChannelClosedException Retrieves a substate (or partial state) indicated by state_id from the target member.State transfer is initiated by invoking getState on this channel, state receiver, and sending a GET_STATE message to a target member - state provider. State provider passes GET_STATE message to application that is using the state provider channel which in turn provides an application state to a state receiver. Upon successful installation of a state at state receiver this method returns true.
- Specified by:
getStatein classChannel- Parameters:
target- State provider. If null, coordinator is usedstate_id- The ID of the substate. If null, the entire state will be transferredtimeout- the number of milliseconds to wait for the operation to complete successfully. 0 waits until the state has been received- Returns:
- true if state transfer was successful, false otherwise
- Throws:
ChannelNotConnectedException- if channel was not connected at the time state retrieval was initiatedChannelClosedException- if channel was closed at the time state retrieval was initiatedIllegalStateException- if one of state transfer protocols is not present in this channelIllegalStateException- if flush is used in this channel and cluster could not be flushed- See Also:
-
getState
public boolean getState(Address target, String state_id, long timeout, boolean useFlushIfPresent) throws ChannelNotConnectedException, ChannelClosedException Retrieves a substate (or partial state) indicated by state_id from the target member.State transfer is initiated by invoking getState on this channel, state receiver, and sending a GET_STATE message to a target member - state provider. State provider passes GET_STATE message to application that is using the state provider channel which in turn provides an application state to a state receiver. Upon successful installation of a state at state receiver this method returns true.
- Parameters:
target- State provider. If null, coordinator is usedstate_id- The ID of the substate. If null, the entire state will be transferredtimeout- the number of milliseconds to wait for the operation to complete successfully. 0 waits until the state has been receiveduseFlushIfPresent- whether channel should be flushed prior to state retrieval- Returns:
- true if state transfer was successful, false otherwise
- Throws:
ChannelNotConnectedException- if channel was not connected at the time state retrieval was initiatedChannelClosedException- if channel was closed at the time state retrieval was initiatedIllegalStateException- if one of state transfer protocols is not present in this channelIllegalStateException- if flush is used in this channel and cluster could not be flushed- See Also:
-
getState
protected boolean getState(Address target, String state_id, long timeout, Callable<Boolean> flushInvoker) throws ChannelNotConnectedException, ChannelClosedException Retrieves a substate (or partial state) indicated by state_id from the target member.State transfer is initiated by invoking getState on this channel, state receiver, and sending a GET_STATE message to a target member - state provider. State provider passes GET_STATE message to application that is using the state provider channel which in turn provides an application state to a state receiver. Upon successful installation of a state at state receiver this method returns true.
- Parameters:
target- State provider. If null, coordinator is usedstate_id- The ID of the substate. If null, the entire state will be transferredtimeout- the number of milliseconds to wait for the operation to complete successfully. 0 waits until the state has been receivedflushInvoker- algorithm invoking flush- Returns:
- true if state transfer was successful, false otherwise
- Throws:
ChannelNotConnectedException- if channel was not connected at the time state retrieval was initiatedChannelClosedException- if channel was closed at the time state retrieval was initiatedIllegalStateException- if one of state transfer protocols is not present in this channelIllegalStateException- if flush is used in this channel and cluster could not be flushed- See Also:
-
getAllStates
public boolean getAllStates(Vector targets, long timeout) throws ChannelNotConnectedException, ChannelClosedException Deprecated.Not really needed - we always want to get the state from a single member, usegetState(org.jgroups.Address, long)insteadRetrieves the current group state. Sends GET_STATE event down to STATE_TRANSFER layer. Blocks until STATE_TRANSFER sends up a GET_STATE_OK event or untiltimeoutmilliseconds have elapsed. The argument of GET_STATE_OK should be a vector of objects.- Specified by:
getAllStatesin classChannel- Parameters:
targets- - the target members to receive the state from ( an Address list )timeout- - the number of milliseconds to wait for the operation to complete successfully- Returns:
- true of the state was received, false if the operation timed out
- Throws:
ChannelNotConnectedException- The channel must be connected to receive messages.ChannelClosedException- The channel is closed and therefore cannot be used any longer. A new channel has to be created first.
-
returnState
public void returnState(byte[] state) Called by the application is response to receiving agetState()object when callingreceive(). When the application receives a getState() message on the receive() method, it should call returnState() to reply with the state of the application- Specified by:
returnStatein classChannel- Parameters:
state- The state of the application as a byte buffer (to send over the network).
-
returnState
Returns a substate as indicated by state_id- Specified by:
returnStatein classChannel- Parameters:
state-state_id-
-
up
-
down
-
downcall
Description copied from class:ChannelCan be used instead of down() when a return value is expected. This will be removed in 3.0 when we change the signature of down() to return Object rather than void -
toString
-
init
- Throws:
ChannelException
-
checkClosed
health check
throws a ChannelClosed exception if the channel is closed- Throws:
ChannelClosedException
-
checkClosedOrNotConnected
protected void checkClosedOrNotConnected() throws ChannelNotConnectedException, ChannelClosedException -
_close
protected void _close(boolean disconnect, boolean close_mq) Disconnects and closes the channel. This method does the following things- Calls
this.disconnectif the disconnect parameter is true - Calls
Queue.closeon mq if the close_mq parameter is true - Calls
ProtocolStack.stopon the protocol stack - Calls
ProtocolStack.destroyon the protocol stack - Sets the channel closed and channel connected flags to true and false
- Notifies any channel listener of the channel close operation
- Calls
-
stopStack
protected void stopStack(boolean disconnect, boolean destroy) -
closeMessageQueue
public final void closeMessageQueue(boolean flush_entries) -
flushSupported
public boolean flushSupported()- Specified by:
flushSupportedin classChannel
-
startFlush
public boolean startFlush(boolean automatic_resume) Will perform a flush of the system, ie. all pending messages are flushed out of the system and all members ack their reception. After this call returns, no member will be sending any messages untilstopFlush()is called.In case of flush collisions, random sleep time backoff algorithm is employed and flush is reattempted for numberOfAttempts. Therefore this method is guaranteed to return after timeout x numberOfAttempts miliseconds.
- Specified by:
startFlushin classChannel- Parameters:
automatic_resume- CallstopFlush()after the flush- Returns:
- true if FLUSH completed within the timeout
-
startFlush
Performs a partial flush in a cluster for flush participants.All pending messages are flushed out only for flush participants. Remaining members in a cluster are not included in flush. Flush participants should be a proper subset of a current view.
In case of flush collisions, random sleep time backoff algorithm is employed and flush is reattempted for numberOfAttempts. Therefore this method is guaranteed to return after timeout x numberOfAttempts miliseconds.
- Specified by:
startFlushin classChannel- Parameters:
automatic_resume- CallstopFlush()after the flush- Returns:
- true if FLUSH completed within the timeout
-
startFlush
public boolean startFlush(long timeout, boolean automatic_resume) Will perform a flush of the system, ie. all pending messages are flushed out of the system and all members ack their reception. After this call returns, no member will be sending any messages untilstopFlush()is called.In case of flush collisions, random sleep time backoff algorithm is employed and flush is reattempted for numberOfAttempts. Therefore this method is guaranteed to return after timeout x numberOfAttempts miliseconds.
- Specified by:
startFlushin classChannel- Parameters:
timeout-automatic_resume- CallstopFlush()after the flush- Returns:
- true if FLUSH completed within the timeout
-
stopFlush
-
stopFlush
-
getInfo
-
setInfo
-