Package com.sun.enterprise.admin.common.exception

Examples of com.sun.enterprise.admin.common.exception.MBeanConfigException


           prop = (ElementProperty)method.invoke(baseBean, new Object[]{propertyName});
        }
        catch (Exception e)
        {
      String msg = localStrings.getString( "admin.server.core.mbean.config.getattribute.undefined_properties_in_base_element", propertyName );
            throw new MBeanException(new MBeanConfigException( msg ));
        }
        if(prop==null) {
      String msg = localStrings.getString( "admin.server.core.mbean.config.getattribute_properties_not_found_in_base_element", propertyName );
            throw new MBeanException(new MBeanConfigException( msg ));
    }
        return prop.getValue();
    }
View Full Code Here


           prop = (ElementProperty)method.invoke(baseBean, 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(baseBean, 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(baseBean, 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();
        }
        catch (ConfigException e)
        {
            throw new MBeanException(new MBeanConfigException(e.getMessage()));
        }
    }
View Full Code Here

            throw new AttributeNotFoundException( msg );
        }
        if(ai!=null && !ai.isWritable())
        {
      String msg = localStrings.getString( "admin.server.core.mbean.config.setattribute_attribute_not_writable", externalName );
            throw new MBeanException(new MBeanConfigException( msg ));
        }
       
        try
        {
            if(isProperty)
            {
                boolean bAllowsEmptyValue = true;
                if(ai!=null)
                {
                    AttrDescriptor descr = getDescriptor(externalName);
                    if(descr!=null)
                    {
                       bAllowsEmptyValue = descr.isEmptyValueAllowed();
                    }
                }
                // set property value
                setPropertyElementValue(new Attribute(externalName.substring(ConfigAttributeName.PROPERTY_NAME_PREFIX.length()), value), bAllowsEmptyValue);
                return;
            }
            else
            { //normal attribute
                // check type (now only for exception)
// left check for Verifyer now (bug #4725686)
//                MBeanEasyConfig.convertStringValueToProperType(value.toString(), ai.getType());

                AttrDescriptor descr = getDescriptor(externalName);
                ConfigBean  bean = getConfigBean(externalName);
                if(descr.isElement())
                {
                    //it looks that now we have no Elements with values
                    //bean.set???Value(descr.getAttributeName(), value.toString());
          String msg = localStrings.getString( "admin.server.core.mbean.config.getattribute_not_implemented_for_xml" );
                    throw new MBeanException(new MBeanConfigException( msg ));

    //                descr.getNode().setContent(value.toString());
    //                m_configContext.flush();
                }
                else
                {

                    //descr.getNode().setAttribute(descr.getAttributeName(), value.toString());
                    if(value==null || (value.equals("") && !descr.isEmptyValueAllowed()) )
                       bean.setAttributeValue(descr.getAttributeName(), null);
                    else
                       bean.setAttributeValue(descr.getAttributeName(), value.toString());
                    m_configContext.flush();
                }
            }
           
        }
//        catch (MBeanConfigException mce)
//        {
//      String msg = localStrings.getString( "admin.server.core.mbean.config.setattribute_attribute_exception",  externalName, mce.getMessage() );
//            throw new MBeanException(new MBeanConfigException( msg ));
//        }
        catch (ConfigException e)
        {
      String msg = localStrings.getString( "admin.server.core.mbean.config.setAttribute_exception_for_externalname_basexpath", externalName, m_BasePath, e.getMessage() );
            throw new MBeanException(new MBeanConfigException( msg ));
        }
    }
View Full Code Here

            checkConsistency();
        }
        catch(Exception e)
        {
      String msg = localStrings.getString( "admin.server.core.mbean.config.naming.mbeandescriptor_creation_failure_for_object_pattern", objectPattern, e.getMessage() );
            throw new MBeanConfigException( msg );
        }
    }
View Full Code Here

                }
            }
            catch (Throwable e)
            {
        String msg = localStrings.getString( "admin.server.core.mbean.config.attrdescriptor_constructor_exception", description, e.getMessage() );
                throw new MBeanConfigException( msg );
            }
        }
View Full Code Here

    public ConfigMBeanNamingInfo(String type, String[] params, boolean bTestParamSize) throws MBeanConfigException
    {
        m_descr = ConfigMBeansNaming.findNamingDescriptorByType(type);
        if(m_descr==null) {
      String msg = localStrings.getString( "admin.server.core.mbean.config.naming.mbeannamingdescriptor_not_found_for_type", type );
            throw new MBeanConfigException( msg );
    }

        if(bTestParamSize)
        {
            int parmSize = (params==null)?0:params.length;
            if(m_descr.getParmListSize()!=parmSize) {
        String msg = localStrings.getString( "admin.server.core.mbean.config.naming.wrong_parameters_array_size", type );
                throw new MBeanConfigException( msg );
      }
        }
        m_ids   = params;
    }
View Full Code Here

    public ConfigMBeanNamingInfo(String dottedName) throws MBeanConfigException, MalformedNameException
    {
        m_descr = ConfigMBeansNaming.findNamingDescriptor(dottedName);
        if(m_descr==null) {
      String msg = localStrings.getString( "admin.server.core.mbean.config.naming.mbeannamingdescriptor_not_found_for_dotted_name", dottedName );
            throw new MBeanConfigException( msg );
    }
        m_ids   = m_descr.extractParmList(dottedName);
    }
View Full Code Here

    public ConfigMBeanNamingInfo(ObjectName objectName) throws MBeanConfigException
    {
        m_descr = ConfigMBeansNaming.findNamingDescriptor(objectName);
        if(m_descr==null) {
      String msg = localStrings.getString( "admin.server.core.mbean.config.naming.mbeannamingdescriptor_not_found_for_object_name", objectName );
            throw new MBeanConfigException( msg );
    }
        m_ids   = m_descr.extractParmList(objectName);
    }
View Full Code Here

            configMBean  = (ConfigMBeanBase)cl.newInstance();
        }
        catch (Exception e)
        {
      String msg = localStrings.getString( "admin.server.core.mbean.config.naming.mbeannamingdescriptor_couldnot_create_mbean_class", className );
            throw new MBeanConfigException( msg );
        }
        configMBean.setAdminContext(m_AdminContext);
        configMBean.initialize(this);
        return configMBean;
    }
View Full Code Here

    public String getServerInstanceName()  throws MBeanConfigException
    {
        if(m_ids==null || m_ids.length==0)
        {
            String msg = localStrings.getString( "admin.server.core.mbean.config.naming.wrong_parameters_array_size", m_descr.getType() );
            throw new MBeanConfigException( msg );
        }
        return m_ids[0];
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.common.exception.MBeanConfigException

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.