Пример #1
0
  IncommingMessage convertMessage(org.eris.messaging.Message msg)
      throws org.eris.messaging.SessionException {
    if (!(msg instanceof IncommingMessage)) {
      throw new org.eris.messaging.SessionException("The supplied message is not a valid type");
    }

    IncommingMessage m = (IncommingMessage) msg;

    if (m.getSessionID() != _id) {
      throw new org.eris.messaging.SessionException(
          "The supplied message is not associated with this session");
    }

    return m;
  }
Пример #2
0
 void setDispositionAndSettleIfRequired(IncommingMessage msg, DeliveryState state) {
   Delivery d = _unsettled.get(msg.getSequence());
   d.disposition(state);
   if (d.getLink().getReceiverSettleMode() == ReceiverSettleMode.FIRST) {
     d.settle();
     ((ReceiverImpl) d.getLink().getContext()).decrementUnsettledCount();
   }
 }