當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。