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


Java ClientMessage.getSimpleStringProperty方法代码示例

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


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

示例1: doProposalReceived

import org.apache.activemq.artemis.api.core.client.ClientMessage; //导入方法依赖的package包/类
private synchronized void doProposalReceived(final ClientMessage message) throws Exception {
   if (!message.containsProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID)) {
      throw new IllegalStateException("proposal type is null");
   }

   SimpleString type = message.getSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID);

   SimpleString val = message.getSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_VALUE);

   Integer hops = message.getIntProperty(ManagementHelper.HDR_DISTANCE);

   if (server.getGroupingHandler() == null) {
      throw new IllegalStateException("grouping handler is null");
   }

   Response response = server.getGroupingHandler().receive(new Proposal(type, val), hops + 1);

   if (response != null) {
      server.getGroupingHandler().sendProposalResponse(response, 0);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:22,代码来源:ClusterConnectionImpl.java

示例2: doProposalResponseReceived

import org.apache.activemq.artemis.api.core.client.ClientMessage; //导入方法依赖的package包/类
private synchronized void doProposalResponseReceived(final ClientMessage message) throws Exception {
   if (!message.containsProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID)) {
      throw new IllegalStateException("proposal type is null");
   }

   SimpleString type = message.getSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID);
   SimpleString val = message.getSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_VALUE);
   SimpleString alt = message.getSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_ALT_VALUE);
   Integer hops = message.getIntProperty(ManagementHelper.HDR_DISTANCE);
   Response response = new Response(type, val, alt);

   if (server.getGroupingHandler() == null) {
      throw new IllegalStateException("grouping handler is null while sending response " + response);
   }

   server.getGroupingHandler().proposed(response);
   server.getGroupingHandler().sendProposalResponse(response, hops + 1);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:ClusterConnectionImpl.java

示例3: doBindingRemoved

import org.apache.activemq.artemis.api.core.client.ClientMessage; //导入方法依赖的package包/类
private void doBindingRemoved(final ClientMessage message) throws Exception {
   if (logger.isTraceEnabled()) {
      logger.trace(ClusterConnectionImpl.this + " Removing binding " + message);
   }
   if (!message.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) {
      throw new IllegalStateException("clusterName is null");
   }

   SimpleString clusterName = message.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME);

   removeBinding(clusterName);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:13,代码来源:ClusterConnectionImpl.java

示例4: handleNotificationMessage

import org.apache.activemq.artemis.api.core.client.ClientMessage; //导入方法依赖的package包/类
private void handleNotificationMessage(ClientMessage message) throws Exception {
   // TODO - optimised this by just passing int in header - but filter needs to be extended to support IN with
   // a list of integers
   SimpleString type = message.getSimpleStringProperty(ManagementHelper.HDR_NOTIFICATION_TYPE);

   CoreNotificationType ntype = CoreNotificationType.valueOf(type.toString());

   switch (ntype) {
      case BINDING_ADDED: {
         doBindingAdded(message);

         break;
      }
      case BINDING_REMOVED: {
         doBindingRemoved(message);

         break;
      }
      case CONSUMER_CREATED: {
         doConsumerCreated(message);

         break;
      }
      case CONSUMER_CLOSED: {
         doConsumerClosed(message);

         break;
      }
      case PROPOSAL: {
         doProposalReceived(message);

         break;
      }
      case PROPOSAL_RESPONSE: {
         doProposalResponseReceived(message);
         break;
      }
      case UNPROPOSAL: {
         doUnProposalReceived(message);
         break;
      }
      default: {
         throw ActiveMQMessageBundle.BUNDLE.invalidType(ntype);
      }
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:47,代码来源:ClusterConnectionImpl.java

示例5: doUnProposalReceived

import org.apache.activemq.artemis.api.core.client.ClientMessage; //导入方法依赖的package包/类
private synchronized void doUnProposalReceived(final ClientMessage message) throws Exception {
   if (!message.containsProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID)) {
      throw new IllegalStateException("proposal type is null");
   }

   SimpleString groupId = message.getSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID);

   SimpleString clusterName = message.getSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_VALUE);

   Integer hops = message.getIntProperty(ManagementHelper.HDR_DISTANCE);

   if (server.getGroupingHandler() == null) {
      throw new IllegalStateException("grouping handler is null");
   }

   server.getGroupingHandler().remove(groupId, clusterName, hops + 1);

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

示例6: doBindingAdded

