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


Java ActiveMQDestination.isTemporary方法代码示例

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


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

示例1: getAMQueueMessageCount

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public long getAMQueueMessageCount(ActiveMQDestination amq5Dest) {
   if (amq5Dest.isTopic()) {
      throw new IllegalArgumentException("Method only accept queue type parameter.");
   }
   long count = 0;
   String qname = null;
   if (amq5Dest.isTemporary()) {
      qname = amq5Dest.getPhysicalName();
   } else {
      qname = amq5Dest.getPhysicalName();
   }
   Binding binding = server.getPostOffice().getBinding(new SimpleString(qname));
   if (binding != null) {
      QueueImpl q = (QueueImpl) binding.getBindable();
      count = q.getMessageCount();
   }
   return count;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:ArtemisBrokerWrapper.java

示例2: registerDestination

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
protected void registerDestination(ObjectName key, ActiveMQDestination dest, DestinationView view) throws Exception {
    if (dest.isQueue()) {
        if (dest.isTemporary()) {
            temporaryQueues.put(key, view);
        } else {
            queues.put(key, view);
        }
    } else {
        if (dest.isTemporary()) {
            temporaryTopics.put(key, view);
        } else {
            topics.put(key, view);
        }
    }
    try {
        AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, key);
        registeredMBeans.add(key);
    } catch (Throwable e) {
        LOG.warn("Failed to register MBean {}", key);
        LOG.debug("Failure reason: ", e);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:23,代码来源:ManagedRegionBroker.java

示例3: getRootNode

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * Returns the root node for the given destination type
 */
protected DestinationMapNode getRootNode(ActiveMQDestination key) {
    if (key.isTemporary()){
        if (key.isQueue()) {
            return tempQueueRootNode;
        } else {
            return tempTopicRootNode;
        }
    } else {
        if (key.isQueue()) {
            return queueRootNode;
        } else {
            return topicRootNode;
        }
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:19,代码来源:DestinationMap.java

示例4: processDestinationInfo

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
private void processDestinationInfo(DestinationInfo dinfo) {
    ActiveMQDestination dest = dinfo.getDestination();
    if (!dest.isTemporary()) {
        return;
    }

    ActiveMQTempDestination tempDest = (ActiveMQTempDestination)dest;
    if (dinfo.getOperationType() == DestinationInfo.ADD_OPERATION_TYPE) {
        if (tempDest.getConnection() != null) {
            tempDest = (ActiveMQTempDestination) tempDest.createDestination(tempDest.getPhysicalName());
        }
        connection.activeTempDestinations.put(tempDest, tempDest);
    } else if (dinfo.getOperationType() == DestinationInfo.REMOVE_OPERATION_TYPE) {
        connection.activeTempDestinations.remove(tempDest);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:17,代码来源:AdvisoryConsumer.java

示例5: addDestination

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public void addDestination(DestinationInfo info) throws Exception {
   boolean created = false;
   ActiveMQDestination dest = info.getDestination();
   if (!protocolManager.isSupportAdvisory() && AdvisorySupport.isAdvisoryTopic(dest)) {
      return;
   }

   SimpleString qName = SimpleString.toSimpleString(dest.getPhysicalName());
   if (server.locateQueue(qName) == null) {
      AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(dest.getPhysicalName());
      AddressInfo addressInfo = new AddressInfo(qName, dest.isTopic() ? RoutingType.MULTICAST : RoutingType.ANYCAST);
      if (AdvisorySupport.isAdvisoryTopic(dest) && protocolManager.isSuppressInternalManagementObjects()) {
         addressInfo.setInternal(true);
      }
      if (dest.isQueue() && (addressSettings.isAutoCreateQueues() || dest.isTemporary())) {
         internalSession.createQueue(addressInfo, qName, null, dest.isTemporary(), !dest.isTemporary(), !dest.isTemporary());
         created = true;
      } else if (dest.isTopic() && (addressSettings.isAutoCreateAddresses() || dest.isTemporary())) {
         internalSession.createAddress(addressInfo, !dest.isTemporary());
         created = true;
      }
   }

   if (dest.isTemporary()) {
      //Openwire needs to store the DestinationInfo in order to send
      //Advisory messages to clients
      this.state.addTempDestination(info);
   }

   if (created && !AdvisorySupport.isAdvisoryTopic(dest)) {
      AMQConnectionContext context = getContext();
      DestinationInfo advInfo = new DestinationInfo(context.getConnectionId(), DestinationInfo.ADD_OPERATION_TYPE, dest);

      ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(dest);
      protocolManager.fireAdvisory(context, topic, advInfo);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:38,代码来源:OpenWireConnection.java

示例6: getDestinationFilter

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * @return the destinationFilter
 */
public String getDestinationFilter() {
    if (this.destinationFilter == null) {
        if (dynamicallyIncludedDestinations != null && !dynamicallyIncludedDestinations.isEmpty()) {
            StringBuffer filter = new StringBuffer();
            String delimiter = "";
            for (ActiveMQDestination destination : dynamicallyIncludedDestinations) {
                if (!destination.isTemporary()) {
                    filter.append(delimiter);
                    filter.append(AdvisorySupport.CONSUMER_ADVISORY_TOPIC_PREFIX);
                    filter.append(destination.getDestinationTypeAsString());
                    filter.append(".");
                    filter.append(destination.getPhysicalName());
                    delimiter = ",";
                }
            }
            return filter.toString();
        }   else {
            return AdvisorySupport.CONSUMER_ADVISORY_TOPIC_PREFIX + ">";
        }
    } else {
        // prepend consumer advisory prefix
        // to keep backward compatibility
        if (!this.destinationFilter.startsWith(AdvisorySupport.CONSUMER_ADVISORY_TOPIC_PREFIX)) {
             return AdvisorySupport.CONSUMER_ADVISORY_TOPIC_PREFIX + this.destinationFilter;
        } else {
            return this.destinationFilter;
        }
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:33,代码来源:NetworkBridgeConfiguration.java

示例7: removeConsumer

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
    super.removeConsumer(context, info);

    // Don't advise advisory topics.
    ActiveMQDestination dest = info.getDestination();
    if (!AdvisorySupport.isAdvisoryTopic(dest)) {
        ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(dest);
        consumers.remove(info);
        if (!dest.isTemporary() || destinations.containsKey(dest)) {
            fireConsumerAdvisory(context,dest, topic, info.createRemoveCommand());
        }
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:15,代码来源:AdvisoryBroker.java

示例8: removeProducer

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
@Override
public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception {
    super.removeProducer(context, info);

    // Don't advise advisory topics.
    ActiveMQDestination dest = info.getDestination();
    if (info.getDestination() != null && !AdvisorySupport.isAdvisoryTopic(dest)) {
        ActiveMQTopic topic = AdvisorySupport.getProducerAdvisoryTopic(dest);
        producers.remove(info.getProducerId());
        if (!dest.isTemporary() || destinations.contains(dest)) {
            fireProducerAdvisory(context, dest,topic, info.createRemoveCommand());
        }
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:15,代码来源:AdvisoryBroker.java

示例9: getTopics

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * Retrieve a set of all Topics be used by the Broker
 * @return  all Topics
 */

public Set<ActiveMQTopic> getTopics(){
    Set<ActiveMQTopic> result = new HashSet<ActiveMQTopic>();
    for (ActiveMQDestination destination:getDestinations()){
        if (destination.isTopic() && !destination.isTemporary()){
            result.add((ActiveMQTopic) destination);
        }
    }
    return result;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:15,代码来源:MessageBrokerView.java

示例10: getQueues

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * Retrieve a set of all Queues be used by the Broker
 * @return  all Queues
 */

public Set<ActiveMQQueue> getQueues(){
    Set<ActiveMQQueue> result = new HashSet<ActiveMQQueue>();
    for (ActiveMQDestination destination:getDestinations()){
        if (destination.isQueue() && !destination.isTemporary()){
            result.add((ActiveMQQueue) destination);
        }
    }
    return result;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:15,代码来源:MessageBrokerView.java

示例11: getTempTopics

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * Retrieve a set of all TemporaryTopics be used by the Broker
 * @return  all TemporaryTopics
 */
public Set<ActiveMQTempTopic> getTempTopics(){
    Set<ActiveMQTempTopic> result = new HashSet<ActiveMQTempTopic>();
    for (ActiveMQDestination destination:getDestinations()){
        if (destination.isTopic() && destination.isTemporary()){
            result.add((ActiveMQTempTopic) destination);
        }
    }
    return result;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:MessageBrokerView.java

示例12: getTempQueues

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * Retrieve a set of all TemporaryQueues be used by the Broker
 * @return  all TemporaryQueues
 */
public Set<ActiveMQTempQueue> getTempQueues(){
    Set<ActiveMQTempQueue> result = new HashSet<ActiveMQTempQueue>();
    for (ActiveMQDestination destination:getDestinations()){
        if (destination.isTopic() && destination.isTemporary()){
            result.add((ActiveMQTempQueue) destination);
        }
    }
    return result;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:MessageBrokerView.java

示例13: isDestinationTemporary

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * @return true if the destination is temporary
 */
@Override
public boolean isDestinationTemporary() {
    ConsumerInfo info = getConsumerInfo();
    if (info != null) {
        ActiveMQDestination dest = info.getDestination();
        return dest.isTemporary();
    }
    return false;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:13,代码来源:SubscriptionView.java

示例14: isDestinationTemporary

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
@Override
public boolean isDestinationTemporary() {
    if (info != null) {
        if (info.getDestination() != null) {
            ActiveMQDestination dest = info.getDestination();
            return dest.isTemporary();
        } else if(lastUsedDestination != null) {
            return lastUsedDestination.isTemporary();
        }
    }
    return false;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:13,代码来源:ProducerView.java

示例15: getDestinationMap

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
private static Map<ActiveMQDestination, org.apache.activemq.broker.region.Destination> getDestinationMap(
   BrokerService target,
   ActiveMQDestination destination) {
   RegionBroker regionBroker = (RegionBroker) target.getRegionBroker();
   if (destination.isTemporary()) {
      return destination.isQueue() ? regionBroker.getTempQueueRegion().getDestinationMap() : regionBroker.getTempTopicRegion().getDestinationMap();
   }
   return destination.isQueue() ? regionBroker.getQueueRegion().getDestinationMap() : regionBroker.getTopicRegion().getDestinationMap();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:TestSupport.java


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