本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例6: wrap
import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
@Override
protected List wrap(DeleteOnClose val)
{
return Collections.EMPTY_LIST;
}
示例7: newInstance
import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
public DeleteOnClose newInstance(Object described)
{
return DeleteOnClose.getInstance();
}
示例8: getTypeClass
import org.apache.qpid.proton.amqp.messaging.DeleteOnClose; //导入依赖的package包/类
public Class<DeleteOnClose> getTypeClass()
{
return DeleteOnClose.class;
}