import org.apache.activemq.artemis.api.core.client.ClientMessage; //导入方法依赖的package包/类
private synchronized void doBindingAdded(final ClientMessage message) throws Exception {
   if (logger.isTraceEnabled()) {
      logger.trace(ClusterConnectionImpl.this + " Adding binding " + message);
   }
   if (!message.containsProperty(ManagementHelper.HDR_DISTANCE)) {
      throw new IllegalStateException("distance is null");
   }

   if (!message.containsProperty(ManagementHelper.HDR_ADDRESS)) {
      throw new IllegalStateException("queueAddress is null");
   }

   if (!message.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) {
      throw new IllegalStateException("clusterName is null");
   }

   if (!message.containsProperty(ManagementHelper.HDR_ROUTING_NAME)) {
      throw new IllegalStateException("routingName is null");
   }

   if (!message.containsProperty(ManagementHelper.HDR_BINDING_ID)) {
      throw new IllegalStateException("queueID is null");
   }

   Integer distance = message.getIntProperty(ManagementHelper.HDR_DISTANCE);

   SimpleString queueAddress = message.getSimpleStringProperty(ManagementHelper.HDR_ADDRESS);

   SimpleString clusterName = message.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME);

   SimpleString routingName = message.getSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME);

   SimpleString filterString = message.getSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING);

   Long queueID = message.getLongProperty(ManagementHelper.HDR_BINDING_ID);

   RemoteQueueBinding existingBinding = (RemoteQueueBinding) postOffice.getBinding(clusterName);

   if (existingBinding != null) {
      if (!existingBinding.isConnected()) {
         existingBinding.connect();
         return;
      }
      // Sanity check - this means the binding has already been added via another bridge, probably max
      // hops is too high
      // or there are multiple cluster connections for the same address

      ActiveMQServerLogger.LOGGER.remoteQueueAlreadyBoundOnClusterConnection(this, clusterName);

      return;
   }

   RemoteQueueBinding binding = new RemoteQueueBindingImpl(server.getStorageManager().generateID(), queueAddress, clusterName, routingName, queueID, filterString, queue, bridge.getName(), distance + 1);

   if (logger.isTraceEnabled()) {
      logger.trace("Adding binding " + clusterName + " into " + ClusterConnectionImpl.this);
   }

   bindings.put(clusterName, binding);

   try {
      postOffice.addBinding(binding);
   } catch (Exception ignore) {
   }

   Bindings theBindings = postOffice.getBindingsForAddress(queueAddress);

   theBindings.setMessageLoadBalancingType(messageLoadBalancingType);

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

示例7: doConsumerCreated

import org.apache.activemq.artemis.api.core.client.ClientMessage; //导入方法依赖的package包/类
private synchronized void doConsumerCreated(final ClientMessage message) throws Exception {
   if (logger.isTraceEnabled()) {
      logger.trace(ClusterConnectionImpl.this + " Consumer created " + message);
   }
   if (!message.containsProperty(ManagementHelper.HDR_DISTANCE)) {
      throw new IllegalStateException("distance is null");
   }

   if (!message.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) {
      throw new IllegalStateException("clusterName is null");
   }

   Integer distance = message.getIntProperty(ManagementHelper.HDR_DISTANCE);

   SimpleString clusterName = message.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME);

   message.putIntProperty(ManagementHelper.HDR_DISTANCE, distance + 1);

   SimpleString filterString = message.getSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING);

   RemoteQueueBinding binding = bindings.get(clusterName);

   if (binding == null) {
      throw new IllegalStateException("Cannot find binding for " + clusterName +
                                         " on " +
                                         ClusterConnectionImpl.this);
   }

   binding.addConsumer(filterString);

   // Need to propagate the consumer add
   TypedProperties props = new TypedProperties();

   props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, binding.getAddress());

   props.putSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME, clusterName);

   props.putSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME, binding.getRoutingName());

   props.putIntProperty(ManagementHelper.HDR_DISTANCE, distance + 1);

   Queue theQueue = (Queue) binding.getBindable();

   props.putIntProperty(ManagementHelper.HDR_CONSUMER_COUNT, theQueue.getConsumerCount());

   if (filterString != null) {
      props.putSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING, filterString);
   }

   Notification notification = new Notification(null, CoreNotificationType.CONSUMER_CREATED, props);

   managementService.sendNotification(notification);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:54,代码来源:ClusterConnectionImpl.java

示例8: doConsumerClosed

import org.apache.activemq.artemis.api.core.client.ClientMessage; //导入方法依赖的package包/类
private synchronized void doConsumerClosed(final ClientMessage message) throws Exception {
   if (logger.isTraceEnabled()) {
      logger.trace(ClusterConnectionImpl.this + " Consumer closed " + message);
   }
   if (!message.containsProperty(ManagementHelper.HDR_DISTANCE)) {
      throw new IllegalStateException("distance is null");
   }

   if (!message.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) {
      throw new IllegalStateException("clusterName is null");
   }

   Integer distance = message.getIntProperty(ManagementHelper.HDR_DISTANCE);

   SimpleString clusterName = message.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME);

   message.putIntProperty(ManagementHelper.HDR_DISTANCE, distance + 1);

   SimpleString filterString = message.getSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING);

   RemoteQueueBinding binding = bindings.get(clusterName);

   if (binding == null) {
      throw new IllegalStateException("Cannot find binding for " + clusterName);
   }

   binding.removeConsumer(filterString);

   // Need to propagate the consumer close
   TypedProperties props = new TypedProperties();

   props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, binding.getAddress());

   props.putSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME, clusterName);

   props.putSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME, binding.getRoutingName());

   props.putIntProperty(ManagementHelper.HDR_DISTANCE, distance + 1);

   Queue theQueue = (Queue) binding.getBindable();

   props.putIntProperty(ManagementHelper.HDR_CONSUMER_COUNT, theQueue.getConsumerCount());

   if (filterString != null) {
      props.putSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING, filterString);
   }
   Notification notification = new Notification(null, CoreNotificationType.CONSUMER_CLOSED, props);

   managementService.sendNotification(notification);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:51,代码来源:ClusterConnectionImpl.java


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