private Map properties = new HashMap();
private int channelSendOptions = Channel.SEND_OPTIONS_ASYNCHRONOUS;
+
+ private int channelStartOptions = Channel.DEFAULT;
// ------------------------------------------------------------- Properties
registerClusterValve();
channel.addMembershipListener(this);
channel.addChannelListener(this);
- channel.start(channel.DEFAULT);
+ channel.start(channelStartOptions);
if (clusterDeployer != null) clusterDeployer.start();
this.started = true;
//register JMX objects
this.managers.clear();
try {
if ( clusterDeployer != null ) clusterDeployer.setCluster(null);
- channel.stop(Channel.DEFAULT);
+ channel.stop(channelStartOptions);
channel.removeChannelListener(this);
channel.removeMembershipListener(this);
this.unregisterClusterValve();
public String getProtocol() {
return null;
}
+
+ public int getChannelStartOptions() {
+ return channelStartOptions;
+ }
+
+ public void setChannelStartOptions(int channelStartOptions) {
+ this.channelStartOptions = channelStartOptions;
+ }
}
If a value smaller or equal to 0 is presented, the code will default this value to frequency
</p>
</attribute>
+ <attribute name="recoveryEnabled" required="false">
+ <p>
+ In case of a network failure, Java multicast socket don't transparently fail over, instead the socket will continously
+ throw IOException upon each receive request. When recoveryEnabled is set to true, this will close the multicast socket
+ and open a new socket with the same properties as defined above.<br/>
+ The default is <code>true</code>. <br/>
+ </p>
+ </attribute>
+ <attribute name="recoveryCounter" required="false">
+ <p>
+ When <code>recoveryEnabled==true</code> this value indicates how many times we will try recovery.
+ The default is <code>10</code>. <br/>
+ </p>
+ </attribute>
+ <attribute name="recoverySleepTime" required="false">
+ <p>
+ When <code>recoveryEnabled==true</code> this value indicates how long time (in milliseconds)
+ the system will sleep in between recovery attempts, until we either recovered successfully or we have reached the
+ recoveryCounter limit.
+ The default is <code>5000</code> (5 seconds). <br/>
+ </p>
+ </attribute>
</attributes>
The send buffer size on the datagram socket.
Default value is <code>43800</code> bytes.
</attribute>
- <attribute name="direct" required="false">
+ <attribute name="directBuffer" required="false">
Possible values are <code>true</code> or <code>false</code>.
- Set to true if you want the receiver to use direct bytebuffers when reading data
- from the sockets. Default value is <code>false</code>
+ Set to true if you want the receiver to use direct bytebuffers when writing data
+ to the sockets. Default value is <code>false</code>
</attribute>
<attribute name="keepAliveCount" required="false">
The number of requests that can go through the socket before the socket is closed, and reopened
</attribute>
<attribute name="timeout" required="false">
Sets the SO_TIMEOUT option on the socket. The value is in milliseconds and the default value is <code>3000</code>
- milliseconds.
+ milliseconds.(3 seconds) This timeout starts when a message send attempt is starting, until the transfer has been completed.
+ For the NIO sockets, this will mean, that the caller can guarantee that we will not attempt sending the message
+ longer than this timeout value. For the blocking IO implementation, this translated directly to the soTimeout.<br/>
+ A timeout will not spawn a retry attempt, in order to guarantee the return of the application thread.
</attribute>
<attribute name="maxRetryAttempts" required="false">
How many times do we retry a failed message, that received a IOException at the socket level.
So to use ACK and ASYNC messaging, the flag would be <code>10 (8+2) or 0x000B</code><br/>
</p>
</attribute>
+ <attribute name="channelStartOptions" required="false">
+ <p>Sets the start and stop flags for the <Channel> object used by the cluster.
+ The default is <code>Channel.DEFAULT</code> which starts all the channel services, such as
+ sender, receiver, multicast sender and multicast receiver.
+ The following flags are available today:
+ <source>
+ Channel.DEFAULT = Channel.SND_RX_SEQ (1)| Channel.SND_TX_SEQ (2)| Channel.MBR_RX_SEQ (4)| Channel.MBR_TX_SEQ (8);
+ </source>
+ To start a channel without multicasting, you would want to use the value <code>Channel.SND_RX_SEQ | Channel.SND_TX_SEQ</code>
+ that equals to <code>3</code>.
+ </p>
+ </attribute>
<attribute name="heartbeatBackgroundEnabled" required="false">
<p>Enable this flag don't forget to disable the channel heartbeat thread.