本文整理汇总了Java中org.apache.activemq.artemis.api.core.ActiveMQBuffer.writeInt方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQBuffer.writeInt方法的具体用法?Java ActiveMQBuffer.writeInt怎么用?Java ActiveMQBuffer.writeInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.artemis.api.core.ActiveMQBuffer
的用法示例。
在下文中一共展示了ActiveMQBuffer.writeInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: broadcastConnectors
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public synchronized void broadcastConnectors() throws Exception {
ActiveMQBuffer buff = ActiveMQBuffers.dynamicBuffer(4096);
buff.writeString(nodeManager.getNodeId().toString());
buff.writeString(uniqueID);
buff.writeInt(connectors.size());
for (TransportConfiguration tcConfig : connectors) {
tcConfig.encode(buff);
}
// Only send as many bytes as we need.
byte[] data = new byte[buff.readableBytes()];
buff.getBytes(buff.readerIndex(), data);
endpoint.broadcast(data);
}
示例2: encodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
buffer.writeLong(consumerID);
buffer.writeInt(deliveryCount);
buffer.writeLong(largeMessageSize);
if (message != null) {
((CoreMessage)message).encodeHeadersAndProperties(buffer.byteBuf());
}
}
示例3: encodeConfigs
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static void encodeConfigs(ActiveMQBuffer buffer,
List<Pair<TransportConfiguration, TransportConfiguration>> configs) {
buffer.writeInt(configs == null ? 0 : configs.size());
if (configs != null) {
for (Pair<TransportConfiguration, TransportConfiguration> pair : configs) {
encode(buffer, pair.getA());
boolean backup = (pair.getB() != null);
buffer.writeBoolean(backup);
if (backup) {
encode(buffer, pair.getB());
}
}
}
}
示例4: encode
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encode(final ActiveMQBuffer buffer) {
buffer.writeSimpleString(name);
buffer.writeSimpleString(address);
buffer.writeNullableSimpleString(filterString);
buffer.writeNullableSimpleString(createMetadata());
buffer.writeBoolean(autoCreated);
buffer.writeInt(maxConsumers);
buffer.writeBoolean(purgeOnNoConsumers);
buffer.writeByte(routingType);
}
示例5: encodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(ActiveMQBuffer buffer) {
super.encodeRest(buffer);
buffer.writeInt(backupSize);
buffer.writeNullableString(journalDirectory);
buffer.writeNullableString(bindingsDirectory);
buffer.writeNullableString(largeMessagesDirectory);
buffer.writeNullableString(pagingDirectory);
buffer.writeNullableSimpleString(nodeID);
}
示例6: encode
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encode(final ActiveMQBuffer buffer) {
buffer.writeByte(JournalImpl.ROLLBACK_RECORD);
buffer.writeInt(fileID);
buffer.writeByte(compactCount);
buffer.writeLong(txID);
buffer.writeInt(JournalImpl.SIZE_ROLLBACK_RECORD + 1);
}
示例7: writeHeader
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
/**
* @param buffer
* @param userVersion
* @param fileID
*/
public static void writeHeader(final ActiveMQBuffer buffer, final int userVersion, final long fileID) {
buffer.writeInt(JournalImpl.FORMAT_VERSION);
buffer.writeInt(userVersion);
buffer.writeLong(fileID);
}
示例8: encodeXid
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static void encodeXid(final Xid xid, final ActiveMQBuffer out) {
out.writeInt(xid.getFormatId());
out.writeInt(xid.getBranchQualifier().length);
out.writeBytes(xid.getBranchQualifier());
out.writeInt(xid.getGlobalTransactionId().length);
out.writeBytes(xid.getGlobalTransactionId());
}
示例9: writeNullableInteger
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
/**
* @param buffer
*/
public static void writeNullableInteger(ActiveMQBuffer buffer, Integer value) {
buffer.writeBoolean(value != null);
if (value != null) {
buffer.writeInt(value.intValue());
}
}
示例10: encodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
buffer.writeInt(credits);
buffer.writeSimpleString(address);
}
示例11: encodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
buffer.writeInt(commandID);
}
示例12: encode
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encode(final ActiveMQBuffer buffer) {
if (add) {
buffer.writeByte(JournalImpl.ADD_RECORD_TX);
} else {
buffer.writeByte(JournalImpl.UPDATE_RECORD_TX);
}
buffer.writeInt(fileID);
buffer.writeByte(compactCount);
buffer.writeLong(txID);
buffer.writeLong(id);
buffer.writeInt(persister.getEncodeSize(record));
buffer.writeByte(recordType);
persister.encode(buffer, record);
buffer.writeInt(getEncodeSize());
}
示例13: encodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
buffer.writeInt(pageNumber);
pagedMessage.encode(buffer);
}
示例14: encodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
buffer.writeString(name);
buffer.writeInt(lastConfirmedCommandID);
}
示例15: persist
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void persist(ActiveMQBuffer targetRecord) {
checkBuffer();
targetRecord.writeInt(internalPersistSize());
targetRecord.writeBytes(data.array(), 0, data.array().length );
}