Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.ElementProperty


    /********************************************************
     *********************************************************/
    static private Map addChangesToPropertiesMap(ValidationContext propValCtx, Map map) {
        if(propValCtx.isADD() || propValCtx.isSET())
        {
            ElementProperty prop = (ElementProperty)propValCtx.getTargetBean();
            map.put(prop.getName(), prop.getValue());
        }
        else if(propValCtx.isUPDATE())
        {
            ElementProperty prop = (ElementProperty)propValCtx.getTargetBean();
            if(PROP_NAME_ATTRNAME.equals(propValCtx.name))
            {
                // when name of property is changing
                map.remove(prop.getName());
                map.put(propValCtx.value, prop.getValue());
            }
            else
            {
                // when value of property is changing
                map.put(prop.getName(), propValCtx.value);
            }
        }
        return map;
    }
View Full Code Here


           
        } else if(valCtx.isADD()) {
            AuthRealm ar = (AuthRealm)valCtx.getTargetBean();
            String className = ar.getClassname();
            if(className.endsWith(".FileRealm")) {
                ElementProperty fileProp = ar.getElementPropertyByName("file");
                if(fileProp==null) {
                    valCtx.result.failed(smh.getLocalString(getClass().getName()+".propNotFounfInFileRealm",
                            "Auth realm can not be added. \"{0}\" property should be provided for FileRealm type.",
                            new Object[]{"file"}));
                }
                ElementProperty jaasContextProp = ar.getElementPropertyByName("jaas-context");
                if(jaasContextProp==null) {
                    valCtx.result.failed(smh.getLocalString(getClass().getName()+".propNotFounfInFileRealm",
                            "Auth realm can not be added. \"{0}\" property should be provided for FileRealm type.", new Object[]{"jaas-context"}));
                }
            }
View Full Code Here

    private static void addClientHostNameProperty2SystemJmxConnector(final Config someConfig) throws ConfigException {
        final com.sun.enterprise.config.serverbeans.AdminService as = someConfig.getAdminService();
        final JmxConnector jc    = as.getJmxConnectorByName(IAdminConstants.SYSTEM_CONNECTOR_NAME);
        final String hostValue   = System.getProperty(SystemPropertyConstants.HOST_NAME_PROPERTY);
        final String hostName    = IAdminConstants.HOST_PROPERTY_NAME;
        ElementProperty ep       = jc.getElementPropertyByName(hostName);

        if (ep == null) {
            ep = new ElementProperty();
            ep.setName(hostName);
            ep.setValue(hostValue);           
            jc.addElementProperty(ep);
        } else {
            ep.setValue(hostValue);
        }
    }
View Full Code Here

        {
            Enumeration keys = eventProperties.keys();
            while (keys.hasMoreElements())
            {
                final String key = (String)keys.nextElement();
                ElementProperty prop = new ElementProperty();
                prop.setName(key);
                prop.setValue((String)eventProperties.get(key));
                event.addElementProperty(prop);
            }
        }
    newRule.setEvent(event);
   
View Full Code Here

            ArrayList arr = new ArrayList();
            for (Enumeration e = props.propertyNames(); e.hasMoreElements() ;) {
                String propName = (String)e.nextElement();
                String propValue = (String)props.getProperty(propName);
                if (propValue != null) {
                    ElementProperty ep = new ElementProperty();
                    ep.setName(propName);
                    ep.setValue(propValue);                   
                    arr.add(ep);
                }
            }
            if(arr.size()>0)
            {
View Full Code Here

    private void checkAndCreateAuthRealmKeyFile(AuthRealm authRealm)
        throws MBeanConfigException
    {
        if(!FILE_REALM_CLASSNAME.equals(authRealm.getClassname()))
            return; //only file realms have keyfile reference
        ElementProperty prop = authRealm.getElementPropertyByName(KEYFILE_PATH_PROPERTY_NAME);
        if(prop==null)
        {
//            String msg = localStrings.getString("configsMBean.no_keyfile_name_property");
//            _sLogger.log(Level.WARNING, msg);
//            throw new MBeanConfigException(msg);
            return; //leave validation exception to config validator
        }
        String path=null;
        try
        {
                path = resolveTokensForDas(prop.getValue());
                // this is patch for file-realm only
                // we need to create empty keyfile if it's not exist
                File file;
                if((file = new File(path))!=null && !file.exists())
                        file.createNewFile();
View Full Code Here

        ArrayList list = new ArrayList();
        Enumeration keys = props.keys();
        while (keys.hasMoreElements())
        {
            final String key = (String)keys.nextElement();
            ElementProperty property = new ElementProperty();
            property.setName(key);
            property.setValue((String)props.get(key));
            list.add(property);
        }
        return (ElementProperty[])list.toArray(new ElementProperty[list.size()]);
    }
View Full Code Here

   
    private void setDomainName(Domain domain) throws ConfigException
    {
        try
        {
            ElementProperty ep = domain.getElementPropertyByName(DOMAIN_NAME_XML_PROPERTY);
           
            if(ep == null)
                throw new ConfigException("The property, " + DOMAIN_NAME_XML_PROPERTY + ", was null");
           
            String domainName = ep.getValue();
           
            if(domainName == null || domainName.length() < 1)
                throw new ConfigException("The value of the property, " + DOMAIN_NAME_XML_PROPERTY + ", was null or empty");
           
            System.setProperty(DOMAIN_NAME_SYSTEM_PROPERTY, domainName);
View Full Code Here

        try {
            Config cfg = ServerBeansFactory.getConfigBean(ApplicationServer
                    .getServerContext().getConfigContext());
            MonitoringService monService = cfg.getMonitoringService();

            ElementProperty monLevel = monService.getModuleMonitoringLevels()
                    .getElementPropertyByName(SIPSERVICE_PROPERTY_NAME);
            if (monLevel != null) {
                String val = monLevel.getValue();
                if (val.equals(MonitoringLevel.HIGH.toString()))
                    mLevel = "HIGH";
                else if (val.equals(MonitoringLevel.LOW.toString()))
                    mLevel = "LOW";
            }
View Full Code Here

        try {
            Config cfg = ServerBeansFactory.getConfigBean(ApplicationServer
                    .getServerContext().getConfigContext());
            MonitoringService monService = cfg.getMonitoringService();
   
            ElementProperty monLevel = monService.getModuleMonitoringLevels()
                    .getElementPropertyByName(CLB_PROPERTY_NAME);
            if (monLevel != null) {
                String val = monLevel.getValue();
                if(val.equals(MonitoringLevel.HIGH.toString())){
                    monitoringLevel = MonitoringLevel.HIGH;
                }else if(val.equals(MonitoringLevel.LOW.toString())){
                    monitoringLevel = MonitoringLevel.LOW;
                }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.ElementProperty

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.