Package org.glassfish.grizzly.http.server

Examples of org.glassfish.grizzly.http.server.Session


       
        /*
         * This is the main JAR, so combine it with the previously-generated
         * and saved main JNLP document.
         */
        final Session session = gReq.getSession();
        final Object jwsObj = session.getAttribute(AppClientHTTPAdapter.GF_JWS_SESSION_CACHED_JNLP_NAME);
        if (jwsObj == null) {
            logger.log(Level.FINE, "Session {0} did not contain cached JNLP", session.getIdInternal());
            throw new NullPointerException();
        }
        if ( ! (jwsObj instanceof byte[])) {
            logger.log(Level.FINE, "Session {0} cached JNLP is not a byte[] as expected", session.getIdInternal());
            throw new IllegalArgumentException(jwsObj.getClass().toString());
        }

        /*
         * We do not know the finished length so we cannot set Content-Length.
View Full Code Here


    public void service(Request gReq, Response gResp) {
        if (logger.isLoggable(Level.FINER)) {
            dumpHeaders(gReq);
        }
        final String savedRequestURI = gReq.getRequestURI();
        Session s = gReq.getSession(false);
        logger.log(Level.FINE, "Req " + savedRequestURI + ", session was " + (s == null ? "NONE" : s.getIdInternal() + ":" + s.getSessionTimeout()));
        final String relativeURIString =
                relativizeURIString(contextRoot(), savedRequestURI);
        if (relativeURIString == null) {
            respondNotFound(gResp);
        } else if (dynamicContent.containsKey(relativeURIString)) {
View Full Code Here

        /*
         * If this is a request for the main JNLP document then the GF JWS-related
         * session attribute will not be present.  In that case, save the just-
         * generated JNLP content as a session attribute.
         */
        final Session session = gReq.getSession();
       
       
        final Boolean isMainJNLPProcessed = booleanAttr(session.getAttribute(GF_JWS_SESSION_IS_MAIN_PROCESSED_NAME));
        if ( ! isMainJNLPProcessed) {
            byte[] jnlp;
            jnlp = text.getBytes();
            session.setAttribute(GF_JWS_SESSION_IS_MAIN_PROCESSED_NAME, Boolean.TRUE);
            session.setAttribute(GF_JWS_SESSION_CACHED_JNLP_NAME, jnlp);
            logger.log(Level.FINE, "Session {1} contains no GF/JWS attr; caching {0} and setting attr to main JNLP content",
                    new Object[] {requestURI, session.getIdInternal()});
        } else {
            logger.log(Level.FINE, "Session {0} already contains cached JNLP", session.getIdInternal());
        }
    }
View Full Code Here

TOP

Related Classes of org.glassfish.grizzly.http.server.Session

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.