org.apache.qpid.proton.amqp.messaging.Source.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中org.apache.qpid.proton.amqp.messaging.Source.<init>()方法的一些代码示例,展示了Source.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Source.<init>()方法的具体详情如下:
包路径:org.apache.qpid.proton.amqp.messaging.Source
类名称:Source
方法名:<init>

Source.<init>介绍

暂无

代码示例

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

@Override
  public org.apache.qpid.proton.amqp.transport.Source copy() {
    return new Source(this);
  }
}

代码示例来源:origin: org.apache.qpid/proton-j

@Override
  public org.apache.qpid.proton.amqp.transport.Source copy() {
    return new Source(this);
  }
}

代码示例来源:origin: EnMasseProject/enmasse

@Override
public Source getSource(String address) {
  Source source = new Source();
  source.setAddress(address);
  return source;
}

代码示例来源:origin: Azure/azure-service-bus-java

private static SenderLinkSettings getControllerLinkSettings(MessagingFactory underlyingFactory)
  {
    SenderLinkSettings linkSettings = new SenderLinkSettings();
    linkSettings.linkPath = "coordinator";

    final Target target = new Coordinator();
    linkSettings.target = target;
    linkSettings.source = new Source();
    linkSettings.settleMode = SenderSettleMode.UNSETTLED;
    linkSettings.requiresAuthentication = false;

    Map<Symbol, Object> linkProperties = new HashMap<>();
    // ServiceBus expects timeout to be of type unsignedint
    linkProperties.put(ClientConstants.LINK_TIMEOUT_PROPERTY, UnsignedInteger.valueOf(Util.adjustServerTimeout(underlyingFactory.getOperationTimeout()).toMillis()));
    linkSettings.linkProperties = linkProperties;

    return linkSettings;
  }
}

代码示例来源:origin: apache/activemq-artemis

protected Source createJmsSource(boolean topic) {

   Source source = new Source();
   // Set the capability to indicate the node type being created
   if (!topic) {
     source.setCapabilities(QUEUE_CAPABILITY);
   } else {
     source.setCapabilities(TOPIC_CAPABILITY);
   }

   return source;
  }
}

代码示例来源:origin: apache/activemq-artemis

protected Source createJmsSource(boolean topic) {

   Source source = new Source();
   // Set the capability to indicate the node type being created
   if (!topic) {
     source.setCapabilities(QUEUE_CAPABILITY);
   } else {
     source.setCapabilities(TOPIC_CAPABILITY);
   }

   return source;
  }
}

代码示例来源:origin: Azure/azure-iot-sdk-java

@Override
public void onLinkInit(Event event)
{
  // Codes_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_015: [The event handler shall create a new Target (Proton) object using the given endpoint address]
  // Codes_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_016: [The event handler shall get the Link (Proton) object and set its target to the created Target (Proton) object]
  Link link = event.getLink();
  if (event.getLink().getName().equals(RECEIVE_TAG))
  {
    Target t = new Target();
    t.setAddress(ENDPOINT);
    Source source = new Source();
    source.setAddress(ENDPOINT);
    link.setTarget(t);
    link.setSource(source);
  }
}

代码示例来源:origin: Azure/azure-iot-sdk-java

@Override
public void onLinkInit(Event event)
{
  // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_015: [The event handler shall create a new Target (Proton) object using the given endpoint address]
  // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_016: [The event handler shall get the Link (Proton) object and set its target to the created Target (Proton) object]
  Link link = event.getLink();
  if (event.getLink().getName().equals(FILE_NOTIFICATION_RECEIVE_TAG))
  {
    Target t = new Target();
    t.setAddress(FILENOTIFICATION_ENDPOINT);
    Source source = new Source();
    source.setAddress(FILENOTIFICATION_ENDPOINT);
    link.setTarget(t);
    link.setSource(source);
  }
}

代码示例来源:origin: apache/activemq-artemis

private Source createNonSharedSource(TerminusDurability terminusDurability) {
 Source source = new Source();
 source.setAddress(address.toString());
 source.setCapabilities(TOPIC_CAPABILITY);
 source.setDurable(terminusDurability);
 return source;
}

代码示例来源:origin: apache/activemq-artemis

private Source createSharedSource(TerminusDurability terminusDurability) {
 Source source = new Source();
 source.setAddress(address.toString());
 source.setCapabilities(TOPIC_CAPABILITY, SHARED);
 source.setDurable(terminusDurability);
 return source;
}

代码示例来源:origin: apache/activemq-artemis

private Source createSharedGlobalSource(TerminusDurability terminusDurability) {
   Source source = new Source();
   source.setAddress(address.toString());
   source.setCapabilities(TOPIC_CAPABILITY, SHARED, GLOBAL);
   source.setDurable(terminusDurability);
   return source;
  }
}

代码示例来源:origin: apache/activemq-artemis

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;
}

代码示例来源:origin: EnMasseProject/enmasse

private void createSender(org.apache.qpid.proton.engine.Session session) throws Exception {
   Sender sender = session.sender(subscriberInfo.getClientId());
   Target target = new Target();
   target.setAddress(subscriberInfo.getClientAddress());
   sender.setTarget(target);

   Source source = new Source();
   source.setAddress(subscriberInfo.getClientAddress());
   source.setDurable(TerminusDurability.UNSETTLED_STATE);
   sender.setSource(source);

   sender.open();
  }
}

