Examples of AbstractSession


Examples of net.timewalker.ffmq3.common.session.AbstractSession

            {
              sessionsSnapshot.addAll(sessions.values());
            }
            for(int n=0;n<sessionsSnapshot.size();n++)
            {
                AbstractSession session = (AbstractSession)sessionsSnapshot.get(n);
                session.wakeUpConsumers();
            }
        }
        catch (JMSException e)
        {
          ErrorTools.log(e, log);
View Full Code Here

Examples of oracle.toplink.essentials.internal.sessions.AbstractSession

  @Override
  public ConnectionHandle getJdbcConnection(EntityManager em, boolean readOnly)
      throws PersistenceException, SQLException {

    AbstractSession session = (AbstractSession) getSession(em);
    // The connection was already acquired eagerly in beginTransaction,
    // unless lazyDatabaseTransaction was set to true.
    Connection con = session.getAccessor().getConnection();
    return (con != null ? new SimpleConnectionHandle(con) : null);
  }
View Full Code Here

Examples of org.apache.sshd.common.session.AbstractSession

     * Obtain the list of active sessions.
     */
    public List<AbstractSession> getActiveSessions() {
        List<AbstractSession> sessions = new ArrayList<AbstractSession>();
        for (IoSession ioSession : acceptor.getManagedSessions().values()) {
            AbstractSession session = AbstractSession.getSession(ioSession, true);
            if (session != null) {
                sessions.add(session);
            }
        }
        return sessions;
View Full Code Here

Examples of org.apache.sshd.common.session.AbstractSession

     * Obtain the list of active sessions.
     */
    public List<AbstractSession> getActiveSessions() {
        List<AbstractSession> sessions = new ArrayList<AbstractSession>();
        for (IoSession ioSession : acceptor.getManagedSessions().values()) {
            AbstractSession session = AbstractSession.getSession(ioSession, true);
            if (session != null) {
                sessions.add(session);
            }
        }
        return sessions;
View Full Code Here

Examples of org.apache.sshd.common.session.AbstractSession

            channel.setOut(out);
            channel.setErr(err);
            channel.open().await();

//            ((AbstractSession) session).disconnect(SshConstants.SSH2_DISCONNECT_BY_APPLICATION, "Cancel");
            AbstractSession cs = (AbstractSession) session;
            Buffer buffer = cs.createBuffer(SshConstants.SSH_MSG_DISCONNECT);
            buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
            buffer.putString("Cancel");
            buffer.putString("");
            IoWriteFuture f = cs.writePacket(buffer);
            f.await();
            suspend(cs.getIoSession());

            TestEchoShellFactory.TestEchoShell.latch.await();
        } finally {
            TestEchoShellFactory.TestEchoShell.latch = null;
        }
View Full Code Here

Examples of org.apache.sshd.common.session.AbstractSession

            channel.setOut(out);
            channel.setErr(err);
            channel.open().await();

//            ((AbstractSession) session).disconnect(SshConstants.SSH2_DISCONNECT_BY_APPLICATION, "Cancel");
            AbstractSession cs = (AbstractSession) session;
            Buffer buffer = cs.createBuffer(SshConstants.Message.SSH_MSG_DISCONNECT, 0);
            buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
            buffer.putString("Cancel");
            buffer.putString("");
            WriteFuture f = cs.writePacket(buffer);
            f.await();
            cs.getIoSession().suspendRead();
            cs.getIoSession().suspendWrite();

            TestEchoShellFactory.TestEchoShell.latch.await();
        } finally {
            TestEchoShellFactory.TestEchoShell.latch = null;
        }
View Full Code Here

Examples of org.apache.sshd.common.session.AbstractSession

    public void stop(boolean immediately) throws InterruptedException {
        acceptor.setCloseOnDeactivation(false);
        acceptor.unbind();
        List<AbstractSession> sessions = new ArrayList<AbstractSession>();
        for (IoSession ioSession : acceptor.getManagedSessions().values()) {
            AbstractSession session = AbstractSession.getSession(ioSession, true);
            if (session != null) {
                sessions.add(session);
            }
        }
        final CountDownLatch latch = new CountDownLatch(sessions.size());
        SshFutureListener<CloseFuture> listener = new SshFutureListener<CloseFuture>() {
            public void operationComplete(CloseFuture future) {
                latch.countDown();
            }
        };
        for (AbstractSession session : sessions) {
            session.close(immediately).addListener(listener);
        }
        if (!immediately) {
            latch.await();
        }
        acceptor.dispose();
View Full Code Here

Examples of org.apache.sshd.common.session.AbstractSession

public abstract class AbstractSessionIoHandler implements IoHandler {

    protected abstract AbstractSession createSession(IoSession ioSession) throws Exception;

    public void sessionCreated(IoSession ioSession) throws Exception {
        AbstractSession session = createSession(ioSession);
        AbstractSession.attachSession(ioSession, session);
    }
View Full Code Here

Examples of org.apache.sshd.common.session.AbstractSession

    public void sessionClosed(IoSession ioSession) throws Exception {
        AbstractSession.getSession(ioSession).close(true);
    }

    public void exceptionCaught(IoSession ioSession, Throwable cause) throws Exception {
        AbstractSession session = AbstractSession.getSession(ioSession, true);
        if (session != null) {
            session.exceptionCaught(cause);
        } else {
            throw new IllegalStateException("No session available", cause);
        }
    }
View Full Code Here

Examples of org.apache.sshd.common.session.AbstractSession

            channel.setOut(out);
            channel.setErr(err);
            channel.open().await();

//            ((AbstractSession) session).disconnect(SshConstants.SSH2_DISCONNECT_BY_APPLICATION, "Cancel");
            AbstractSession cs = (AbstractSession) session;
            Buffer buffer = cs.createBuffer(SshConstants.SSH_MSG_DISCONNECT);
            buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
            buffer.putString("Cancel");
            buffer.putString("");
            IoWriteFuture f = cs.writePacket(buffer);
            f.await();
            suspend(cs.getIoSession());

            TestEchoShellFactory.TestEchoShell.latch.await();
        } finally {
            TestEchoShellFactory.TestEchoShell.latch = null;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.