Package com.sun.appserv.management.config

Examples of com.sun.appserv.management.config.SessionConfig


        @HandlerOutput(name="Properties",           type=Map.class)})
       
        public static void getWebSessionProps(HandlerContext handlerCtx) {
        String configName = (String) handlerCtx.getInputValue("ConfigName");
        ConfigConfig config = AMXUtil.getConfig(configName);
        SessionConfig sessionConfig = config.getWebContainerConfig().getSessionConfig()
        Map<String, String> props = new HashMap();
        if(sessionConfig != null){
            SessionPropertiesConfig ssPropConfig = sessionConfig.getSessionPropertiesConfig();
            if(ssPropConfig != null){
                String sessTimeout = ssPropConfig.getTimeoutInSeconds();
                handlerCtx.setOutputValue("SessionTimeout", sessTimeout);
                props = ssPropConfig.getProperties();
            }
View Full Code Here


        @HandlerInput(name="RemoveProps",       type=ArrayList.class)})
       
        public static void saveWebSessionValues(HandlerContext handlerCtx) {
        String configName = (String) handlerCtx.getInputValue("ConfigName");
        ConfigConfig config = AMXUtil.getConfig(configName);
        SessionConfig sessionConfig = config.getWebContainerConfig().getSessionConfig();
        try{
            String sessTimeout = (String)handlerCtx.getInputValue("SessionTimeout");
            if((sessionConfig != null) && (sessionConfig.getSessionPropertiesConfig() != null)) {
                sessionConfig.getSessionPropertiesConfig().setTimeoutInSeconds(sessTimeout);
            }else {
                String objName = "com.sun.appserv:type=configs,category=config";
                String opername = "createSessionProperties";
                String[] signature = {"javax.management.AttributeList", "java.util.Properties", "java.lang.String"};

                AttributeList attrList = new AttributeList();
                attrList.add(new Attribute("timeout-in-seconds", sessTimeout));
                Properties props = new Properties();
                Object[] params = {attrList, props, configName};
                JMXUtil.invoke(objName, opername, params, signature);
                sessionConfig = config.getWebContainerConfig().getSessionConfig();          
                //AMX API CAlls for the same - Not working currently
                /*
                if(sessionConfig == null)
                    sessionConfig = config.getWebContainerConfig().createSessionConfig();
                Map props = new HashMap();
                props.put("TimeoutInSeconds", sessTimeout);
                SessionPropertiesConfig propConfig = sessionConfig.createSessionPropertiesConfig(props);
                propConfig.setTimeoutInSeconds(sessTimeout);
                */
            }   
            AMXUtil.editProperties(handlerCtx, sessionConfig.getSessionPropertiesConfig());
        }catch(Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

        @HandlerOutput(name="Properties",         type=Map.class)})
       
        public static void getWebManagerProps(HandlerContext handlerCtx) {
        String configName = (String) handlerCtx.getInputValue("ConfigName");
        ConfigConfig config = AMXUtil.getConfig(configName);
        SessionConfig sessionConfig = config.getWebContainerConfig().getSessionConfig();
        Map<String, String> props = new HashMap();
        if(sessionConfig != null){
            SessionManagerConfig sessMgrConfig = sessionConfig.getSessionManagerConfig();
            if(sessMgrConfig != null){
                ManagerPropertiesConfig mgrPropConfig = sessMgrConfig.getManagerPropertiesConfig();
                if(mgrPropConfig != null){
                    String reapInterval = mgrPropConfig.getReapIntervalInSeconds();
                    String maxSessions = mgrPropConfig.getMaxSessions();
View Full Code Here

        @HandlerInput(name="RemoveProps",        type=ArrayList.class)})

        public static void saveWebManagerProps(HandlerContext handlerCtx) {
            String configName = (String) handlerCtx.getInputValue("ConfigName");
            ConfigConfig config = AMXUtil.getConfig(configName);
            SessionConfig sessionConfig = config.getWebContainerConfig().getSessionConfig();
       
            try{
                String reapInterval = (String)handlerCtx.getInputValue("ReapInterval");
                String maxSessions = (String)handlerCtx.getInputValue("MaxSessions");
                String sessFileName = (String)handlerCtx.getInputValue("SessFileName");
                String sessionIdgen = (String)handlerCtx.getInputValue("SessionIdGen");
                if((sessionConfig != null) && (sessionConfig.getSessionManagerConfig() != null)
                    && (sessionConfig.getSessionManagerConfig().getManagerPropertiesConfig() != null)) {
                    ManagerPropertiesConfig mgrPropConfig = sessionConfig.getSessionManagerConfig().getManagerPropertiesConfig();
                    mgrPropConfig.setReapIntervalInSeconds(reapInterval);
                    mgrPropConfig.setMaxSessions(maxSessions);
                    mgrPropConfig.setSessionFileName(sessFileName);
                    mgrPropConfig.setSessionIdGeneratorClassname(sessionIdgen);
                    AMXUtil.editProperties(handlerCtx, mgrPropConfig);
                }else{
                    String objName = "com.sun.appserv:type=configs,category=config";
                    String opername = "createManagerProperties";
                    String[] signature = {"javax.management.AttributeList", "java.util.Properties", "java.lang.String"};

                    AttributeList attrList = new AttributeList();
                    attrList.add(new Attribute("reap-interval-in-seconds", reapInterval));
                    attrList.add(new Attribute("max-sessions", maxSessions));
                    attrList.add(new Attribute("session-file-name", sessFileName));
                    attrList.add(new Attribute("session-id-generator-classname", sessionIdgen));

                    Properties props = new Properties();
                    Object[] params = {attrList, props, configName};
                    JMXUtil.invoke(objName, opername, params, signature);

                    sessionConfig = config.getWebContainerConfig().getSessionConfig();
                    ManagerPropertiesConfig mgrPropConfig = sessionConfig.getSessionManagerConfig().getManagerPropertiesConfig();
                    AMXUtil.editProperties(handlerCtx, mgrPropConfig);

                    //AMX API CAlls for the same - Not working currently
                    /*
                    if(sessionConfig == null)
View Full Code Here

        @HandlerOutput(name="Properties",       type=Map.class) })
       
        public static void getWebStoreProps(HandlerContext handlerCtx) {
        String configName = (String) handlerCtx.getInputValue("ConfigName");
        ConfigConfig config = AMXUtil.getConfig(configName);
        SessionConfig sessionConfig = config.getWebContainerConfig().getSessionConfig();
        Map <String, String> props = new HashMap();
        if(sessionConfig != null){
            SessionManagerConfig sessMgrConfig = sessionConfig.getSessionManagerConfig();
            if(sessMgrConfig != null){
                StorePropertiesConfig storePropConfig = sessMgrConfig.getStorePropertiesConfig();
                if(storePropConfig != null){
                    String reapInterval = storePropConfig.getReapIntervalInSeconds();
                    String directory = storePropConfig.getDirectory();
View Full Code Here

        @HandlerInput(name="RemoveProps",      type=ArrayList.class) })

        public static void saveWebStoreProps(HandlerContext handlerCtx) {
            String configName = (String) handlerCtx.getInputValue("ConfigName");
            ConfigConfig config = AMXUtil.getConfig(configName);
            SessionConfig sessionConfig = config.getWebContainerConfig().getSessionConfig();
            try{
                String reapInterval = (String)handlerCtx.getInputValue("ReapInterval");
                String directory = (String)handlerCtx.getInputValue("Directory");
                if((sessionConfig != null) && (sessionConfig.getSessionManagerConfig() != null)
                    && (sessionConfig.getSessionManagerConfig().getStorePropertiesConfig() != null)) {
                        StorePropertiesConfig storePropConfig = sessionConfig.getSessionManagerConfig().getStorePropertiesConfig();
                        storePropConfig.setReapIntervalInSeconds(reapInterval);
                        storePropConfig.setDirectory(directory);
                        AMXUtil.editProperties(handlerCtx, storePropConfig);
                }else{
                    String objName = "com.sun.appserv:type=configs,category=config";
                    String opername = "createStoreProperties";
                    String[] signature = {"javax.management.AttributeList", "java.util.Properties", "java.lang.String"};

                    AttributeList attrList = new AttributeList();
                    attrList.add(new Attribute("reap-interval-in-seconds", reapInterval));
                    attrList.add(new Attribute("directory", directory));

                    Properties props = new Properties();
                    Object[] params = {attrList, props, configName};
                    JMXUtil.invoke(objName, opername, params, signature);
                    sessionConfig = config.getWebContainerConfig().getSessionConfig();
                    StorePropertiesConfig storePropConfig = sessionConfig.getSessionManagerConfig().getStorePropertiesConfig();
                    AMXUtil.editProperties(handlerCtx, storePropConfig);
                }
            }catch(Exception ex){
                GuiUtil.handleException(handlerCtx, ex);
            }
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.config.SessionConfig

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.