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


Java DeleteOnClose类代码示例

本文整理汇总了Java中org.apache.qpid.proton.amqp.messaging.DeleteOnClose的典型用法代码示例。如果您正苦于以下问题:Java DeleteOnClose类的具体用法?Java DeleteOnClose怎么用?Java DeleteOnClose使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: doTestCreateDynamicSender

import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void doTestCreateDynamicSender(boolean topic) throws Exception {
   Target target = createDynamicTarget(topic);

   AmqpClient client = createAmqpClient();
   AmqpConnection connection = addConnection(client.connect());
   AmqpSession session = connection.createSession();

   AmqpSender sender = session.createSender(target);
   assertNotNull(sender);

   Target remoteTarget = (Target) sender.getEndpoint().getRemoteTarget();
   assertTrue(remoteTarget.getDynamic());
   assertTrue(remoteTarget.getDurable().equals(TerminusDurability.NONE));
   assertTrue(remoteTarget.getExpiryPolicy().equals(TerminusExpiryPolicy.LINK_DETACH));

   // Check the dynamic node lifetime-policy
   Map<Symbol, Object> dynamicNodeProperties = remoteTarget.getDynamicNodeProperties();
   assertTrue(dynamicNodeProperties.containsKey(LIFETIME_POLICY));
   assertEquals(DeleteOnClose.getInstance(), dynamicNodeProperties.get(LIFETIME_POLICY));

   Queue queueView = getProxyToQueue(remoteTarget.getAddress());
   assertNotNull(queueView);

   connection.close();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:27,代码来源:AmqpTempDestinationTest.java

示例2: doTestCreateDynamicReceiver

import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void doTestCreateDynamicReceiver(boolean topic) throws Exception {
   Source source = createDynamicSource(topic);

   AmqpClient client = createAmqpClient();
   AmqpConnection connection = addConnection(client.connect());
   AmqpSession session = connection.createSession();

   AmqpReceiver receiver = session.createReceiver(source);
   assertNotNull(receiver);

   Source remoteSource = (Source) receiver.getEndpoint().getRemoteSource();
   assertTrue(remoteSource.getDynamic());
   assertTrue(remoteSource.getDurable().equals(TerminusDurability.NONE));
   assertTrue(remoteSource.getExpiryPolicy().equals(TerminusExpiryPolicy.LINK_DETACH));

   // Check the dynamic node lifetime-policy
   Map<Symbol, Object> dynamicNodeProperties = remoteSource.getDynamicNodeProperties();
   assertTrue(dynamicNodeProperties.containsKey(LIFETIME_POLICY));
   assertEquals(DeleteOnClose.getInstance(), dynamicNodeProperties.get(LIFETIME_POLICY));

   Queue queueView = getProxyToQueue(remoteSource.getAddress());
   assertNotNull(queueView);

   connection.close();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:27,代码来源:AmqpTempDestinationTest.java

示例3: createDynamicSource

import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
protected Source createDynamicSource(boolean topic) {

      Source source = new Source();
      source.setDynamic(true);
      source.setDurable(TerminusDurability.NONE);
      source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH);

      // Set the dynamic node lifetime-policy
      Map<Symbol, Object> dynamicNodeProperties = new HashMap<>();
      dynamicNodeProperties.put(LIFETIME_POLICY, DeleteOnClose.getInstance());
      source.setDynamicNodeProperties(dynamicNodeProperties);

      // Set the capability to indicate the node type being created
      if (!topic) {
         source.setCapabilities(TEMP_QUEUE_CAPABILITY);
      } else {
         source.setCapabilities(TEMP_TOPIC_CAPABILITY);
      }

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

示例4: createDynamicTarget

import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
protected Target createDynamicTarget(boolean topic) {

      Target target = new Target();
      target.setDynamic(true);
      target.setDurable(TerminusDurability.NONE);
      target.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH);

      // Set the dynamic node lifetime-policy
      Map<Symbol, Object> dynamicNodeProperties = new HashMap<>();
      dynamicNodeProperties.put(LIFETIME_POLICY, DeleteOnClose.getInstance());
      target.setDynamicNodeProperties(dynamicNodeProperties);

      // Set the capability to indicate the node type being created
      if (!topic) {
         target.setCapabilities(TEMP_QUEUE_CAPABILITY);
      } else {
         target.setCapabilities(TEMP_TOPIC_CAPABILITY);
      }

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

示例5: createEndpoint

import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
@Override
protected Sender createEndpoint(JmsTemporaryDestination resourceInfo) {
    // Form a link name, use the local generated name with a prefix to aid debugging
    String localDestinationName = resourceInfo.getAddress();
    String senderLinkName = null;
    if (resourceInfo.isQueue()) {
        senderLinkName = "qpid-jms:" + TEMP_QUEUE_CREATOR + localDestinationName;
    } else {
        senderLinkName = "qpid-jms:" + TEMP_TOPIC_CREATOR + localDestinationName;
    }

    // Just use a bare Source, this is a producer which
    // wont send anything and the link name is unique.
    Source source = new Source();

    Target target = new Target();
    target.setDynamic(true);
    target.setDurable(TerminusDurability.NONE);
    target.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH);

    // Set the dynamic node lifetime-policy
    Map<Symbol, Object> dynamicNodeProperties = new HashMap<Symbol, Object>();
    dynamicNodeProperties.put(DYNAMIC_NODE_LIFETIME_POLICY, DeleteOnClose.getInstance());
    target.setDynamicNodeProperties(dynamicNodeProperties);

    // Set the capability to indicate the node type being created
    if (resourceInfo.isQueue()) {
        target.setCapabilities(AmqpDestinationHelper.TEMP_QUEUE_CAPABILITY);
    } else {
        target.setCapabilities(AmqpDestinationHelper.TEMP_TOPIC_CAPABILITY);
    }

    Sender sender = getParent().getEndpoint().sender(senderLinkName);
    sender.setSource(source);
    sender.setTarget(target);
    sender.setSenderSettleMode(SenderSettleMode.UNSETTLED);
    sender.setReceiverSettleMode(ReceiverSettleMode.FIRST);

    return sender;
}
 
开发者ID:apache,项目名称:qpid-jms,代码行数:41,代码来源:AmqpTemporaryDestinationBuilder.java

示例6: wrap

import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
@Override
protected List wrap(DeleteOnClose val)
{
    return Collections.EMPTY_LIST;
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:6,代码来源:DeleteOnCloseType.java

示例7: newInstance

import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
public DeleteOnClose newInstance(Object described)
{
    return DeleteOnClose.getInstance();
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:5,代码来源:DeleteOnCloseType.java

示例8: getTypeClass

import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
public Class<DeleteOnClose> getTypeClass()
{
    return DeleteOnClose.class;
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:5,代码来源:DeleteOnCloseType.java


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