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


Java ActiveMQBuffer.readInt方法代码示例

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


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

示例1: streamReadLong

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static long streamReadLong(ActiveMQBuffer buff) {
   byte type = buff.readByte();
   switch (type) {
      case DataConstants.BYTE:
         return buff.readByte();
      case DataConstants.SHORT:
         return buff.readShort();
      case DataConstants.INT:
         return buff.readInt();
      case DataConstants.LONG:
         return buff.readLong();
      case DataConstants.STRING:
         String s = buff.readNullableString();
         return Long.parseLong(s);
      default:
         throw new IllegalStateException("Invalid conversion");
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:StreamMessageUtil.java

示例2: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
   fileId = buffer.readLong();
   switch (FileType.getFileType(buffer.readByte())) {
      case JOURNAL: {
         journalType = AbstractJournalStorageManager.JournalContent.getType(buffer.readByte());
         fileType = FileType.JOURNAL;
         break;
      }
      case PAGE: {
         pageStoreName = buffer.readSimpleString();
         fileType = FileType.PAGE;
         break;
      }
      case LARGE_MESSAGE: {
         fileType = FileType.LARGE_MESSAGE;
         break;
      }
   }
   int size = buffer.readInt();
   if (size > 0) {
      byteArray = new byte[size];
      buffer.readBytes(byteArray);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:26,代码来源:ReplicationSyncFileMessage.java

示例3: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
   int size = buffer.readInt();
   body = new byte[size];
   buffer.readBytes(body);
   continues = buffer.readBoolean();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:8,代码来源:SessionContinuationMessage.java

示例4: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
   name = buffer.readString();
   sessionChannelID = buffer.readLong();
   version = buffer.readInt();
   username = buffer.readNullableString();
   password = buffer.readNullableString();
   minLargeMessageSize = buffer.readInt();
   xa = buffer.readBoolean();
   autoCommitSends = buffer.readBoolean();
   autoCommitAcks = buffer.readBoolean();
   windowSize = buffer.readInt();
   preAcknowledge = buffer.readBoolean();
   defaultAddress = buffer.readNullableString();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:16,代码来源:CreateSessionMessage.java

示例5: decodeRest

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

示例6: readNullableInteger

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static Integer readNullableInteger(ActiveMQBuffer buffer) {
   boolean isNotNull = buffer.readBoolean();

   if (isNotNull) {
      return buffer.readInt();
   } else {
      return null;
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:BufferHelper.java

示例7: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(ActiveMQBuffer buffer) {
   super.decodeRest(buffer);
   backupSize = buffer.readInt();
   journalDirectory = buffer.readNullableString();
   bindingsDirectory = buffer.readNullableString();
   largeMessagesDirectory = buffer.readNullableString();
   pagingDirectory = buffer.readNullableString();
   nodeID = buffer.readNullableSimpleString();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:11,代码来源:BackupRequestMessage.java

示例8: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
   messageId = buffer.readLong();
   int size = buffer.readInt();
   body = new byte[size];
   buffer.readBytes(body);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:8,代码来源:ReplicationLargeMessageWriteMessage.java

示例9: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
   exists = buffer.readBoolean();
   int numQueues = buffer.readInt();
   queueNames = new ArrayList<>(numQueues);
   for (int i = 0; i < numQueues; i++) {
      queueNames.add(buffer.readSimpleString());
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:SessionBindingQueryResponseMessage.java

示例10: read

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
private int read(StorageManager storage, ActiveMQBuffer fileBuffer, List<PagedMessage> messages) {
   int readMessages = 0;
   while (fileBuffer.readable()) {
      final int position = fileBuffer.readerIndex();

      byte byteRead = fileBuffer.readByte();

      if (byteRead == Page.START_BYTE) {
         if (fileBuffer.readerIndex() + DataConstants.SIZE_INT < fileBuffer.capacity()) {
            int messageSize = fileBuffer.readInt();
            int oldPos = fileBuffer.readerIndex();
            if (fileBuffer.readerIndex() + messageSize < fileBuffer.capacity() && fileBuffer.getByte(oldPos + messageSize) == Page.END_BYTE) {
               PagedMessage msg = new PagedMessageImpl(storageManager);
               msg.decode(fileBuffer);
               byte b = fileBuffer.readByte();
               if (b != Page.END_BYTE) {
                  // Sanity Check: This would only happen if there is a bug on decode or any internal code, as
                  // this
                  // constraint was already checked
                  throw new IllegalStateException("Internal error, it wasn't possible to locate END_BYTE " + b);
               }
               msg.initMessage(storage);
               if (logger.isTraceEnabled()) {
                  logger.trace("Reading message " + msg + " on pageId=" + this.pageId + " for address=" + storeName);
               }
               readMessages++;
               messages.add(msg);
            } else {
               markFileAsSuspect(file.getFileName(), position, messages.size());
               break;
            }
         }
      } else {
         markFileAsSuspect(file.getFileName(), position, messages.size());
         break;
      }
   }
   return readMessages;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:40,代码来源:Page.java

示例11: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
   synchronizationIsFinished = buffer.readBoolean();
   allowsAutoFailBack = buffer.readBoolean();
   nodeID = buffer.readString();
   if (synchronizationIsFinished) {
      return;
   }
   dataType = SyncDataType.getDataType(buffer.readByte());
   int length = buffer.readInt();
   ids = new long[length];
   for (int i = 0; i < length; i++) {
      ids[i] = buffer.readLong();
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:16,代码来源:ReplicationStartSyncMessage.java

示例12: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
   name = buffer.readString();
   lastConfirmedCommandID = buffer.readInt();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:6,代码来源:ReattachSessionMessage.java

示例13: readControlFile

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static SequentialFile readControlFile(final SequentialFileFactory fileFactory,
                                             final List<String> dataFiles,
                                             final List<String> newFiles,
                                             final List<Pair<String, String>> renameFile) throws Exception {
   SequentialFile controlFile = fileFactory.createSequentialFile(AbstractJournalUpdateTask.FILE_COMPACT_CONTROL);

   if (controlFile.exists()) {
      JournalFile file = new JournalFileImpl(controlFile, 0, JournalImpl.FORMAT_VERSION);

      final ArrayList<RecordInfo> records = new ArrayList<>();


      JournalImpl.readJournalFile(fileFactory, file, new JournalReaderCallbackAbstract() {
         @Override
         public void onReadAddRecord(final RecordInfo info) throws Exception {
            records.add(info);
         }
      });

      if (records.size() == 0) {
         // the record is damaged
         controlFile.delete();
         return null;
      } else {
         ActiveMQBuffer input = ActiveMQBuffers.wrappedBuffer(records.get(0).data);

         int numberDataFiles = input.readInt();

         for (int i = 0; i < numberDataFiles; i++) {
            dataFiles.add(input.readUTF());
         }

         int numberNewFiles = input.readInt();

         for (int i = 0; i < numberNewFiles; i++) {
            newFiles.add(input.readUTF());
         }

         int numberRenames = input.readInt();
         for (int i = 0; i < numberRenames; i++) {
            String from = input.readUTF();
            String to = input.readUTF();
            renameFile.add(new Pair<>(from, to));
         }

      }

      return controlFile;
   } else {
      return null;
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:53,代码来源:AbstractJournalUpdateTask.java

示例14: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
   commandID = buffer.readInt();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:5,代码来源:PacketsConfirmedMessage.java

示例15: decodeRest

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
   timeoutSeconds = buffer.readInt();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:5,代码来源:SessionXASetTimeoutMessage.java


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