本文整理了Java中org.jgroups.Message.writeToNoAddrs()
方法的一些代码示例,展示了Message.writeToNoAddrs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.writeToNoAddrs()
方法的具体详情如下:
包路径:org.jgroups.Message
类名称:Message
方法名:writeToNoAddrs
[英]Writes the message to the output stream, but excludes the dest and src addresses unless the src address given as argument is different from the message's src address
[中]将消息写入输出流,但不包括dest和src地址,除非作为参数给出的src地址与消息的src地址不同
代码示例来源:origin: wildfly/wildfly
/**
* Write a list of messages with the *same* destination and src addresses. The message list is
* marshalled as follows (see doc/design/MarshallingFormat.txt for details):
* <pre>
* List: * | version | flags | dest | src | cluster-name | [Message*] |
*
* Message: | presence | leading | flags | [src] | length | [buffer] | size | [Headers*] |
*
* </pre>
* @param dest
* @param src
* @param msgs
* @param dos
* @param multicast
* @throws Exception
*/
public static void writeMessageList(Address dest, Address src, byte[] cluster_name,
List<Message> msgs, DataOutput dos, boolean multicast, short transport_id) throws Exception {
writeMessageListHeader(dest, src, cluster_name, msgs != null ? msgs.size() : 0, dos, multicast);
if(msgs != null)
for(Message msg: msgs)
msg.writeToNoAddrs(src, dos, transport_id); // exclude the transport header
}
代码示例来源:origin: wildfly/wildfly
protected int marshalMessagesToSameDestination(Address dest, Message[] buf, final int start_index, final int end_index,
int max_bundle_size) throws Exception {
int num_msgs=0, bytes=0;
for(int i=start_index; i != end_index; i=increment(i)) {
Message msg=buf[i];
if(msg != null && msg != NULL_MSG && Objects.equals(dest, msg.dest())) {
long msg_size=msg.size();
if(bytes + msg_size > max_bundle_size)
break;
bytes+=msg_size;
num_msgs++;
buf[i]=NULL_MSG;
msg.writeToNoAddrs(msg.src(), output, transport.getId());
}
}
return num_msgs;
}
代码示例来源:origin: wildfly/wildfly
protected int marshalMessagesToSameDestination(Address dest, Message[] buf,
int start_index, final int end_index, int max_bundle_size) throws Exception {
int num_msgs=0, bytes=0;
for(;;) {
Message msg=buf[start_index];
if(msg != null && Objects.equals(dest, msg.dest())) {
long size=msg.size();
if(bytes + size > max_bundle_size)
break;
bytes+=size;
num_msgs++;
buf[start_index]=null;
msg.writeToNoAddrs(msg.src(), output, transport.getId());
}
if(start_index == end_index)
break;
start_index=advance(start_index);
}
return num_msgs;
}
代码示例来源:origin: wildfly/wildfly
protected int marshalMessagesToSameDestination(Address dest, Message[] buf,
int start_index, int available_msgs, int max_bundle_size) throws Exception {
int num_msgs=0, bytes=0;
while(available_msgs > 0) {
Message msg=buf[start_index];
if(msg != null && Objects.equals(dest, msg.dest())) {
long msg_size=msg.size();
if(bytes + msg_size > max_bundle_size)
break;
bytes+=msg_size;
num_msgs++;
buf[start_index]=null;
msg.writeToNoAddrs(msg.src(), output, transport.getId());
}
available_msgs--;
start_index=increment(start_index);
}
return num_msgs;
}
代码示例来源:origin: wildfly/wildfly
msg.writeToNoAddrs(msg.getSrc(), output, transport.getId());
msg_queue[i]=null;
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Write a list of messages with the *same* destination and src addresses. The message list is
* marshalled as follows (see doc/design/MarshallingFormat.txt for details):
* <pre>
* List: * | version | flags | dest | src | cluster-name | [Message*] |
*
* Message: | presence | leading | flags | [src] | length | [buffer] | size | [Headers*] |
*
* </pre>
* @param dest
* @param src
* @param msgs
* @param dos
* @param multicast
* @throws Exception
*/
public static void writeMessageList(Address dest, Address src, byte[] cluster_name,
List<Message> msgs, DataOutput dos, boolean multicast, short transport_id) throws Exception {
writeMessageListHeader(dest, src, cluster_name, msgs != null ? msgs.size() : 0, dos, multicast);
if(msgs != null)
for(Message msg: msgs)
msg.writeToNoAddrs(src, dos, transport_id); // exclude the transport header
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
protected int marshalMessagesToSameDestination(Address dest, Message[] buf, final int start_index, final int end_index,
int max_bundle_size) throws Exception {
int num_msgs=0, bytes=0;
for(int i=start_index; i != end_index; i=increment(i)) {
Message msg=buf[i];
if(msg != null && msg != NULL_MSG && Objects.equals(dest, msg.dest())) {
long msg_size=msg.size();
if(bytes + msg_size > max_bundle_size)
break;
bytes+=msg_size;
num_msgs++;
buf[i]=NULL_MSG;
msg.writeToNoAddrs(msg.src(), output, transport.getId());
}
}
return num_msgs;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
protected int marshalMessagesToSameDestination(Address dest, Message[] buf,
int start_index, int available_msgs, int max_bundle_size) throws Exception {
int num_msgs=0, bytes=0;
while(available_msgs > 0) {
Message msg=buf[start_index];
if(msg != null && Objects.equals(dest, msg.dest())) {
long msg_size=msg.size();
if(bytes + msg_size > max_bundle_size)
break;
bytes+=msg_size;
num_msgs++;
buf[start_index]=null;
msg.writeToNoAddrs(msg.src(), output, transport.getId());
}
available_msgs--;
start_index=increment(start_index);
}
return num_msgs;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
protected int marshalMessagesToSameDestination(Address dest, Message[] buf,
int start_index, final int end_index, int max_bundle_size) throws Exception {
int num_msgs=0, bytes=0;
for(;;) {
Message msg=buf[start_index];
if(msg != null && Objects.equals(dest, msg.dest())) {
long size=msg.size();
if(bytes + size > max_bundle_size)
break;
bytes+=size;
num_msgs++;
buf[start_index]=null;
msg.writeToNoAddrs(msg.src(), output, transport.getId());
}
if(start_index == end_index)
break;
start_index=advance(start_index);
}
return num_msgs;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
msg.writeToNoAddrs(msg.getSrc(), output, transport.getId());
msg_queue[i]=null;
内容来源于网络,如有侵权,请联系作者删除!