Package com.sun.enterprise.config

Examples of com.sun.enterprise.config.ConfigChange


    private void applyChangesToContext(ConfigContext configContext,
            List changeList) throws ConfigException {
        Iterator iter = changeList.iterator();
        ArrayList updates = new ArrayList();
        while (iter.hasNext()) {
            ConfigChange change = (ConfigChange)iter.next();
            if (change instanceof ConfigUpdate && 
                               isAppRefConfigChangeForThisInst(change)) {
                updates.add(change);
            } else {
                if(change instanceof ConfigAdd)
                {
                    // here we are trying to avoid config elements duplication 
                    // especially for applying of "dependent" changes
                    // this temporary solution should be removed after Toby will implement
                    // config-level validator rejecting such changes
                    try
                    {
                        if(ConfigBeansFactory.getConfigBeanByXPath(configContext, change.getXPath())!=null)
                        {
                            try
                            {
                                // we delete existing bean to get fresh copy (it is esp. significant for deployedModules)
                                ConfigDelete delete_prior = ConfigChangeFactory.createConfigDelete(change.getXPath());
                                configContext.updateFromConfigChange(delete_prior);
                            } catch(Exception e) {
                                logger.log(Level.WARNING, "event.delete_prior_ctx_failed", e);
                            }
                        }
View Full Code Here


            ConfigContext configContext = event.getConfigContext();
            Config config = ServerBeansFactory.getConfigBean(configContext);
           
            if ( config == null) return;
           
            ConfigChange configChange = null;
            ArrayList<ConfigChange> configChangeList =
                event.getConfigChangeList();
            HttpListener httpBean = null;
            String xpath = null;
            String parentXpath = null;
            Object object;
            ElementProperty elementProperty = null;

            for (int i=0; i < configChangeList.size(); i++){
                configChange = configChangeList.get(i);
                xpath = configChange.getXPath();
                if (xpath != null) {
                    object = configContext.exactLookup(xpath);
                    if (object != null) {
                        if (object instanceof HttpListener) {
                           
                            if ( ((HttpListener)object).getDefaultVirtualServer()
                                    .equals(com.sun.enterprise.web.VirtualServer.ADMIN_VS)){
                               
                                if (configChangeList.size() == 1){
                                    throw new AdminEventListenerException("Restart required");
                                } else {
                                    continue;
                                }                               
                            }
                           
                            webContainer.updateConnector(
                                (HttpListener)object,
                                config.getHttpService(),
                                configContext);
                        } else if (object instanceof ElementProperty) {
                            // Property has been added or updated
                            parentXpath = configChange.getParentXPath();
                            if (parentXpath == null) {
                                parentXpath =
                                    xpath.substring(0, xpath.lastIndexOf("/"));
                            }
                            httpBean = (HttpListener)
View Full Code Here

            ConfigContext configContext = event.getConfigContext();
            Config config = ServerBeansFactory.getConfigBean(configContext);
           
            if ( config == null) return;
           
            ConfigChange configChange = null;
            ArrayList<ConfigChange> configChangeList =
                event.getConfigChangeList();
            VirtualServer vsBean = null;
            String xpath = null;
            String parentXpath = null;
            Server serverBean = ServerBeansFactory.getServerBean(configContext);
            ElementProperty elementProperty = null;
            Object object;          

            for (int i=0; i < configChangeList.size(); i++){
                configChange = configChangeList.get(i);
               
                xpath = configChange.getXPath();
                if (xpath != null) {
                    object = configContext.exactLookup(xpath);
                    if (object != null) {
                        if ( object instanceof VirtualServer){
                            webContainer.updateHost((VirtualServer)object,
                                                    config.getHttpService(),
                                                    serverBean);
                        } else if (object instanceof ElementProperty) {
                            // Property has been added or updated
                            parentXpath = configChange.getParentXPath();
                            if (parentXpath == null) {
                                parentXpath =
                                    xpath.substring(0, xpath.lastIndexOf("/"));
                            }
                            vsBean = (VirtualServer)
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.ConfigChange

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.