コード例 #1
0
ファイル: SessionImpl.java プロジェクト: rajith77/Eris
  @Override
  public org.eris.messaging.Sender createSender(String address, SenderMode mode)
      throws org.eris.messaging.TransportException, org.eris.messaging.SessionException {
    checkPreConditions();
    Sender sender;
    Source source = new Source();
    Target target = new Target();
    if (address == null || address.isEmpty() || address.equals("#")) {
      String temp = UUID.randomUUID().toString();
      sender = _session.sender(temp);
      target.setDynamic(true);
    } else {
      sender = _session.sender(address);
      target.setAddress(address);
    }
    sender.setTarget(target);
    sender.setSource(source);
    sender.setSenderSettleMode(
        mode == SenderMode.AT_MOST_ONCE ? SenderSettleMode.SETTLED : SenderSettleMode.UNSETTLED);
    sender.open();

    SenderImpl senderImpl = new SenderImpl(address, this, sender);
    senderImpl.setDynamicAddress(target.getDynamic());
    _senders.put(sender, senderImpl);
    sender.setContext(senderImpl);
    _conn.write();
    return senderImpl;
  }
コード例 #2
0
ファイル: ProtonJInterop.java プロジェクト: ChugR/qpid-proton
 @Override
 public void onConnectionInit(Event event) {
   Connection conn = event.getConnection();
   Session ssn = conn.session();
   Sender snd = ssn.sender("sender");
   conn.open();
   ssn.open();
   snd.open();
 }