项目:tomcat7
文件:SimpleTcpCluster.java
/**
* send a cluster message to one member
*
* @param msg message to transfer
* @param dest Receiver member
* @see org.apache.catalina.ha.CatalinaCluster#send(org.apache.catalina.ha.ClusterMessage,* org.apache.catalina.tribes.Member)
*/
@Override
public void send(ClusterMessage msg,Member dest) {
try {
msg.setAddress(getLocalMember());
int sendOptions = channelSendOptions;
if (msg instanceof SessionMessage
&& ((SessionMessage)msg).getEventType() == SessionMessage.EVT_ALL_SESSION_DATA) {
sendOptions = Channel.SEND_OPTIONS_SYNCHRONIZED_ACK|Channel.SEND_OPTIONS_USE_ACK;
}
if (dest != null) {
if (!getLocalMember().equals(dest)) {
channel.send(new Member[] {dest},msg,sendOptions);
} else
log.error("Unable to send message to local member " + msg);
} else {
Member[] destmembers = channel.getMembers();
if (destmembers.length>0)
channel.send(destmembers,sendOptions);
else if (log.isDebugEnabled())
log.debug("No members in cluster,ignoring message:"+msg);
}
} catch (Exception x) {
log.error("Unable to send message through cluster sender.",x);
}
}
项目:apache-tomcat-7.0.73-with-comment
文件:SimpleTcpCluster.java
项目:lazycat
文件:SimpleTcpCluster.java
/**
* send a cluster message to one member
*
* @param msg
* message to transfer
* @param dest
* Receiver member
* @see org.apache.catalina.ha.CatalinaCluster#send(org.apache.catalina.ha.ClusterMessage,Member dest) {
try {
msg.setAddress(getLocalMember());
int sendOptions = channelSendOptions;
if (msg instanceof SessionMessage
&& ((SessionMessage) msg).getEventType() == SessionMessage.EVT_ALL_SESSION_DATA) {
sendOptions = Channel.SEND_OPTIONS_SYNCHRONIZED_ACK | Channel.SEND_OPTIONS_USE_ACK;
}
if (dest != null) {
if (!getLocalMember().equals(dest)) {
channel.send(new Member[] { dest },sendOptions);
} else
log.error("Unable to send message to local member " + msg);
} else {
Member[] destmembers = channel.getMembers();
if (destmembers.length > 0)
channel.send(destmembers,sendOptions);
else if (log.isDebugEnabled())
log.debug("No members in cluster,ignoring message:" + msg);
}
} catch (Exception x) {
log.error("Unable to send message through cluster sender.",x);
}
}
项目:class-guard
文件:SimpleTcpCluster.java
项目:apache-tomcat-7.0.57
文件:SimpleTcpCluster.java
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。