当前位置: 首页>>代码示例>>Java>>正文


Java ActiveMQBuffer.writeByte方法代码示例

本文整理汇总了Java中org.apache.activemq.artemis.api.core.ActiveMQBuffer.writeByte方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQBuffer.writeByte方法的具体用法?Java ActiveMQBuffer.writeByte怎么用?Java ActiveMQBuffer.writeByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.activemq.artemis.api.core.ActiveMQBuffer的用法示例。


在下文中一共展示了ActiveMQBuffer.writeByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: encode

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encode(final ActiveMQBuffer buffer) {
   if (txRecordType == TX_RECORD_TYPE.COMMIT) {
      buffer.writeByte(JournalImpl.COMMIT_RECORD);
   } else {
      buffer.writeByte(JournalImpl.PREPARE_RECORD);
   }

   buffer.writeInt(fileID);

   buffer.writeByte(compactCount);

   buffer.writeLong(txID);

   buffer.writeInt(numberOfRecords);

   if (transactionData != null) {
      buffer.writeInt(transactionData.getEncodeSize());
   }

   if (transactionData != null) {
      transactionData.encode(buffer);
   }

   buffer.writeInt(getEncodeSize());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:27,代码来源:JournalCompleteRecordTX.java

示例2: testCloneFile

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Test
public void testCloneFile() throws Exception {
   JDBCSequentialFile file = (JDBCSequentialFile) factory.createSequentialFile("test.txt");
   file.open();

   // Create buffer and fill with test data
   int bufferSize = 1024;
   ActiveMQBuffer src = ActiveMQBuffers.fixedBuffer(bufferSize);
   for (int i = 0; i < bufferSize; i++) {
      src.writeByte((byte) 5);
   }

   IOCallbackCountdown callback = new IOCallbackCountdown(1);
   file.internalWrite(src, callback);

   assertEquals(bufferSize, file.size());
   JDBCSequentialFile copy = (JDBCSequentialFile) file.cloneFile();
   copy.open();

   assertEquals(bufferSize, copy.size());
   assertEquals(bufferSize, file.size());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:23,代码来源:JDBCSequentialFileFactoryTest.java

示例3: randomBuffer

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static ActiveMQBuffer randomBuffer(final int size, final long... data) {
   ActiveMQBuffer buffer = ActiveMQBuffers.fixedBuffer(size + 8 * data.length);

   for (long d : data) {
      buffer.writeLong(d);
   }

   for (int i = 0; i < size; i++) {
      buffer.writeByte(randomByte());
   }

   return buffer;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:14,代码来源:RandomUtil.java

示例4: encode

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encode(ActiveMQBuffer buffer) {
   buffer.writeByte(type.getType());
   BufferHelper.writeAsSimpleString(buffer, name);
   buffer.writeInt(bindings.size());
   for (String bindingsEl : bindings) {
      BufferHelper.writeAsSimpleString(buffer, bindingsEl);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:PersistedBindings.java

示例5: encode

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encode(final ActiveMQBuffer buffer) {
   buffer.writeByte(type.getType());
   buffer.writeSimpleString(SimpleString.toSimpleString(name));
   buffer.writeNullableSimpleString(SimpleString.toSimpleString(selector));
   buffer.writeBoolean(durable);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:8,代码来源:PersistedDestination.java

示例6: encodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
   buffer.writeLong(fileId);
   if (fileId == -1)
      return;
   buffer.writeByte(fileType.code);
   switch (fileType) {
      case JOURNAL: {
         buffer.writeByte(journalType.typeByte);
         break;
      }
      case PAGE: {
         buffer.writeSimpleString(pageStoreName);
         break;
      }
      case LARGE_MESSAGE:
      default:
         // no-op
   }

   buffer.writeInt(dataSize);
   /*
    * sending -1 will close the file in case of a journal, but not in case of a largeMessage
    * (which might receive appends)
    */
   if (dataSize > 0) {
      buffer.writeBytes(byteBuffer, 0, byteBuffer.writerIndex());
   }

   release();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:32,代码来源:ReplicationSyncFileMessage.java

示例7: 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);

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:JournalRollbackRecordTX.java

示例8: encodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
   buffer.writeByte(journalID);
   buffer.writeLong(txId);
   buffer.writeInt(encodingData.getEncodeSize());
   encodingData.encode(buffer);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:8,代码来源:ReplicationPrepareMessage.java

示例9: 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);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:12,代码来源:PersistentQueueBindingEncoding.java

示例10: encodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
   buffer.writeBoolean(synchronizationIsFinished);
   buffer.writeBoolean(allowsAutoFailBack);
   buffer.writeString(nodeID);
   if (synchronizationIsFinished)
      return;
   buffer.writeByte(dataType.code);
   buffer.writeInt(ids.length);
   for (long id : ids) {
      buffer.writeLong(id);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:14,代码来源:ReplicationStartSyncMessage.java

示例11: testCreateBuffer

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Test
public void testCreateBuffer() throws Exception {
   EmbeddedChannel channel = createChannel();
   NettyConnection conn = new NettyConnection(emptyMap, channel, new MyListener(), false, false);

   final int size = 1234;

   ActiveMQBuffer buff = conn.createTransportBuffer(size);
   buff.writeByte((byte) 0x00); // Netty buffer does lazy initialization.
   Assert.assertEquals(size, buff.capacity());

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:13,代码来源:NettyConnectionTest.java

示例12: encode

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
/** Sub classes must add the first short as the protocol-id */
@Override
public void encode(ActiveMQBuffer buffer, Message record) {
   buffer.writeByte((byte)1);
   buffer.writeLong(record.getMessageID());
   buffer.writeNullableSimpleString(record.getAddressSimpleString());
   record.persist(buffer);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:9,代码来源:CoreMessagePersister.java

示例13: encodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
   buffer.writeSimpleString(address);
   buffer.writeSimpleString(queueName);
   buffer.writeNullableSimpleString(filterString);
   buffer.writeBoolean(durable);
   buffer.writeByte(routingType.getType());
   buffer.writeBoolean(requiresResponse);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:CreateSharedQueueMessage_V2.java

示例14: encodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
   super.encodeRest(buffer);
   buffer.writeBoolean(autoCreated);
   buffer.writeBoolean(purgeOnNoConsumers);
   buffer.writeByte(routingType.getType());
   buffer.writeInt(maxConsumers);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:9,代码来源:SessionQueueQueryResponseMessage_V3.java

示例15: encodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void encodeRest(final ActiveMQBuffer buffer) {
   buffer.writeSimpleString(address);
   buffer.writeInt(routingTypes.size());
   for (RoutingType routingType : routingTypes) {
      buffer.writeByte(routingType.getType());
   }
   buffer.writeBoolean(requiresResponse);
   buffer.writeBoolean(autoCreated);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:11,代码来源:CreateAddressMessage.java


注:本文中的org.apache.activemq.artemis.api.core.ActiveMQBuffer.writeByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。