Package com.sun.enterprise.config

Examples of com.sun.enterprise.config.ConfigUpdate


    public void handleUpdate(ClusterChangeEvent clusterChangeEvent)
            throws AdminEventListenerException {
        Iterator<ConfigUpdate> changeListIter = clusterChangeEvent.
                getConfigChangeList().iterator();
        while (changeListIter.hasNext()) {
            ConfigUpdate change = changeListIter.next();
            String xpath= change.getXPath();
            String instanceName = getInstanceNameFromXPath(xpath);
            String newValue = change.getNewValue(LB_ENABLED_ATTRIBUTE);
            String oldValue = change.getOldValue(LB_ENABLED_ATTRIBUTE);
            if(newValue == null || oldValue == null){
                logger.log(Level.WARNING, "clb.cluster_change_update_event_not_for_lb_enabled_attribute");
                continue;
            }
            boolean lbEnabledNewValue = Boolean.parseBoolean(newValue);
View Full Code Here


    public void handleUpdate(IdentityAssertionTrustEvent ue) throws AdminEventListenerException {
        try {
            ConfigContext configContext = ue.getConfigContext();


            ConfigUpdate configUpdate = null;
            ArrayList configChangeList = ue.getConfigChangeList();

            String xpath = null;
            Server serverBean = ServerBeansFactory.getServerBean(configContext);
            ElementProperty elementProperty = null;
            Object object;
            Object configObject;

            for (int i = 0; i < configChangeList.size(); i++) {
                configObject = configChangeList.get(i);

                if (configObject instanceof ConfigUpdate) {
                    configUpdate = (ConfigUpdate)configObject;
                    xpath = configUpdate.getXPath();
                    object = configContext.exactLookup(xpath);
                    if (object instanceof IdentityAssertionTrust) {
                        IdentityAssertionTrust iat = (IdentityAssertionTrust) object;
                        PAssertedAuthenticator pa = new PAssertedAuthenticator(iat);
                        String key = iat.getId();
View Full Code Here

        {
            Object chg = changeList.get(i);
            if(!(chg instanceof ConfigUpdate) ||
                ElementChangeHelper.isPropertyChange((ConfigChange)chg))
               continue; //what if property changed ?
            ConfigUpdate update = (ConfigUpdate)chg;
            Set attrs = update.getAttributeSet();
            if (attrs != null)
            {
                Iterator iter = attrs.iterator();
                while (iter.hasNext()) {
                    String compName = (String)iter.next();
                    String oldValue = update.getOldValue(compName);
                    String newValue = update.getNewValue(compName);
                    LogLevelChangeEvent event = new LogLevelChangeEvent(instanceName);
                    event.setModuleName(compName);
                    event.setOldLogLevel(oldValue);
                    event.setNewLogLevel(newValue);
                    events.add(event);
                    ConfigUpdate upd = new ConfigUpdateImpl(update.getXPath(),
                            compName, oldValue,newValue);
//System.out.println("***********createLogLevelEvents."+compName +":"+oldValue+"->"+newValue+" target="+instanceName);
                    event.addConfigChange(upd);
                }
            }
View Full Code Here

        {
            Object chg = changeList.get(i);
            if(!(chg instanceof ConfigUpdate) ||
                ElementChangeHelper.isPropertyChange((ConfigChange)chg))
               continue; //what if property changed ?
            ConfigUpdate update = (ConfigUpdate)chg;
            Set attrs = update.getAttributeSet();
            if (attrs != null)
            {
                Iterator iter = attrs.iterator();
                while (iter.hasNext()) {
                    String compName = (String)iter.next();
                    String oldValue = update.getOldValue(compName);
                    String newValue = update.getNewValue(compName);
                    MonitoringLevelChangeEvent event = new MonitoringLevelChangeEvent(instanceName);
                    event.setComponentName(compName);
                    event.setOldMonitoringLevel(oldValue);
                    event.setNewMonitoringLevel(newValue);
                    events.add(event);
                    ConfigUpdate upd = new ConfigUpdateImpl(update.getXPath(),
                            compName, oldValue,newValue);
                    event.addConfigChange(upd);
                }
            }
        }
View Full Code Here

            ConfigContext configContext = event.getConfigContext();
            ConfigContext adminConfigCtx =
                        AdminService.getAdminService().
                        getAdminContext().getAdminConfigContext();
            Config config = ServerBeansFactory.getConfigBean(configContext);
            ConfigUpdate configUp = null;
            ArrayList<ConfigUpdate> configChangeList = event.getConfigChangeList();
            String xPath = null;
            Object object;

            for (int i=0; i < configChangeList.size(); i++){
          if (configChangeList.get(i) instanceof ConfigAdd ||
        configChangeList.get(i) instanceof ConfigSet ||
        configChangeList.get(i) instanceof ConfigDelete) {
        ConfigChange change = configChangeList.get(i);
        xPath =  change.getXPath();
          } else {
                    configUp = configChangeList.get(i);
                    xPath = configUp.getXPath();
          }
                if (xPath!=null) {
                    _logger.log(Level.INFO,"sgmt.handleupdatexpath", xPath);
                    object = configContext.exactLookup(xPath);
                    if (object instanceof ManagementRules) {
View Full Code Here

     */
    private boolean processLevelChangeEvent(ConfigChange change,
            LevelChangeProcessor processor) {
        // Only updates for level change can be handled dynamically, all
        // other changes will require restart.
        ConfigUpdate update = convertToConfigUpdate(change);
        if (update == null) {
            return false;
        }
        String xpath = cleanXPath(update.getXPath());
        if (!processor.isRelevant(xpath)) {
            return false;
        }
        Set attrs = update.getAttributeSet();
        if (attrs == null) {
            logger.log(Level.FINEST, "admin.event.null_updated_attrs",
                    update.getXPath());
            return false;
        }
        Iterator iter = attrs.iterator();
        while (iter.hasNext()) {
            String compName = (String)iter.next();
            String oldValue = update.getOldValue(compName);
            String newValue = update.getNewValue(compName);
            AdminEvent event = processor.createEvent(compName, oldValue,
                    newValue);
            cache.add(event);
            ConfigUpdate upd = new ConfigUpdateImpl(xpath, compName, oldValue,
                    newValue);
            event.addConfigChange(upd);
        }
        return true;
    }
View Full Code Here

        String xpath = cleanXPath(change.getXPath());
        boolean processed = false;
        if (isResourceXPath(xpath)) {
            String actionCode = null;
            if (change instanceof ConfigUpdate) {
                ConfigUpdate update = (ConfigUpdate)change;
                String enableStr = update.getNewValue(ServerTags.ENABLED);
                if (enableStr != null) {
                    if (getServerXmlBooleanValue(enableStr)) {
                        actionCode = ResourceDeployEvent.ENABLE;
                    } else {
                        actionCode = ResourceDeployEvent.DISABLE;
View Full Code Here

    /**
     * Convert to config update, if possible. If specified change is not
     * an instanceof ConfigUpdate, the method returns null
     */
    private ConfigUpdate convertToConfigUpdate(ConfigChange change) {
        ConfigUpdate update = null;
        if (change instanceof ConfigUpdate) {
            update = (ConfigUpdate)change;
        }
        return update;
    }
View Full Code Here

         * enabled state of corresponding config object.
         */
        String getActionCode(ConfigChange change) {
            String actionCode = null;
            if (change instanceof ConfigUpdate) {
                ConfigUpdate update = (ConfigUpdate)change;
                String enableStr = update.getNewValue(ServerTags.ENABLED);
                if (enableStr != null) {
                    boolean enabled =
                            adminEventCache.getServerXmlBooleanValue(
                                enableStr);
                    if (enabled && resEnabled) {
View Full Code Here

            return null;
        for(int i=changeList.size()-1; i>=0; i--)
        {
            if ( changeList.get(i) instanceof ConfigUpdate)
                {
                    ConfigUpdate update = (ConfigUpdate)changeList.get(i);
                    String enableStr = update.getNewValue(ServerTags.ENABLED);
                    if (enableStr != null)
                        return new Boolean(ElementChangeHelper.getBooleanValue(enableStr));
                }
        }
        return null;
View Full Code Here

TOP

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

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.