Package com.sun.sgs.protocol

Examples of com.sun.sgs.protocol.SessionProtocol


        } else {
      handler.loginFailure(loginException);
      return;
        }
    }
    SessionProtocol protocol = handler.getSessionProtocol();
    if (protocol != null) {
        for (SendEvent sendEvent : messages) {
                        try {
                            protocol.sessionMessage(
        ByteBuffer.wrap(sendEvent.message),
        sendEvent.delivery);
                        } catch (Exception e) {
                            logger.logThrow(Level.WARNING, e,
                                            "sessionMessage throws");
View Full Code Here


    if (logger.isLoggable(Level.FINEST)) {
        logger.log(Level.FINEST, "sessionId:{0} message:{1}",
             HexDumper.toHexString(sessionId),
             HexDumper.toHexString(message));
    }
    SessionProtocol sessionProtocol =
        getSessionProtocol(new BigInteger(1, sessionId));
    if (sessionProtocol != null) {
        try {
      sessionProtocol.sessionMessage(
          ByteBuffer.wrap(message),
          Delivery.values()[deliveryOrdinal]);
        } catch (IOException e) {
      if (logger.isLoggable(Level.FINE)) {
          logger.logThrow(
View Full Code Here

      leavers = oldLocalMembers;
        }
    }
    if (joiners != null) {
        for (BigInteger sessionRefId : joiners) {
      SessionProtocol protocol =
          sessionService.getSessionProtocol(sessionRefId);
      if (protocol != null) {
                            try {
                                protocol.channelJoin(name, channelRefId,
                                                     delivery);
                            } catch (IOException ioe) {
                                logger.logThrow(Level.WARNING, ioe,
                                                "channelJoin throws");
                            }
      }
        }
    }
    if (leavers != null) {
        for (BigInteger sessionRefId : leavers) {
      SessionProtocol protocol =
          sessionService.getSessionProtocol(sessionRefId);
      if (protocol != null) {
                            try {
                                protocol.channelLeave(channelRefId);
                            } catch (IOException ioe) {
                                logger.logThrow(Level.WARNING, ioe,
                                                "channelLeave throws");
                            }
      }
View Full Code Here

        }
    }
    channelSet.add(channelRefId);

    // Send channel join protocol message.
    SessionProtocol protocol =
        sessionService.getSessionProtocol(sessionRefId);
    if (protocol != null) {
                    try {
                        protocol.channelJoin(name, channelRefId, delivery);
                    } catch (IOException ioe) {
                        logger.logThrow(Level.WARNING, ioe,
                                        "channelJoin throws");
                    }
    }
View Full Code Here

    if (channelSet != null) {
        channelSet.remove(channelRefId);
    }

    // Send channel leave protocol message.
    SessionProtocol protocol =
        sessionService.getSessionProtocol(sessionRefId);
    if (protocol != null) {
                    try {
                        protocol.channelLeave(channelRefId);
                    } catch (IOException ioe) {
                        logger.logThrow(Level.WARNING, ioe,
                                        "channelLeave throws");
                    }
    }
View Full Code Here

    }
    Set<BigInteger> localMembers;
    localMembers = localChannelMembersMap.remove(channelRefId);
    if (localMembers != null) {
        for (BigInteger sessionRefId : localMembers) {
      SessionProtocol protocol =
          sessionService.getSessionProtocol(sessionRefId);
      if (protocol != null) {
                            try {
                                protocol.channelLeave(channelRefId);
                            } catch (IOException ioe) {
                                logger.logThrow(Level.WARNING, ioe,
                                                "channelLeave throws");
                            }
      }
View Full Code Here

        return;
    }

    Delivery delivery = Delivery.values()[deliveryOrdinal];
    for (BigInteger sessionRefId : localMembers) {
        SessionProtocol protocol =
      sessionService.getSessionProtocol(sessionRefId);
        if (protocol != null) {
                        try {
                            protocol.channelMessage(channelRefId,
                                                    ByteBuffer.wrap(message),
                                                    delivery);
                        } catch (IOException ioe) {
                            logger.logThrow(Level.WARNING, ioe,
                                            "channelMessage throws");
View Full Code Here

    if (logger.isLoggable(Level.FINEST)) {
        logger.log(Level.FINEST, "sessionId:{0} message:{1}",
             HexDumper.toHexString(sessionId),
             HexDumper.toHexString(message));
    }
    SessionProtocol sessionProtocol =
        getSessionProtocol(new BigInteger(1, sessionId));
    if (sessionProtocol != null) {
        Delivery delivery = Delivery.values()[deliveryOrdinal];

        try {
      sessionProtocol.sessionMessage(
          ByteBuffer.wrap(message), delivery);
        } catch (IOException e) {
      // TBD: should we disconnect the session because
      // messages can't be delivered?
      if (logger.isLoggable(Level.FINE)) {
View Full Code Here

      // Update local channel membership set.
      addLocalChannelMember(
     channelRefId, delivery, sessionRefId, timestamp, false);

      // Send channel join protocol message.
      SessionProtocol protocol =
    sessionService.getSessionProtocol(sessionRefId);
      if (protocol != null) {
    try {
        protocol.channelJoin(name, channelRefId, delivery);
    } catch (IOException e) {
        logger.logThrow(Level.WARNING, e, "channelJoin throws");
    }
      }
  }
View Full Code Here

      // from local channel membership set.
      removeLocalPerSessionChannel(channelRefId, sessionRefId);
      removeLocalChannelMember(channelRefId, sessionRefId);
     
      // Send channel leave protocol message.
      SessionProtocol protocol =
    sessionService.getSessionProtocol(sessionRefId);
      if (protocol != null) {
    try {
        protocol.channelLeave(channelRefId);
    } catch (IOException e) {
        logger.logThrow(Level.WARNING, e,
            "channelLeave throws");
    }
      }
View Full Code Here

TOP

Related Classes of com.sun.sgs.protocol.SessionProtocol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.