Package org.apache.webbeans.context

Examples of org.apache.webbeans.context.SessionContext


    }

   
    private void startSessionContext(Object instance) throws Exception
    {
        SessionContext ctx = new SessionContext();
        ctx.setActive(true);
       
        sessionContext.set(ctx);
    }
View Full Code Here


     */
    private void initSessionContext(HttpSession session)
    {
        String sessionId = session.getId();
        //Current context
        SessionContext currentSessionContext = sessionCtxManager.getSessionContextWithSessionId(sessionId);
       
        //No current context
        if (currentSessionContext == null)
        {
            currentSessionContext = new SessionContext();
            sessionCtxManager.addNewSessionContext(sessionId, currentSessionContext);
        }

        //Activate
        currentSessionContext.setActive(true);
       
        //Set thread local
        sessionContext.set(currentSessionContext);
    }
View Full Code Here

     * @param session http session object
     */
    private void destroySessionContext(HttpSession session)
    {
        //Get current session context
        SessionContext context = sessionContext.get();

        //Destroy context
        if (context != null)
        {
            context.destroy();
        }

        //Clear thread locals
        sessionContext.set(null);
        sessionContext.remove();
View Full Code Here

     * @return session context
     */
    private  SessionContext getSessionContext()
    {

        SessionContext context = sessionContext.get();
        if (null == context)
        {
            lazyStartSessionContext();
            context = sessionContext.get();
        }
View Full Code Here

     * Destroy session context with given id.
     * @param sessionId session id
     */
    public void destroySessionContextWithSessionId(String sessionId)
    {
        SessionContext sessionContext = this.sessionContexts.remove(sessionId);
        if(sessionContext != null)
        {
            sessionContext.destroy();
        }
    }
View Full Code Here

    }

   
    private void startSessionContext(Object instance) throws Exception
    {
        SessionContext ctx = new SessionContext();
        ctx.setActive(true);
       
        sessionContext.set(ctx);
    }
View Full Code Here

     */
    private void initSessionContext(HttpSession session)
    {
        String sessionId = session.getId();
        //Current context
        SessionContext currentSessionContext = sessionCtxManager.getSessionContextWithSessionId(sessionId);
       
        //No current context
        if (currentSessionContext == null)
        {
            currentSessionContext = new SessionContext();
            sessionCtxManager.addNewSessionContext(sessionId, currentSessionContext);
        }

        //Activate
        currentSessionContext.setActive(true);
       
        //Set thread local
        sessionContext.set(currentSessionContext);
    }
View Full Code Here

     * @param session http session object
     */
    private void destroySessionContext(HttpSession session)
    {
        //Get current session context
        SessionContext context = getSessionContext();
       
        //Destroy context
        if (context != null)
        {
            context.destroy();
        }

        //Clear thread locals
        sessionContext.set(null);
        sessionContext.remove();
View Full Code Here

            return;
        }

        final String sessionId = session.getId();
        //Current context
        SessionContext currentSessionContext = sessionCtxManager.getSessionContextWithSessionId(sessionId);

        //No current context
        if (currentSessionContext == null) {
            currentSessionContext = newSessionContext(session);
            sessionCtxManager.addNewSessionContext(sessionId, currentSessionContext);
        }
        //Activate
        currentSessionContext.setActive(true);

        //Set thread local
        sessionContext.set(currentSessionContext);
    }
View Full Code Here

            } catch (final Exception e) {
                logger.error("Can't instantiate " + classname + ", using default session context", e);
            }
        }
        return new SessionContext();
    }
View Full Code Here

TOP

Related Classes of org.apache.webbeans.context.SessionContext

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.