Package com.sun.enterprise.deployment.runtime.web

Examples of com.sun.enterprise.deployment.runtime.web.SessionManager


     */
    protected void configureSessionSettings(WebBundleDescriptor wbd,
                                            WebModuleConfig wmInfo) {

        SessionConfig cfg = null;
        SessionManager smBean = null;
        SessionProperties sessionPropsBean = null;
        CookieProperties cookieBean = null;

        if (iasBean != null) {
            cfg = iasBean.getSessionConfig();
View Full Code Here


    protected void configureSessionManager(SessionManager httpSmBean,
        WebBundleDescriptor wbd, WebModuleConfig wmInfo) {

        SessionConfig sipSessionConfig =
            ((SipBundleDescriptor) wbd).getSunSipSessionConfig();
        SessionManager sipSmBean = null;
        if (sipSessionConfig != null) {
            sipSmBean = sipSessionConfig.getSessionManager();
        }

        ConvergedSessionManagerConfigurationHelper configHelper =
View Full Code Here

                    }
                }
            }

            // invalidation-interval-secs, max-in-memory-sessions
            SessionManager sessionManager = runtimeSessionConfig.getSessionManager();
            if (sessionManager != null) {
                ManagerProperties managerProperties = sessionManager.getManagerProperties();
                if (managerProperties != null && managerProperties.sizeWebProperty() > 0) {
                    for (WebProperty prop : managerProperties.getWebProperty()) {
                        String name = prop.getAttributeValue(WebProperty.NAME);
                        String value = prop.getAttributeValue(WebProperty.VALUE);
                        if (name.equals(REAP_INTERVAL_SECONDS)) {
                            appendTextChild(scNode,
                                    RuntimeTagNames.INVALIDATION_INTERVAL_SECS, value);
                        } else if (name.equals(MAX_SESSIONS)) {
                            appendTextChild(scNode,
                                    RuntimeTagNames.MAX_IN_MEMORY_SESSIONS, value);
                        }
                    }
                }
            }
        }

        if (sessionConfig != null) {
            Set<SessionTrackingMode> trackingModes = sessionConfig.getTrackingModes();
            if (trackingModes.contains(SessionTrackingMode.COOKIE)) {
                appendTextChild(scNode, RuntimeTagNames.COOKIES_ENABLED, "true");
            }

            CookieConfig cookieConfig = sessionConfig.getCookieConfig();
            if (cookieConfig != null) {
                if (cookieConfig.getName() != null && cookieConfig.getName().length() > 0) {
                    appendTextChild(scNode, RuntimeTagNames.COOKIE_NAME, cookieConfig.getName());
                }
                if (cookieConfig.getPath() != null) {
                    appendTextChild(scNode, RuntimeTagNames.COOKIE_PATH, cookieConfig.getPath());
                }
                if (cookieConfig.getDomain() != null) {
                    appendTextChild(scNode, RuntimeTagNames.COOKIE_DOMAIN, cookieConfig.getDomain());
                }
                if (cookieConfig.getComment() != null) {
                    appendTextChild(scNode, RuntimeTagNames.COOKIE_COMMENT, cookieConfig.getComment());
                }
                appendTextChild(scNode, RuntimeTagNames.COOKIE_SECURE,
                        Boolean.toString(cookieConfig.isSecure()));
                appendTextChild(scNode, RuntimeTagNames.COOKIE_MAX_AGE_SECS,
                        Integer.toString(cookieConfig.getMaxAge()));
                appendTextChild(scNode, RuntimeTagNames.COOKIE_HTTP_ONLY,
                        Boolean.toString(cookieConfig.isHttpOnly()));
            }

            if (trackingModes.contains(SessionTrackingMode.URL)) {
                appendTextChild(scNode, RuntimeTagNames.URL_REWRITING_ENABLED, "true");
            }
        }

        if (runtimeSessionConfig != null) {
            // persistent-store-dir
            SessionManager sessionManager = runtimeSessionConfig.getSessionManager();
            if (sessionManager != null) {
                StoreProperties storeProperties = sessionManager.getStoreProperties();
                if (storeProperties != null && storeProperties.sizeWebProperty() > 0) {
                    for (WebProperty prop : storeProperties.getWebProperty()) {
                        String name = prop.getAttributeValue(WebProperty.NAME);
                        String value = prop.getAttributeValue(WebProperty.VALUE);
                        if (name.equals(DIRECTORY)) {
View Full Code Here

    /**
     * Add Manager property.
     */
    private void addManagerProperty(String name, String value) {
        SessionManager sessionManager = getSessionManager();
        ManagerProperties managerProperties = sessionManager.getManagerProperties();
        if (managerProperties == null) {
            managerProperties = new ManagerProperties();
            sessionManager.setManagerProperties(managerProperties);
        }

        addWebProperty(managerProperties, name, value);
    }
View Full Code Here

    /**
     * Add Store Property.
     */
    private void addStoreProperty(String name, String value) {
        SessionManager sessionManager = getSessionManager();
        StoreProperties storeProperties = sessionManager.getStoreProperties();
        if (storeProperties == null) {
            storeProperties = new StoreProperties();
            sessionManager.setStoreProperties(storeProperties);
        }

        addWebProperty(storeProperties, name, value);
    }
View Full Code Here

     * Get and create a SessionManager if necessary.
     */
    private SessionManager getSessionManager() {
        com.sun.enterprise.deployment.runtime.web.SessionConfig runtimeSessionConfig =
                getRuntimeSessionConfig();
        SessionManager sessionManager = runtimeSessionConfig.getSessionManager();
        if (sessionManager == null) {
            sessionManager = new SessionManager();
            runtimeSessionConfig.setSessionManager(sessionManager);
        }

        return sessionManager;
    }
View Full Code Here

        if (wmInfo.getDescriptor() != null &&
                wmInfo.getDescriptor().getSunDescriptor() != null) {
            SunWebApp sunWebApp = wmInfo.getDescriptor().getSunDescriptor();
            if (sunWebApp.getSessionConfig() != null &&
                    sunWebApp.getSessionConfig().getSessionManager() != null) {
                SessionManager sessionManager =
                    sunWebApp.getSessionConfig().getSessionManager();
                String persistenceType = sessionManager.getAttributeValue(
                    SessionManager.PERSISTENCE_TYPE);
                if (PersistenceType.COHERENCE_WEB.getType().equals(persistenceType)) {
                    ClassLoader cloader = wmInfo.getAppClassLoader();
                    try {
                        Class<?> cacheFactoryClass = cloader.loadClass(
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.runtime.web.SessionManager

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.