Examples of ElementProperty


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

    {
        String propertyName = attr.getName();
        String value = (String)attr.getValue();
       
        Class cl = m_baseConfigBean.getClass();
        ElementProperty prop;
        try
        {
           Method method = cl.getDeclaredMethod("getElementPropertyByName", new Class[]{Class.forName("java.lang.String")});
           prop = (ElementProperty)method.invoke(m_baseConfigBean, new Object[]{propertyName});
        }
        catch (Exception e)
        {
      String msg = /*localStrings.getString*/( "admin.server.core.mbean.config.setattribute_undefined_properties_in_base_element"+ propertyName );
            throw new MBeanException(new MBeanConfigException( msg ));
        }
        if(prop==null && value!=null && (bAllowsEmptyValue || !value.equals("")))
        {
            prop = new ElementProperty();
            prop.setName(propertyName);
            prop.setValue(value);
            try
            {
                Method method = cl.getDeclaredMethod("addElementProperty", new Class[]{prop.getClass()});
                method.invoke(m_baseConfigBean, new Object[]{prop});
            }
            catch (Exception e)
            {
        String msg = /*localStrings.getString*/( "admin.server.core.mbean.config.setproperty_invoke_error"+propertyName );
                throw new MBeanException(new MBeanConfigException( msg ));
            }
        }
        else
        {
            if(value==null || (!bAllowsEmptyValue && value.equals("")))
            {
                try
                {
                    Method method = cl.getDeclaredMethod("removeElementProperty", new Class[]{prop.getClass()});
                    method.invoke(m_baseConfigBean, new Object[]{prop});
                }
                catch (Exception e)
                {
          String msg = /*localStrings.getString*/( "admin.server.core.mbean.config.setproperty_could_not_remove_propery"+ propertyName );
                    throw new MBeanException(new MBeanConfigException( msg ));
                }
            }
            else
                prop.setValue(value);
        }
       
/*        try
        {
            m_configContext.flush();
View Full Code Here

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

                    if (change instanceof ConfigAdd || change instanceof ConfigUpdate) {
                        String xpath = ((ConfigChange)change).getXPath();
                        if( xpath != null){
                            ConfigBean item = newConfig.exactLookup(xpath);
                            if (item instanceof ElementProperty) {
                                ElementProperty elementProperty = (ElementProperty)item;
                                String name  = elementProperty.getName();
                                String monLevel    = elementProperty.getValue();
                                MonitoringLevel level = MonitoringLevel.instance(monLevel);
                                MonitoringRegistrationHelper mReg = MonitoringRegistrationHelper.getInstance();
                                if(mReg.getMonitoringFeature().handleModuleMonitoringLevelChange(name, level)){
                                    continue;
                                }
View Full Code Here

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

     *
     * returns true is named property will be changed as result of change event
     *
     ********************************************************/
    static public boolean isPropertyChanged(ValidationContext propValCtx, String name) {
        ElementProperty prop = (ElementProperty)propValCtx.getTargetBean();
        if(!prop.getName().equals(name))
        {
            //check if name of property changing to checked one
            if(!propValCtx.isUPDATE() ||
               !PROP_NAME_ATTRNAME.equals(propValCtx.name) ||
               !name.equals(propValCtx.value))
View Full Code Here

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

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

           
        } 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

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

    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

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

        {
            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

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

            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

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

    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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.