Examples of StandardSession


Examples of org.apache.catalina.session.StandardSession

  }

  public HttpSession deserialize(byte[] data, HttpSession session)
      throws IOException, ClassNotFoundException {

    StandardSession standardSession = (StandardSession) session;

    BufferedInputStream bis = new BufferedInputStream(
        new ByteArrayInputStream(data));

    ObjectInputStream ois = new CustomObjectInputStream(bis, loader);
    standardSession.setCreationTime(ois.readLong());
    standardSession.readObjectData(ois);

    return session;
  }
View Full Code Here

Examples of org.apache.catalina.session.StandardSession

            return ids;
        }
    }

    public Session load(String id) throws ClassNotFoundException, IOException {
        StandardSession _session = null;
        GenericValue sessionValue = null;
        try {
            sessionValue = delegator.findByPrimaryKey(entityName, UtilMisc.toMap("sessionId", id));
        } catch (GenericEntityException e) {
            throw new IOException(e.getMessage());
        }

        if (sessionValue != null) {
            byte[] bytes = sessionValue.getBytes("sessionInfo");
            if (bytes != null) {
                BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(bytes));

                Container container = manager.getContainer();
                ClassLoader classLoader = null;
                Loader loader = null;

                if (container != null) {
                    loader = container.getLoader();
                }
                if (loader != null) {
                    classLoader = loader.getClassLoader();
                }

                ObjectInputStream ois = null;
                if (classLoader != null) {
                    ois = new CustomObjectInputStream(bis, classLoader);
                } else {
                    ois = new ObjectInputStream(bis);
                }

                //Debug.logInfo("Loading Session Store [" + id + "]", module);
                _session = (StandardSession) manager.createEmptySession();
                _session.readObjectData(ois);
                _session.setManager(manager);
            }
        }

        return _session;
    }
View Full Code Here

Examples of org.eclipse.jetty.spdy.StandardSession

        SPDYConnection connection = new ClientSPDYConnection(endPoint, byteBufferPool, parser, factory, client.isDispatchIO());

        FlowControlStrategy flowControlStrategy = client.newFlowControlStrategy();

        SessionFrameListener listener = (SessionFrameListener)context.get(SPDY_SESSION_LISTENER_CONTEXT_KEY);
        StandardSession session = new StandardSession(client.getVersion(), byteBufferPool,
                factory.getScheduler(), connection, endPoint, connection, 1, listener, generator, flowControlStrategy);

        session.setWindowSize(client.getInitialWindowSize());
        parser.addListener(session);
        connection.setSession(session);

        @SuppressWarnings("unchecked")
        Promise<Session> promise = (Promise<Session>)context.get(SPDY_SESSION_PROMISE_CONTEXT_KEY);
View Full Code Here

Examples of org.eclipse.jetty.spdy.StandardSession

        SPDYConnection connection = new ServerSPDYConnection(connector, endPoint, parser, listener,
                isDispatchIO(), getInputBufferSize());

        FlowControlStrategy flowControlStrategy = newFlowControlStrategy(version);

        StandardSession session = new StandardSession(getVersion(), connector.getByteBufferPool(),
                connector.getScheduler(), connection, endPoint, connection, 2, listener,
                generator, flowControlStrategy);
        session.setWindowSize(getInitialWindowSize());
        parser.addListener(session);
        connection.setSession(session);

        sessionOpened(session);
View Full Code Here

Examples of org.eclipse.jetty.spdy.StandardSession

public class ClientUsageTest
{
    @Test
    public void testClientRequestResponseNoBody() throws Exception
    {
        Session session = new StandardSession(SPDY.V2, null, null, null, null, null, 1, null, null, null);

        session.syn(new SynInfo(new Fields(), true), new StreamFrameListener.Adapter()
        {
            @Override
            public void onReply(Stream stream, ReplyInfo replyInfo)
            {
                // Do something with the response
View Full Code Here

Examples of org.eclipse.jetty.spdy.StandardSession

    }

    @Test
    public void testClientReceivesPush1() throws InterruptedException, ExecutionException, TimeoutException
    {
        Session session = new StandardSession(SPDY.V2, null, null, null, null, null, 1, null, null, null);

        session.syn(new SynInfo(new Fields(), true), new StreamFrameListener.Adapter()
        {
            public StreamFrameListener onPush(Stream stream, PushInfo pushInfo)
            {
                return new Adapter()
                {
View Full Code Here

Examples of org.eclipse.jetty.spdy.StandardSession

    }

    @Test
    public void testClientReceivesPush2() throws InterruptedException, ExecutionException, TimeoutException
    {
        Session session = new StandardSession(SPDY.V2, null, null, null, null, null, 1, new SessionFrameListener.Adapter()
        {
            public StreamFrameListener onPush(Stream stream, PushInfo pushInfo)
            {
                return new StreamFrameListener.Adapter()
                {
                    @Override
                    public void onData(Stream stream, DataInfo dataInfo)
                    {
                    }
                };
            }
        }, null, null);

        session.syn(new SynInfo(new Fields(), true), new StreamFrameListener.Adapter()
        {
            @Override
            public void onReply(Stream stream, ReplyInfo replyInfo)
            {
                // Do something with the response
View Full Code Here

Examples of org.eclipse.jetty.spdy.StandardSession

    }

    @Test
    public void testClientRequestWithBodyResponseNoBody() throws Exception
    {
        Session session = new StandardSession(SPDY.V2, null, null, null, null, null, 1, null, null, null);

        Stream stream = session.syn(new SynInfo(5, TimeUnit.SECONDS, new Fields(), false, (byte)0),
                new StreamFrameListener.Adapter()
                {
                    @Override
                    public void onReply(Stream stream, ReplyInfo replyInfo)
                    {
View Full Code Here

Examples of org.eclipse.jetty.spdy.StandardSession

    }

    @Test
    public void testAsyncClientRequestWithBodyResponseNoBody() throws Exception
    {
        Session session = new StandardSession(SPDY.V2, null, null, null, null, null, 1, null, null, null);

        final String context = "context";
        session.syn(new SynInfo(new Fields(), false), new StreamFrameListener.Adapter()
                {
                    @Override
                    public void onReply(Stream stream, ReplyInfo replyInfo)
                    {
                        // Do something with the response
View Full Code Here

Examples of org.eclipse.jetty.spdy.StandardSession

    }

    @Test
    public void testAsyncClientRequestWithBodyAndResponseWithBody() throws Exception
    {
        Session session = new StandardSession(SPDY.V2, null, null, null, null, null, 1, null, null, null);

        session.syn(new SynInfo(new Fields(), false), new StreamFrameListener.Adapter()
                {
                    // The good of passing the listener to push() is that applications can safely
                    // accumulate info from the reply headers to be used in the data callback,
                    // e.g. content-type, charset, etc.
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.