代码示例来源:origin: org.apache.qpid/proton-j-impl

public Receiver create(Session session)
  {
    Receiver receiver = session.receiver(_path);
    Source source = new Source();
    source.setAddress(_path);
    receiver.setSource(source);
    // the C implemenation does this:
    Target target = new Target();
    target.setAddress(_path);
    receiver.setTarget(target);
    if (getIncomingWindow() > 0)
    {
      // use explicit settlement via dispositions (not pre-settled)
      receiver.setSenderSettleMode(SenderSettleMode.UNSETTLED);  // desired
      receiver.setReceiverSettleMode(ReceiverSettleMode.SECOND);
    }
    return receiver;
  }
}

代码示例来源:origin: org.apache.qpid/proton-j-impl

public Sender create(Session session)
  {
    Sender sender = session.sender(_path);
    Target target = new Target();
    target.setAddress(_path);
    sender.setTarget(target);
    // the C implemenation does this:
    Source source = new Source();
    source.setAddress(_path);
    sender.setSource(source);
    if (getOutgoingWindow() > 0)
    {
      // use explicit settlement via dispositions (not pre-settled)
      sender.setSenderSettleMode(SenderSettleMode.UNSETTLED);
      sender.setReceiverSettleMode(ReceiverSettleMode.SECOND);  // desired
    }
    return sender;
  }
}

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

public Sender create(Session session)
  {
    Sender sender = session.sender(_path);
    Target target = new Target();
    target.setAddress(_path);
    sender.setTarget(target);
    // the C implemenation does this:
    Source source = new Source();
    source.setAddress(_path);
    sender.setSource(source);
    if (getOutgoingWindow() > 0)
    {
      // use explicit settlement via dispositions (not pre-settled)
      sender.setSenderSettleMode(SenderSettleMode.UNSETTLED);
      sender.setReceiverSettleMode(ReceiverSettleMode.SECOND);  // desired
    }
    return sender;
  }
}

代码示例来源:origin: apache/activemq-artemis

@Override
protected void doOpen() {
 Coordinator coordinator = new Coordinator();
 coordinator.setCapabilities(TxnCapability.LOCAL_TXN);
 Source source = new Source();
 String coordinatorName = "qpid-jms:coordinator:" + session.getConnection().getConnectionId();
 Sender sender = session.getEndpoint().sender(coordinatorName);
 sender.setSource(source);
 sender.setTarget(coordinator);
 sender.setSenderSettleMode(SenderSettleMode.UNSETTLED);
 sender.setReceiverSettleMode(ReceiverSettleMode.FIRST);
 setEndpoint(sender);
 super.doOpen();
}

代码示例来源:origin: org.apache.activemq/artemis-proton-plug

@Override
  public AMQPClientReceiverContext createReceiver(String name, String address) throws ActiveMQAMQPException {
   FutureRunnable futureRunnable = new FutureRunnable(1);

   ProtonClientReceiverContext amqpReceiver;

   synchronized (connection.getLock()) {
     Receiver receiver = session.receiver(name);
     Source source = new Source();
     source.setAddress(address);
     receiver.setSource(source);
     amqpReceiver = new ProtonClientReceiverContext(sessionSPI, connection, this, receiver);
     receiver.setContext(amqpReceiver);
     amqpReceiver.afterInit(futureRunnable);
     receiver.open();
   }

   connection.flush();

   waitWithTimeout(futureRunnable);

   return amqpReceiver;

  }
}

代码示例来源:origin: apache/qpid-jms

@Override
protected Sender createEndpoint(JmsSessionInfo resourceInfo) {
  Coordinator coordinator = new Coordinator();
  coordinator.setCapabilities(TxnCapability.LOCAL_TXN);
  Symbol[] outcomes = new Symbol[]{ Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL, Released.DESCRIPTOR_SYMBOL, Modified.DESCRIPTOR_SYMBOL };
  Source source = new Source();
  source.setOutcomes(outcomes);
  String coordinatorName = "qpid-jms:coordinator:" + resourceInfo.getId().toString();
  Sender sender = getParent().getSession().getEndpoint().sender(coordinatorName);
  sender.setSource(source);
  sender.setTarget(coordinator);
  sender.setSenderSettleMode(SenderSettleMode.UNSETTLED);
  sender.setReceiverSettleMode(ReceiverSettleMode.FIRST);
  return sender;
}

代码示例来源:origin: org.apache.qpid/qpid-jms-client

@Override
protected Sender createEndpoint(JmsSessionInfo resourceInfo) {
  Coordinator coordinator = new Coordinator();
  coordinator.setCapabilities(TxnCapability.LOCAL_TXN);
  Symbol[] outcomes = new Symbol[]{ Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL, Released.DESCRIPTOR_SYMBOL, Modified.DESCRIPTOR_SYMBOL };
  Source source = new Source();
  source.setOutcomes(outcomes);
  String coordinatorName = "qpid-jms:coordinator:" + resourceInfo.getId().toString();
  Sender sender = getParent().getSession().getEndpoint().sender(coordinatorName);
  sender.setSource(source);
  sender.setTarget(coordinator);
  sender.setSenderSettleMode(SenderSettleMode.UNSETTLED);
  sender.setReceiverSettleMode(ReceiverSettleMode.FIRST);
  return sender;
}

相关文章