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


Java ActiveMQException.getMessage方法代码示例

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


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

示例1: connectionCreated

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public void connectionCreated(final ActiveMQComponent component,
                              final Connection connection,
                              final ProtocolManager protocol) {
   if (server == null) {
      throw new IllegalStateException("Unable to create connection, server hasn't finished starting up");
   }

   ConnectionEntry entry = protocol.createConnectionEntry((Acceptor) component, connection);
   try {
      server.callBrokerPlugins(server.hasBrokerPlugins() ? plugin -> plugin.afterCreateConnection(entry.connection) : null);
   } catch (ActiveMQException t) {
      logger.warn("Error executing afterCreateConnection plugin method: {}", t.getMessage(), t);
      throw new IllegalStateException(t.getMessage(), t.getCause());

   }
   if (logger.isTraceEnabled()) {
      logger.trace("Connection created " + connection);
   }

   connections.put(connection.getID(), entry);
   connectionCountLatch.countUp();
   totalConnectionCount.incrementAndGet();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:25,代码来源:RemotingServiceImpl.java

示例2: getBodyBuffer

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public ActiveMQBuffer getBodyBuffer() {

   try {
      checkBuffer();
   } catch (ActiveMQException e) {
      throw new RuntimeException(e.getMessage(), e);
   }

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

示例3: setJMSCorrelationIDAsBytes

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public final void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException {
   try {
      MessageUtil.setJMSCorrelationIDAsBytes(message, correlationID);
   } catch (ActiveMQException e) {
      throw new JMSException(e.getMessage());
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:9,代码来源:ServerJMSMessage.java

示例4: deleteAddress

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public void deleteAddress(String name) throws Exception {
   checkStarted();

   clearIO();
   try {
      server.removeAddressInfo(new SimpleString(name), null);
   } catch (ActiveMQException e) {
      throw new IllegalStateException(e.getMessage());
   } finally {
      blockOnIO();
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:14,代码来源:ActiveMQServerControlImpl.java

示例5: listMessages

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public Map<String, Object>[] listMessages(final String filterStr) throws Exception {
   checkStarted();

   clearIO();
   try {
      Filter filter = FilterImpl.createFilter(filterStr);
      List<Map<String, Object>> messages = new ArrayList<>();
      queue.flushExecutor();
      try (LinkedListIterator<MessageReference> iterator = queue.browserIterator()) {
         try {
            while (iterator.hasNext()) {
               MessageReference ref = iterator.next();
               if (filter == null || filter.match(ref.getMessage())) {
                  Message message = ref.getMessage();
                  messages.add(message.toMap());
               }
            }
         } catch (NoSuchElementException ignored) {
            // this could happen through paging browsing
         }
         return messages.toArray(new Map[messages.size()]);
      }
   } catch (ActiveMQException e) {
      throw new IllegalStateException(e.getMessage());
   } finally {
      blockOnIO();
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:30,代码来源:QueueControlImpl.java

示例6: removeMessage

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public boolean removeMessage(final long messageID) throws Exception {
   checkStarted();

   clearIO();
   try {
      return queue.deleteReference(messageID);
   } catch (ActiveMQException e) {
      throw new IllegalStateException(e.getMessage());
   } finally {
      blockOnIO();
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:14,代码来源:QueueControlImpl.java

示例7: expireMessages

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public int expireMessages(final String filterStr) throws Exception {
   checkStarted();

   clearIO();
   try {
      Filter filter = FilterImpl.createFilter(filterStr);
      return queue.expireReferences(filter);
   } catch (ActiveMQException e) {
      throw new IllegalStateException(e.getMessage());
   } finally {
      blockOnIO();
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:15,代码来源:QueueControlImpl.java

示例8: browse

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public CompositeData[] browse(int page, int pageSize) throws Exception {
   String filter = null;
   checkStarted();

   clearIO();
   try {
      long index = 0;
      long start = (page - 1) * pageSize;
      long end = Math.min((long)(page * pageSize), queue.getMessageCount());

      ArrayList<CompositeData> c = new ArrayList<>();
      Filter thefilter = FilterImpl.createFilter(filter);
      queue.flushExecutor();

      try (LinkedListIterator<MessageReference> iterator = queue.browserIterator()) {
         try {
            while (iterator.hasNext() && index < end) {
               MessageReference ref = iterator.next();
               if (thefilter == null || thefilter.match(ref.getMessage())) {
                  if (index >= start) {
                     c.add(OpenTypeSupport.convert(ref));
                  }
               }
               index++;
            }
         } catch (NoSuchElementException ignored) {
            // this could happen through paging browsing
         }

         CompositeData[] rc = new CompositeData[c.size()];
         c.toArray(rc);
         return rc;
      }
   } catch (ActiveMQException e) {
      throw new IllegalStateException(e.getMessage());
   } finally {
      blockOnIO();
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:41,代码来源:QueueControlImpl.java

示例9: setJMSCorrelationIDAsBytes

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public void setJMSCorrelationIDAsBytes(final byte[] correlationID) throws JMSException {
   try {
      MessageUtil.setJMSCorrelationIDAsBytes(message, correlationID);
   } catch (ActiveMQException e) {
      JMSException ex = new JMSException(e.getMessage());
      ex.initCause(e);
      throw ex;
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:11,代码来源:ActiveMQMessage.java

示例10: sendMessage

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public String sendMessage(final Map<String, String> headers,
                          final int type,
                          final String body,
                          boolean durable,
                          final String user,
                          final String password) throws Exception {
   try {
      securityStore.check(addressInfo.getName(), CheckType.SEND, new SecurityAuth() {
         @Override
         public String getUsername() {
            return user;
         }

         @Override
         public String getPassword() {
            return password;
         }

         @Override
         public RemotingConnection getRemotingConnection() {
            return null;
         }
      });
      CoreMessage message = new CoreMessage(storageManager.generateID(), 50);
      if (headers != null) {
         for (String header : headers.keySet()) {
            message.putStringProperty(new SimpleString(header), new SimpleString(headers.get(header)));
         }
      }
      message.setType((byte) type);
      message.setDurable(durable);
      message.setTimestamp(System.currentTimeMillis());
      if (body != null) {
         if (type == Message.TEXT_TYPE) {
            message.getBodyBuffer().writeNullableSimpleString(new SimpleString(body));
         } else {
            message.getBodyBuffer().writeBytes(Base64.decode(body));
         }
      }
      message.setAddress(addressInfo.getName());
      postOffice.route(message, true);
      return "" + message.getMessageID();
   } catch (ActiveMQException e) {
      throw new IllegalStateException(e.getMessage());
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:48,代码来源:AddressControlImpl.java

示例11: sendMessage

import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public String sendMessage(final Map<String, String> headers,
                          final int type,
                          final String body,
                          boolean durable,
                          final String user,
                          final String password) throws Exception {
   try {
      securityStore.check(queue.getAddress(), queue.getName(), CheckType.SEND, new SecurityAuth() {
         @Override
         public String getUsername() {
            return user;
         }

         @Override
         public String getPassword() {
            return password;
         }

         @Override
         public RemotingConnection getRemotingConnection() {
            return null;
         }
      });
      CoreMessage message = new CoreMessage(storageManager.generateID(), 50);
      if (headers != null) {
         for (String header : headers.keySet()) {
            message.putStringProperty(new SimpleString(header), new SimpleString(headers.get(header)));
         }
      }
      message.setType((byte) type);
      message.setDurable(durable);
      message.setTimestamp(System.currentTimeMillis());
      if (body != null) {
         if (type == Message.TEXT_TYPE) {
            message.getBodyBuffer().writeNullableSimpleString(new SimpleString(body));
         } else {
            message.getBodyBuffer().writeBytes(Base64.decode(body));
         }
      }
      message.setAddress(queue.getAddress());
      ByteBuffer buffer = ByteBuffer.allocate(8);
      buffer.putLong(queue.getID());
      message.putBytesProperty(Message.HDR_ROUTE_TO_IDS, buffer.array());
      postOffice.route(message, true);
      return "" + message.getMessageID();
   } catch (ActiveMQException e) {
      throw new IllegalStateException(e.getMessage());
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:51,代码来源:QueueControlImpl.java


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