Package org.apache.axis2.context

Examples of org.apache.axis2.context.SessionContext


        Parameter scopeParam = service.getParameter(SCOPE);
        QName serviceName = service.getName();
        if (scopeParam != null
            && Constants.SESSION_SCOPE.equals(scopeParam.getValue())) {
            SessionContext sessionContext = msgContext.getSessionContext();
            synchronized (sessionContext) {
                Object obj =
                    sessionContext.getProperty(serviceName.getLocalPart());
                if (obj == null) {
                    obj = makeNewServiceObject(msgContext);
                    sessionContext.setProperty(serviceName.getLocalPart(), obj);
                }
                return obj;
            }
        } else if (
            scopeParam != null
View Full Code Here


    private void fillContextsFromSessionContext(MessageContext msgContext) throws AxisFault {
        AxisService service = msgContext.getAxisService();
        if (service == null) {
            throw new AxisFault(Messages.getMessage("unabletofindservice"));
        }
        SessionContext sessionContext = msgContext.getSessionContext();
        if (sessionContext == null) {
            TransportListener listener = msgContext.getTransportIn().getReceiver();
            sessionContext = listener.getSessionContext(msgContext);
            if (sessionContext == null) {
                createAndFillContexts(service, msgContext, sessionContext);
                return;
            }
        }
        String serviceGroupName = msgContext.getAxisServiceGroup().getServiceGroupName();
        ServiceGroupContext serviceGroupContext =
                sessionContext.getServiceGroupContext(serviceGroupName);
        if (serviceGroupContext != null) {
            //setting service group context
            msgContext.setServiceGroupContext(serviceGroupContext);
            // setting Service context
            msgContext.setServiceContext(serviceGroupContext.getServiceContext(service));
        } else {
            createAndFillContexts(service, msgContext, sessionContext);
        }
        ServiceContext serviceContext = sessionContext.getServiceContext(service);
        //found the serviceContext from session context , so adding that into msgContext
        if (serviceContext != null) {
            msgContext.setServiceContext(serviceContext);
            serviceContext.setProperty(HTTPConstants.COOKIE_STRING, sessionContext.getCookieID());
        }
    }
View Full Code Here

    }

    public SessionContext getSessionContext(MessageContext messageContext) {
        HttpServletRequest req = (HttpServletRequest) messageContext.getProperty(
                HTTPConstants.MC_HTTP_SERVLETREQUEST);
        SessionContext sessionContext =
                (SessionContext) req.getSession(true).getAttribute(
                        Constants.SESSION_CONTEXT_PROPERTY);
        String sessionId = req.getSession().getId();
        if (sessionContext == null) {
            sessionContext = new SessionContext(null);
            sessionContext.setCookieID(sessionId);
            req.getSession().setAttribute(Constants.SESSION_CONTEXT_PROPERTY,
                                          sessionContext);
        }
        messageContext.setSessionContext(sessionContext);
        messageContext.setProperty(AxisServlet.SESSION_ID, sessionId);
View Full Code Here

    }

    public SessionContext getSessionContext(MessageContext messageContext) {
        HttpServletRequest req = (HttpServletRequest) messageContext.getProperty(
                HTTPConstants.MC_HTTP_SERVLETREQUEST);
        SessionContext sessionContext =
                (SessionContext) req.getSession(true).getAttribute(
                        Constants.SESSION_CONTEXT_PROPERTY);
        String sessionId = null;
        try {
            sessionId = req.getSession().getId();
            if (sessionContext == null) {
            sessionContext = new SessionContext(null);
            sessionContext.setCookieID(sessionId);
            req.getSession().setAttribute(Constants.SESSION_CONTEXT_PROPERTY,
                                          sessionContext);
        }
        } catch (Throwable t){
            log.info("Old Servlet API :" + t);
View Full Code Here

     * @return SessionContext
     */
    public SessionContext getSessionContext(MessageContext messageContext) {
        HttpServletRequest req = (HttpServletRequest) messageContext.getProperty(
                HTTPConstants.MC_HTTP_SERVLETREQUEST);
        SessionContext sessionContext =
                (SessionContext) req.getSession(true).getAttribute(
                        Constants.SESSION_CONTEXT_PROPERTY);
        String sessionId = req.getSession().getId();
        if (sessionContext == null) {
            sessionContext = new SessionContext(null);
            sessionContext.setCookieID(sessionId);
            req.getSession().setAttribute(Constants.SESSION_CONTEXT_PROPERTY,
                    sessionContext);
        }
        messageContext.setSessionContext(sessionContext);
        messageContext.setProperty(SESSION_ID, sessionId);
View Full Code Here

    private Object getSessionContext(HttpServletRequest httpServletRequest) {
        Object sessionContext =
                httpServletRequest.getSession().getAttribute(Constants.SESSION_CONTEXT_PROPERTY);
        if (sessionContext == null) {
            sessionContext = new SessionContext(null);
            httpServletRequest.getSession().setAttribute(Constants.SESSION_CONTEXT_PROPERTY,
                    sessionContext);
        }
        return sessionContext;
    }
View Full Code Here

        Parameter scopeParam = service.getParameter(SCOPE);
        QName serviceName = service.getName();
        if (scopeParam != null
            && Constants.SESSION_SCOPE.equals(scopeParam.getValue())) {
            SessionContext sessionContext = msgContext.getSessionContext();
            synchronized (sessionContext) {
                Object obj =
                    sessionContext.getProperty(serviceName.getLocalPart());
                if (obj == null) {
                    obj = makeNewServiceObject(msgContext);
                    sessionContext.setProperty(serviceName.getLocalPart(), obj);
                }
                return obj;
            }
        } else if (
            scopeParam != null
View Full Code Here

    public MiscTest(String testName) {
        super(testName);
    }

    public void testSessionContext() {
        SessionContext sc = new SessionContext(null);
        String key = "Hello";
        Object val = new Object();
        sc.setProperty(key, val);
        assertEquals(sc.getProperty(key), val);
    }
View Full Code Here

    protected Object getSessionContext(HttpServletRequest httpServletRequest) {
        Object sessionContext =
                httpServletRequest.getSession(true).getAttribute(Constants.SESSION_CONTEXT_PROPERTY);
        if (sessionContext == null) {
            sessionContext = new SessionContext(null);
            httpServletRequest.getSession().setAttribute(Constants.SESSION_CONTEXT_PROPERTY,
                    sessionContext);
        }
        return sessionContext;
    }
View Full Code Here

            msgContext.setConfigurationContext(this.configurationContext);

            String sessionKey = (String) this.httpcontext.getAttribute(HTTPConstants.COOKIE_STRING);
            if (this.configurationContext.getAxisConfiguration().isManageTransportSession()) {
                SessionContext sessionContext = this.sessionManager.getSessionContext(sessionKey);
                msgContext.setSessionContext(sessionContext);
            }
            msgContext.setTransportIn(transportIn);
            msgContext.setTransportOut(transportOut);
            msgContext.setServiceGroupContextId(UUIDGenerator.getUUID());
View Full Code Here

TOP

Related Classes of org.apache.axis2.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.