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


Java Target.setDynamicNodeProperties方法代码示例

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


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

示例1: createDynamicTarget

import org.apache.qpid.proton.amqp.messaging.Target; //导入方法依赖的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

示例2: createEndpoint

import org.apache.qpid.proton.amqp.messaging.Target; //导入方法依赖的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

示例3: newInstance

import org.apache.qpid.proton.amqp.messaging.Target; //导入方法依赖的package包/类
public Target newInstance(Object described)
{
    List l = (List) described;

    Target o = new Target();


    switch(7 - l.size())
    {

        case 0:
            Object val0 = l.get( 6 );
            if( val0 == null || val0.getClass().isArray() )
            {
                o.setCapabilities( (Symbol[]) val0 );
            }
            else
            {
                o.setCapabilities( (Symbol) val0 );
            }
        case 1:
            o.setDynamicNodeProperties( (Map) l.get( 5 ) );
        case 2:
            Boolean dynamic = (Boolean) l.get(4);
            o.setDynamic(dynamic == null ? false : dynamic);
        case 3:
            UnsignedInteger timeout = (UnsignedInteger) l.get(3);
            o.setTimeout(timeout == null ? UnsignedInteger.ZERO : timeout);
        case 4:
            Symbol expiryPolicy = (Symbol) l.get(2);
            o.setExpiryPolicy(expiryPolicy == null ? TerminusExpiryPolicy.SESSION_END : TerminusExpiryPolicy.valueOf(expiryPolicy));
        case 5:
            UnsignedInteger durable = (UnsignedInteger) l.get(1);
            o.setDurable(durable == null ? TerminusDurability.NONE : TerminusDurability.get(durable));
        case 6:
            o.setAddress( (String) l.get( 0 ) );
    }


    return o;
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:42,代码来源:TargetType.java


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