Package com.sun.sgs.app

Examples of com.sun.sgs.app.ClientSession


     * {@inheritDoc}
     * <p>
     * Logs when data arrives from the client, and echoes the message back.
     */
    public void receivedMessage(ByteBuffer message) {
        ClientSession session = getSession();

        logger.log(Level.INFO, "Message from {0}", sessionName);

        // Echo message back to sender
        session.send(message);
    }
View Full Code Here


     * {@inheritDoc}
     * <p>
     * Logs when data arrives from the client, and echoes the message back.
     */
    public void receivedMessage(ByteBuffer message) {
        ClientSession session = getSession();

        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, "Message from {0}", sessionName);
        }
        session.send(message);
    }
View Full Code Here

    public void addUserToCellChannel(WonderlandClientID clientID) {
        if (cellChannelRef == null)
            return;

        // issue 963: the session may be null if the user is logging out
        ClientSession session = clientID.getSession();
        if (session != null) {
            cellChannelRef.getForUpdate().join(session);
        }
    }
View Full Code Here

    public void removeUserFromCellChannel(WonderlandClientID clientID) {
        if (cellChannelRef == null)
            return;

        // issue 963: the session may be null if the user is logging out
        ClientSession session = clientID.getSession();
        if (session != null) {
            cellChannelRef.getForUpdate().leave(session);
        }
    }
View Full Code Here

  }

  /** {@inheritDoc} */
  public void serviceEvent(final ChannelImpl channel) {

      ClientSession session =
    (ClientSession) getObjectForId(sessionRefId);
      if (session == null) {
    logger.log(
        Level.FINE,
        "unable to obtain client session for ID:{0}", this);
View Full Code Here

  }

  /** {@inheritDoc} */
  public void serviceEvent(ChannelImpl channel) {

      ClientSession session =
    (ClientSession) getObjectForId(sessionRefId);
      if (session == null) {
    logger.log(
        Level.FINE,
        "unable to obtain client session for ID:{0}", this);
View Full Code Here

      /*
       * Verfiy that the sending session (if any) is a member of this
       * channel.
       */
      if (senderRefId != null) {
    ClientSession sender =
        (ClientSession) getObjectForId(senderRefId);
    if (sender == null ||
        !channel.hasSession(getNodeId(sender), senderRefId))
    {
        return;
View Full Code Here

            send(channelRef.get(), message);
        }

        public void send(WonderlandClientID wlID, Message message) {
            // issue 963: session may be null
            ClientSession session = wlID.getSession();
            if (session != null) {
                session.send(serializeMessage(message, clientID));
            }
        }
View Full Code Here

     * @param ref a reference to the correct client handler
     */
    private void finishAttach(MessageID messageID, ConnectionType type,
                              Properties properties, ClientHandlerRef ref)
    {
        ClientSession session = getSession();

        // get the ID for this type
        WonderlandClientSenderImpl sender = getHandlerStore().getSender(type);
        short clientID = sender.getClientID();
       
        // make sure this isn't a duplicate join
        if (handlers.containsKey(Short.valueOf(clientID))) {
            logger.fine("Session " + session.getName() + " duplicate client " +
                        "for type " + type);
            sendError(messageID, SESSION_INTERNAL_CLIENT_ID,
                          "Duplicate client for " + type);
            return;
        }
View Full Code Here

                sendError(m, "Client version incompatible with server " +
                             "version " + cp.getVersion());
            }
           
           
            ClientSession session = getSession();
            logger.info("Session " + session.getName() + " connected with " +
                        "protocol " + cp.getName());
           
            // all set -- set the wrapped session
            wrapped = cp.createSessionListener(session, psm.getProtocolVersion());
            if (wrapped instanceof ManagedObject) {
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.ClientSession

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.