Package org.apache.mina.core.future

Examples of org.apache.mina.core.future.CloseFuture


  public void closeConnection(HostPort hostPort) {
    if (!serviceAdapter.hasSession(hostPort)) return;
    log.info("closeConnection() invoked, closing session for {}", hostPort);

    IoSession session = serviceAdapter.getSession(hostPort);
    CloseFuture cf = session.close(false);
    cf.awaitUninterruptibly();
  }
View Full Code Here


    }
  }

  public void closeAllSessions() {
    for (IoSession session : sessions.values()) {
      CloseFuture cf = session.close(true);
      cf.awaitUninterruptibly();
    }

    sessions.clear();
  }
View Full Code Here

      if (room != null) {
        log.info("Closing session [" + room + "]. ");
      } else {
        log.info("Cannot determine session to close.");
      }
      CloseFuture future = session.close(true);          
    }   
View Full Code Here

            return false;
        }

        // Get the close future for this session
        CloseFuture closeFuture = connectionFuture.getSession().getCloseFuture();

        // Add a listener to close the session in the session.
        closeFuture.addListener( new IoFutureListener<IoFuture>()
        {
            public void operationComplete( IoFuture future )
            {
                // Process all the waiting operations and cancel them
                LOG.debug( "received a NoD, closing everything" );
View Full Code Here

        clearMaps();

        //  We now have to close the session
        if ( ( ldapSession != null ) && connected.get() )
        {
            CloseFuture closeFuture = ldapSession.close( true );

            LOG.debug( "waiting for closeFuture" );
            closeFuture.awaitUninterruptibly();
            LOG.debug( "closeFuture done" );
            connected.set( false );
        }

        // Last, not least, reset the MessageId value
View Full Code Here

     * Add the session for being checked for idle.
     * @param session the session to check
     */
    public void addSession(AbstractIoSession session) {
        sessions.add(session);
        CloseFuture closeFuture = session.getCloseFuture();
       
        // isn't service reponsability to remove the session nicely ?
        closeFuture.addListener(sessionCloseListener);
    }
View Full Code Here

            return false;
        }

        // Get the close future for this session
        CloseFuture closeFuture = connectionFuture.getSession().getCloseFuture();

        // Add a listener to close the session in the session.
        closeFuture.addListener( new IoFutureListener<IoFuture>()
        {
            public void operationComplete( IoFuture future )
            {
                // Process all the waiting operations and cancel them
                LOG.debug( "received a NoD, closing everything" );
View Full Code Here

        clearMaps();

        //  We now have to close the session
        if ( ldapSession != null )
        {
            CloseFuture closeFuture = ldapSession.close( true );

            LOG.debug( "waiting for closeFuture" );
            closeFuture.awaitUninterruptibly();
            LOG.debug( "closeFuture done" );
            connected.set( false );
        }

        // Last, not least, reset the MessageId value
View Full Code Here

        super.doShutdown();
    }

    private void closeConnection() {
        if (session != null) {
            CloseFuture closeFuture = session.close(true);
            closeFuture.awaitUninterruptibly();
        }

        connector.dispose(true);
    }
View Full Code Here

TOP

Related Classes of org.apache.mina.core.future.CloseFuture

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.