本文整理了Java中org.jgroups.JChannel.startFlush()
方法的一些代码示例,展示了JChannel.startFlush()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JChannel.startFlush()
方法的具体详情如下:
包路径:org.jgroups.JChannel
类名称:JChannel
方法名:startFlush
[英]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 until #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.
[中]将执行系统刷新,即所有待处理的消息都将刷新出系统,所有成员都将确认其接收。此调用返回后,在调用#stopFlush()之前,任何成员都不会发送任何消息。
在刷新冲突的情况下,使用随机睡眠时间退避算法,并重新尝试刷新次数。因此,该方法保证在超时x numberoft毫秒后返回。
代码示例来源:origin: wildfly/wildfly
/**
* Performs the flush of the cluster but only for the specified flush participants.
*
* All pending messages are flushed out but only for the flush participants. The remaining
* members in the cluster are not included in the flush. The list of flush participants should be
* a proper subset of the current view.
*
* If this flush is not automatically resumed it is an obligation of the application to invoke
* the matching {@link #stopFlush(List)} method with the same list of members used in
* {@link #startFlush(List, boolean)}.
*
* @param automatic_resume
* if true call {@link #stopFlush()} after the flush
* @see #startFlush(boolean)
* @see Util#startFlush(Channel, List, int, long, long)
*/
public void startFlush(List flushParticipants, boolean automatic_resume) throws Exception {
ch.startFlush(flushParticipants, automatic_resume);
}
代码示例来源:origin: wildfly/wildfly
/**
* Performs the flush of the cluster, ie. all pending application messages are flushed out of the cluster and
* all members ack their reception. After this call returns, no member will be allowed to send any
* messages until {@link #stopFlush()} is called.
*
* In the case of flush collisions (another member attempts flush at roughly the same time) start flush will
* fail by throwing an Exception. Applications can re-attempt flushing after certain back-off period.
*
* JGroups provides a helper random sleep time backoff algorithm for flush using Util class.
*
* @param automatic_resume
* if true call {@link #stopFlush()} after the flush
*
* @see Util#startFlush(Channel, List, int, long, long)
*/
public void startFlush(boolean automatic_resume) throws Exception {
ch.startFlush(automatic_resume);
}
代码示例来源:origin: wildfly/wildfly
/**
* Performs the flush of the given channel within the specfied number of attempts along with random
* sleep time after each such attempt.
* @param c the channel
* @param numberOfAttempts the number of flush attempts
* @param randomSleepTimeoutFloor the minimum sleep time between attempts in ms
* @param randomSleepTimeoutCeiling the maximum sleep time between attempts in ms
* @return true if channel was flushed successfully, false otherwise
* @see JChannel#startFlush(boolean)
*/
public static boolean startFlush(JChannel c,int numberOfAttempts,long randomSleepTimeoutFloor,long randomSleepTimeoutCeiling) {
int attemptCount=0;
while(attemptCount
c.startFlush(false);
return true;
}
catch(Exception e) {
Util.sleepRandom(randomSleepTimeoutFloor,randomSleepTimeoutCeiling);
attemptCount++;
}
}
return false;
}
代码示例来源:origin: wildfly/wildfly
/**
* Performs the flush of the given channel for the specified flush participants and the given
* number of attempts along with random sleep time after each such attempt.
* @param c the channel
* @param flushParticipants the flush participants in this flush attempt
* @param numberOfAttempts the number of flush attempts
* @param randomSleepTimeoutFloor the minimum sleep time between attempts in ms
* @param randomSleepTimeoutCeiling the maximum sleep time between attempts in ms
* @return true if channel was flushed successfully, false otherwise
* @see JChannel#startFlush(List,boolean)
*/
public static boolean startFlush(JChannel c,List flushParticipants,
int numberOfAttempts,long randomSleepTimeoutFloor,long randomSleepTimeoutCeiling) {
int attemptCount=0;
while(attemptCount
c.startFlush(flushParticipants,false);
return true;
}
catch(Exception e) {
Util.sleepRandom(randomSleepTimeoutFloor,randomSleepTimeoutCeiling);
attemptCount++;
}
}
return false;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Performs the flush of the cluster, ie. all pending application messages are flushed out of the cluster and
* all members ack their reception. After this call returns, no member will be allowed to send any
* messages until {@link #stopFlush()} is called.
*
* In the case of flush collisions (another member attempts flush at roughly the same time) start flush will
* fail by throwing an Exception. Applications can re-attempt flushing after certain back-off period.
*
* JGroups provides a helper random sleep time backoff algorithm for flush using Util class.
*
* @param automatic_resume
* if true call {@link #stopFlush()} after the flush
*
* @see Util#startFlush(Channel, List, int, long, long)
*/
public void startFlush(boolean automatic_resume) throws Exception {
ch.startFlush(automatic_resume);
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Performs the flush of the cluster but only for the specified flush participants.
*
* All pending messages are flushed out but only for the flush participants. The remaining
* members in the cluster are not included in the flush. The list of flush participants should be
* a proper subset of the current view.
*
* If this flush is not automatically resumed it is an obligation of the application to invoke
* the matching {@link #stopFlush(List)} method with the same list of members used in
* {@link #startFlush(List, boolean)}.
*
* @param automatic_resume
* if true call {@link #stopFlush()} after the flush
* @see #startFlush(boolean)
* @see Util#startFlush(Channel, List, int, long, long)
*/
public void startFlush(List flushParticipants, boolean automatic_resume) throws Exception {
ch.startFlush(flushParticipants, automatic_resume);
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Performs the flush of the given channel within the specfied number of attempts along with random
* sleep time after each such attempt.
* @param c the channel
* @param numberOfAttempts the number of flush attempts
* @param randomSleepTimeoutFloor the minimum sleep time between attempts in ms
* @param randomSleepTimeoutCeiling the maximum sleep time between attempts in ms
* @return true if channel was flushed successfully, false otherwise
* @see JChannel#startFlush(boolean)
*/
public static boolean startFlush(JChannel c,int numberOfAttempts,long randomSleepTimeoutFloor,long randomSleepTimeoutCeiling) {
int attemptCount=0;
while(attemptCount
c.startFlush(false);
return true;
}
catch(Exception e) {
Util.sleepRandom(randomSleepTimeoutFloor,randomSleepTimeoutCeiling);
attemptCount++;
}
}
return false;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Performs the flush of the given channel for the specified flush participants and the given
* number of attempts along with random sleep time after each such attempt.
* @param c the channel
* @param flushParticipants the flush participants in this flush attempt
* @param numberOfAttempts the number of flush attempts
* @param randomSleepTimeoutFloor the minimum sleep time between attempts in ms
* @param randomSleepTimeoutCeiling the maximum sleep time between attempts in ms
* @return true if channel was flushed successfully, false otherwise
* @see JChannel#startFlush(List,boolean)
*/
public static boolean startFlush(JChannel c,List flushParticipants,
int numberOfAttempts,long randomSleepTimeoutFloor,long randomSleepTimeoutCeiling) {
int attemptCount=0;
while(attemptCount
c.startFlush(flushParticipants,false);
return true;
}
catch(Exception e) {
Util.sleepRandom(randomSleepTimeoutFloor,randomSleepTimeoutCeiling);
attemptCount++;
}
}
return false;
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
try {
if(entry.channel.flushSupported()){
boolean successfulFlush = entry.channel.startFlush(3000, false);
if(!successfulFlush && log.isWarnEnabled()){
log.warn("Flush failed at " + ch.getLocalAddress() + ch.getId());
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
try {
if(entry.channel.flushSupported()){
boolean successfulFlush = entry.channel.startFlush(3000, false);
if(!successfulFlush && log.isWarnEnabled()){
log.warn("Flush failed at " + ch.getLocalAddress() + ch.getId());
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
try {
if(entry.channel.flushSupported()){
boolean successfulFlush = entry.channel.startFlush(3000, false);
if(!successfulFlush && log.isWarnEnabled()){
log.warn("Flush failed at " + ch.getLocalAddress() + ch.getId());
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
Address addr=entry.channel.getLocalAddress();
if(entry.channel.flushSupported()){
boolean successfulFlush = entry.channel.startFlush(3000, false);
if(!successfulFlush && log.isWarnEnabled()){
log.warn("Flush failed at " + ch.getLocalAddress() + " " + ch.getId());