public class JChannel extends Channel
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.
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
additional_data
Provides storage for arbitrary objects.
|
protected AddressGenerator |
address_generator |
protected boolean |
closed |
protected ConcurrentMap<String,Object> |
config |
protected boolean |
connected |
static String |
DEFAULT_PROTOCOL_STACK
The default protocol stack used by the default constructor
|
protected Address |
local_addr |
protected Log |
log |
protected String |
name |
protected long |
received_bytes |
protected long |
received_msgs |
protected long |
sent_bytes |
protected long |
sent_msgs |
protected boolean |
stats
Collect statistics
|
AUTO_GETSTATE, AUTO_RECONNECT, BLOCK, channel_listeners, GET_STATE_EVENTS, LOCAL, receiver, socket_factory, SUSPECT, up_handler, VIEW
Constructor and Description |
---|
JChannel()
Constructs a
JChannel instance with the protocol stack
specified by the DEFAULT_PROTOCOL_STACK member. |
JChannel(boolean create_protocol_stack)
Creates a JChannel without a protocol stack; used for programmatic creation of channel and protocol stack
|
JChannel(Element properties)
Constructs a
JChannel instance with the protocol stack
configuration contained by the specified XML element. |
JChannel(File properties)
Constructs a
JChannel instance with the protocol stack
configuration contained by the specified file. |
JChannel(JChannel ch)
Creates a channel with the same configuration as the channel passed to this constructor.
|
JChannel(Object properties)
Deprecated.
Use the constructors with specific parameter types instead.
|
JChannel(ProtocolStackConfigurator configurator)
Constructs a
JChannel instance with the protocol stack
configuration contained by the protocol stack configurator parameter. |
JChannel(String properties)
Constructs a
JChannel instance with the protocol stack
configuration based upon the specified properties parameter. |
JChannel(URL properties)
Constructs a
JChannel instance with the protocol stack
configuration indicated by the specified URL. |
Modifier and Type | Method and Description |
---|---|
protected void |
_close(boolean disconnect,
boolean close_mq)
Disconnects and closes the channel.
|
void |
blockOk()
Called to acknowledge a block() (callback in
MembershipListener or
BlockEvent received from call to receive() ). |
protected void |
checkClosed()
health check
throws a ChannelClosed exception if the channel is closed |
protected void |
checkClosedOrNotConnected() |
void |
close()
Destroys the channel.
|
void |
closeMessageQueue(boolean flush_entries) |
void |
connect(String cluster_name)
Connects the channel to a group.
|
void |
connect(String cluster_name,
Address target,
String state_id,
long timeout)
Connects this channel to a group and gets a state from a specified state
provider.
|
void |
connect(String cluster_name,
Address target,
String state_id,
long timeout,
boolean useFlushIfPresent)
Connects this channel to a group and gets a state from a specified state
provider.
|
void |
connect(String cluster_name,
boolean useFlushIfPresent)
Connects the channel to a group.
|
void |
disconnect()
Disconnects the channel if it is connected.
|
void |
down(Event evt)
Sends a message through the protocol stack if the stack is available
|
Object |
downcall(Event evt)
Can be used instead of down() when a return value is expected.
|
protected Map<String,Long> |
dumpChannelStats() |
String |
dumpQueue() |
Map<String,Object> |
dumpStats()
Returns a map of statistics of the various protocols and of the channel itself.
|
Map<String,Object> |
dumpStats(String protocol_name) |
Map<String,Object> |
dumpStats(String protocol_name,
List<String> attrs) |
String |
dumpTimerQueue() |
void |
enableStats(boolean stats) |
boolean |
flushSupported() |
Address |
getAddress()
Returns the local address of the channel (null if the channel is closed)
|
String |
getAddressAsString() |
String |
getAddressAsUUID() |
AddressGenerator |
getAddressGenerator()
Returns the current
AddressGenerator , or null if none is set |
boolean |
getAllStates(Vector targets,
long timeout)
Deprecated.
Not really needed - we always want to get the state from a single member,
use
getState(org.jgroups.Address, long) instead |
String |
getChannelName()
Deprecated.
Use
getClusterName() instead |
String |
getClusterName()
Returns the cluster name of the group of which the channel is a member.
|
Map<String,Object> |
getInfo() |
Address |
getLocalAddress()
Deprecated.
|
protected Log |
getLog() |
String |
getName()
Returns the logical name of this channel if set.
|
String |
getName(Address member)
Returns the logical name of a given member.
|
int |
getNumberOfTasksInTimer() |
int |
getNumMessages()
Returns the number of messages that are waiting.
|
Object |
getOpt(int option)
returns the value of an option.
|
String |
getProperties()
Returns the protocol stack configuration in string format.
|
ProtocolStack |
getProtocolStack()
Returns the protocol stack
|
long |
getReceivedBytes() |
long |
getReceivedMessages() |
long |
getSentBytes() |
long |
getSentMessages() |
boolean |
getState(Address target,
long timeout)
Retrieves a full state from the target member.
|
boolean |
getState(Address target,
String state_id,
long timeout)
Retrieves a substate (or partial state) indicated by state_id from the target member.
|
boolean |
getState(Address target,
String state_id,
long timeout,
boolean useFlushIfPresent)
Retrieves a substate (or partial state) indicated by state_id from the target member.
|
protected boolean |
getState(Address target,
String state_id,
long timeout,
Callable<Boolean> flushInvoker)
Retrieves a substate (or partial state) indicated by state_id from the target member.
|
int |
getTimerThreads() |
static String |
getVersion() |
View |
getView()
Returns the current view.
|
String |
getViewAsString() |
protected void |
init(JChannel ch) |
protected void |
init(ProtocolStackConfigurator configurator) |
boolean |
isConnected()
returns true if the Connect operation has been called successfully
|
boolean |
isOpen()
returns true if the Open operation has been called successfully
|
void |
open()
Deprecated.
With the removal of shunning, this method should not be used anymore
|
Object |
peek(long timeout)
Just peeks at the next message, view or block.
|
String |
printProtocolSpec(boolean include_properties)
Returns a pretty-printed form of all the protocols.
|
Object |
receive(long timeout)
Deprecated.
Use a
Receiver instead |
void |
resetStats() |
void |
returnState(byte[] state)
Called by the application is response to receiving a
getState() object when
calling receive() . |
void |
returnState(byte[] state,
String state_id)
Returns a substate as indicated by state_id
|
void |
send(Address dst,
Address src,
byte[] buf) |
void |
send(Address dst,
Address src,
byte[] buf,
int offset,
int length) |
void |
send(Address dst,
Address src,
Serializable obj)
creates a new message with the destination address, and the source address
and the object as the message value
|
void |
send(Message msg)
Sends a message through the protocol stack.
|
protected void |
setAddress()
Generates new UUID and sets local address.
|
void |
setAddressGenerator(AddressGenerator address_generator)
Sets the new
AddressGenerator . |
void |
setInfo(String key,
Object value) |
void |
setName(String name)
Sets the logical name for the channel.
|
void |
setOpt(int option,
Object value)
Sets a channel option.
|
void |
setProtocolStack(ProtocolStack stack) |
void |
shutdown()
Deprecated.
Use
Util.shutdown(Channel) instead. This method will be removed in 3.0 |
boolean |
startFlush(boolean automatic_resume)
Will perform a flush of the system, ie.
|
boolean |
startFlush(List<Address> flushParticipants,
boolean automatic_resume)
Performs a partial flush in a cluster for flush participants.
|
boolean |
startFlush(long timeout,
boolean automatic_resume)
Will perform a flush of the system, ie.
|
boolean |
statsEnabled() |
void |
stopFlush() |
void |
stopFlush(List<Address> flushParticipants) |
protected void |
stopStack(boolean stop,
boolean destroy) |
String |
toString(boolean details) |
Object |
up(Event evt)
Callback method
Called by the ProtocolStack when a message is received. |
addChannelListener, clearChannelListeners, getReceiver, getSocketFactory, getUpHandler, notifyChannelClosed, notifyChannelConnected, notifyChannelDisconnected, option2String, removeChannelListener, setChannelListener, setReceiver, setSocketFactory, setUpHandler
public static final String DEFAULT_PROTOCOL_STACK
protected Address local_addr
protected AddressGenerator address_generator
protected String name
protected volatile boolean connected
protected volatile boolean closed
protected final Map<String,Object> additional_data
protected final ConcurrentMap<String,Object> config
protected final Log log
protected boolean stats
protected long sent_msgs
protected long received_msgs
protected long sent_bytes
protected long received_bytes
public JChannel(boolean create_protocol_stack)
create_protocol_stack
- If true, tthe default configuration will be used. If false, no protocol stack
will be createdpublic JChannel() throws ChannelException
JChannel
instance with the protocol stack
specified by the DEFAULT_PROTOCOL_STACK
member.ChannelException
- if problems occur during the initialization of
the protocol stack.public JChannel(File properties) throws ChannelException
JChannel
instance with the protocol stack
configuration contained by the specified file.properties
- a file containing a JGroups XML protocol stack
configuration.ChannelException
- if problems occur during the configuration or
initialization of the protocol stack.public JChannel(Element properties) throws ChannelException
JChannel
instance with the protocol stack
configuration contained by the specified XML element.properties
- a XML element containing a JGroups XML protocol stack
configuration.ChannelException
- if problems occur during the configuration or
initialization of the protocol stack.public JChannel(URL properties) throws ChannelException
JChannel
instance with the protocol stack
configuration indicated by the specified URL.properties
- a URL pointing to a JGroups XML protocol stack
configuration.ChannelException
- if problems occur during the configuration or
initialization of the protocol stack.public JChannel(String properties) throws ChannelException
JChannel
instance with the protocol stack
configuration based upon the specified properties parameter.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.ChannelException
- if problems occur during the configuration and
initialization of the protocol stack.public JChannel(ProtocolStackConfigurator configurator) throws ChannelException
JChannel
instance 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.
configurator
- a protocol stack configurator containing a JGroups
protocol stack configuration.ChannelException
- if problems occur during the initialization of
the protocol stack.public JChannel(Object properties) throws ChannelException
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.ChannelException
public JChannel(JChannel ch) throws ChannelException
ch
- ChannelException
public ProtocolStack getProtocolStack()
getProtocolStack
in class Channel
public void setProtocolStack(ProtocolStack stack)
public String getProperties()
getProperties
in class Channel
public boolean statsEnabled()
public void enableStats(boolean stats)
public void resetStats()
public long getSentMessages()
public long getSentBytes()
public long getReceivedMessages()
public long getReceivedBytes()
public int getNumberOfTasksInTimer()
public int getTimerThreads()
public String dumpTimerQueue()
public String printProtocolSpec(boolean include_properties)
public void connect(String cluster_name) throws ChannelException
connect
in class Channel
cluster_name
- A String
denoting the group name. Cannot be null.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.Channel.disconnect()
public void connect(String cluster_name, boolean useFlushIfPresent) throws ChannelException
cluster_name
- A String
denoting the group name. Cannot be null.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.public void connect(String cluster_name, Address target, String state_id, long timeout) throws ChannelException
This method essentially invokes
connect
and
getState
methods 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 invoke
connect
and
getState
in 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.
connect
in class Channel
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.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 successfulpublic void connect(String cluster_name, Address target, String state_id, long timeout, boolean useFlushIfPresent) throws ChannelException
This method essentially invokes
connect
and
getState
methods 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 invoke
connect
and
getState
in 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.
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.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 successfulpublic void disconnect()
disconnect
in class Channel
Channel.connect(String)
public void close()
@Deprecated public void shutdown()
Util.shutdown(Channel)
instead. This method will be removed in 3.0@Deprecated public void open() throws ChannelException
open
in class Channel
ChannelException
public boolean isOpen()
public boolean isConnected()
isConnected
in class Channel
public int getNumMessages()
Channel
Channel.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).getNumMessages
in class Channel
public Map<String,Object> dumpStats()
public void send(Message msg) throws ChannelNotConnectedException, ChannelClosedException
send
in interface Transport
send
in class Channel
msg
- the message to be sent through the protocol stack,
the destination of the message is specified inside the message itselfChannelNotConnectedException
ChannelClosedException
public void send(Address dst, Address src, Serializable obj) throws ChannelNotConnectedException, ChannelClosedException
send
in class Channel
dst
- - the destination address of the message, null for all memberssrc
- - the source address of the messageobj
- - the value of the messageChannelNotConnectedException
ChannelClosedException
send(org.jgroups.Message)
public void send(Address dst, Address src, byte[] buf) throws ChannelNotConnectedException, ChannelClosedException
send
in class Channel
ChannelNotConnectedException
ChannelClosedException
public void send(Address dst, Address src, byte[] buf, int offset, int length) throws ChannelNotConnectedException, ChannelClosedException
send
in class Channel
ChannelNotConnectedException
ChannelClosedException
public Object receive(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException
Receiver
insteadreceive
in interface Transport
receive
in class Channel
timeout
- the number of milliseconds to wait if the receive queue is empty. 0 means wait foreverTimeoutException
- if a timeout occured prior to a new message was receivedChannelNotConnectedException
ChannelClosedException
peek(long)
public Object peek(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException
Receiver
insteadpeek
in class Channel
timeout
- Value in milliseconds. Value <= 0 means wait foreverChannelNotConnectedException
- 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.Channel.receive(long)
public View getView()
public String getViewAsString()
public static String getVersion()
@Deprecated public Address getLocalAddress()
Channel
send()
operation.getLocalAddress
in class Channel
public Address getAddress()
getAddress
in class Channel
public String getAddressAsString()
public String getAddressAsUUID()
public String getName()
Channel
public String getName(Address member)
Channel
public void setName(String name)
public String getChannelName()
getClusterName()
insteadgetChannelName
in class Channel
public String getClusterName()
Channel
connect()
. Calling this method on a closed
channel returns null
.getClusterName
in class Channel
public AddressGenerator getAddressGenerator()
AddressGenerator
, or null if none is setpublic void setAddressGenerator(AddressGenerator address_generator)
AddressGenerator
. New addresses will be generated using the new generator. This
should not be done while a channel is connected, but before connecting.address_generator
- public void setOpt(int option, Object value)
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
public Object getOpt(int option)
getOpt
in class Channel
option
- the option you want to see the value forsetOpt(int, java.lang.Object)
public void blockOk()
MembershipListener
or
BlockEvent
received from call to receive()
).
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.public boolean getState(Address target, long timeout) throws ChannelNotConnectedException, ChannelClosedException
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.
getState
in class Channel
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
receivedChannelNotConnectedException
- 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
flushedExtendedMessageListener.getState(OutputStream)
,
ExtendedMessageListener.setState(InputStream)
,
MessageListener.getState()
,
MessageListener.setState(byte[])
public boolean getState(Address target, String state_id, long timeout) throws ChannelNotConnectedException, ChannelClosedException
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.
getState
in class Channel
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
receivedChannelNotConnectedException
- 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
flushedExtendedMessageListener.getState(OutputStream)
,
ExtendedMessageListener.setState(InputStream)
,
MessageListener.getState()
,
MessageListener.setState(byte[])
public boolean getState(Address target, String state_id, long timeout, boolean useFlushIfPresent) throws ChannelNotConnectedException, ChannelClosedException
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.
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 retrievalChannelNotConnectedException
- 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
flushedExtendedMessageListener.getState(OutputStream)
,
ExtendedMessageListener.setState(InputStream)
,
MessageListener.getState()
,
MessageListener.setState(byte[])
protected boolean getState(Address target, String state_id, long timeout, Callable<Boolean> flushInvoker) throws ChannelNotConnectedException, ChannelClosedException
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.
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 flushChannelNotConnectedException
- 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
flushedExtendedMessageListener.getState(OutputStream)
,
ExtendedMessageListener.setState(InputStream)
,
MessageListener.getState()
,
MessageListener.setState(byte[])
public boolean getAllStates(Vector targets, long timeout) throws ChannelNotConnectedException, ChannelClosedException
getState(org.jgroups.Address, long)
insteadtimeout
milliseconds have elapsed. The argument of GET_STATE_OK should be a vector of objects.getAllStates
in class Channel
targets
- - the target members to receive the state from ( an Address list )timeout
- - the number of milliseconds to wait for the operation to complete successfullyChannelNotConnectedException
- 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.public void returnState(byte[] state)
getState()
object when
calling receive()
.
When the application receives a getState() message on the receive() method,
it should call returnState() to reply with the state of the applicationreturnState
in class Channel
state
- The state of the application as a byte buffer
(to send over the network).public void returnState(byte[] state, String state_id)
returnState
in class Channel
state
- state_id
- public Object up(Event evt)
Receive
s will dequeue it.evt
- the event carrying the message from the protocol stackpublic void down(Event evt)
public Object downcall(Event evt)
Channel
public String toString(boolean details)
protected final void init(ProtocolStackConfigurator configurator) throws ChannelException
ChannelException
protected final void init(JChannel ch) throws ChannelException
ChannelException
protected void setAddress()
protected void checkClosed() throws ChannelClosedException
ChannelClosedException
protected void checkClosedOrNotConnected() throws ChannelNotConnectedException, ChannelClosedException
protected void _close(boolean disconnect, boolean close_mq)
this.disconnect
if the disconnect parameter is true
Queue.close
on mq if the close_mq parameter is true
ProtocolStack.stop
on the protocol stack
ProtocolStack.destroy
on the protocol stack
protected void stopStack(boolean stop, boolean destroy)
public final void closeMessageQueue(boolean flush_entries)
public boolean flushSupported()
flushSupported
in class Channel
public boolean startFlush(boolean automatic_resume)
stopFlush()
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.
startFlush
in class Channel
automatic_resume
- Call stopFlush()
after the flushpublic boolean startFlush(List<Address> flushParticipants, boolean automatic_resume)
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.
startFlush
in class Channel
automatic_resume
- Call stopFlush()
after the flushpublic boolean startFlush(long timeout, boolean automatic_resume)
stopFlush()
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.
startFlush
in class Channel
timeout
- automatic_resume
- Call stopFlush()
after the flushCopyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.