Package com.sun.enterprise.config

Examples of com.sun.enterprise.config.ConfigBean


        if(xpath==null)
            return null;
        String[] elems  = extractTokens(xpath);
        if(elems.length==0 || elems[0].length()!=0)          
           return null;
        ConfigBean cb = null;
        try {
            cb = ctx.getRootConfigBean();
        } catch (ConfigException ce){
        }
        AttributeList list = new AttributeList();
View Full Code Here


    private static ConfigBean[] getNextBeans(ConfigBean cb, String name)
    {
        try{
            if("..".equals(name))
            {
               ConfigBean parent = (ConfigBean)cb.parent();
               if(parent==null)
                   return null;
               ConfigBean grand = (ConfigBean)parent.parent();
               if(grand==null)
                   return new ConfigBean[]{parent};
               return (ConfigBean[])grand.getValue(parent.name());
            }
            return (ConfigBean[])cb.getValues(convertName(name));
        } catch(Throwable t){
            return null;
        }
View Full Code Here

       
        //************************************************
        //4. looks like new element. First, non-indexed
        if(!nextToken.endsWith("]"))
        {
            ConfigBean cbNext = getNextBean(cb, nextToken);
            if(cbNext!=null)
                navigate((ConfigBean)cbNext, tokens, iNextToken , prefixFilter, list);
            return;
        }
       
View Full Code Here

    /****************************************************************************************************************
     */
    public AttributeList getSystemProperties()  throws MBeanException,AttributeNotFoundException {
        _sLogger.log(Level.FINEST, MSG_BASE_GET_PROPERTIES);
       
        ConfigBean baseBean = getBaseConfigBean();
        Class cl = baseBean.getClass();
        SystemProperty[] props = null;
        try {
            Method method = cl.getDeclaredMethod("getSystemProperty");
            props = (SystemProperty[])method.invoke(baseBean);
        }
View Full Code Here

     @throws AttributeNotFoundException exception
     */
    public Object getPropertyValue(String propertyNamethrows MBeanException,AttributeNotFoundException {
        _sLogger.log(Level.FINEST, MSG_BASE_GET_PROPERTY, propertyName);
       
        ConfigBean baseBean = getBaseConfigBean();
        Class cl = baseBean.getClass();
        ElementProperty prop = null;
        try {
            Method method = cl.getDeclaredMethod("getElementPropertyByName", new Class[]{Class.forName("java.lang.String")});
            prop = (ElementProperty)method.invoke(baseBean, new Object[]{propertyName});
        }
View Full Code Here

     @throws AttributeNotFoundException exception
     */
    public Object getSystemPropertyValue(String propertyNamethrows MBeanException,AttributeNotFoundException {
        _sLogger.log(Level.FINEST, MSG_BASE_GET_PROPERTY, propertyName);
       
        ConfigBean baseBean = getBaseConfigBean();
        Class cl = baseBean.getClass();
        SystemProperty prop = null;
        try {
            Method method = cl.getDeclaredMethod("getSystemPropertyByName", new Class[]{Class.forName("java.lang.String")});
            prop = (SystemProperty)method.invoke(baseBean, new Object[]{propertyName});
        }
View Full Code Here

    private void setElementProperty(Attribute attr, boolean bAllowsEmptyValuethrows MBeanException,AttributeNotFoundException {
        String propertyName = attr.getName();
        String value = (String)attr.getValue();
        _sLogger.log(Level.FINEST, MSG_BASE_SET_PROPERTY, new Object[]{propertyName, value});
       
        ConfigBean baseBean = getBaseConfigBean();
       
        Class cl = baseBean.getClass();
        ElementProperty prop = null;
        try {
            Method method = cl.getDeclaredMethod("getElementPropertyByName", new Class[]{Class.forName("java.lang.String")});
            prop = (ElementProperty)method.invoke(baseBean, new Object[]{propertyName});
        }
View Full Code Here

    private void setSystemProperty(Attribute attr, boolean bAllowsEmptyValuethrows MBeanException,AttributeNotFoundException {
        String propertyName = attr.getName();
        String value = (String)attr.getValue();
        _sLogger.log(Level.FINEST, MSG_BASE_SET_PROPERTY, new Object[]{propertyName, value});
       
        ConfigBean baseBean = getBaseConfigBean();
       
        Class cl = baseBean.getClass();
        SystemProperty prop=null;
        try {
            Method method = cl.getDeclaredMethod("getSystemPropertyByName", new Class[]{Class.forName("java.lang.String")});
            prop = (SystemProperty)method.invoke(baseBean, new Object[]{propertyName});
        }
View Full Code Here

            // 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());
                wrapAndThrowMBeanException(null, "not_supported_attribute_type", externalName );
               
                //                descr.getNode().setContent(value.toString());
                //                m_configContext.flush();
            }
            else
            {
                if(ai.getType().startsWith("[")) //array
                {
                    bean.setValue(ConfigBean.camelize(descr.getAttributeName()), (Object[])value);
/*                    Class cl = bean.getClass();
                    try
                    {
                        Method method = cl.getMethod("setValue", new Class[]{Class.forName("java.lang.String"),(new Object[0]).getClass()});
                        method.invoke(bean, new Object[]{ConfigBean.camelize(descr.getAttributeName()),value});
                    }
                    catch (Exception e)
                    {
                        String msg = localStrings.getString( "admin.server.core.mbean.config.setattribute_invocation_error", externalName );
                        throw MBeanHelper.extractAndWrapTargetException(e, msg);
                    }
*/
                }
                else
                {
                    try {
                        //descr.getNode().setAttribute(descr.getAttributeName(), value.toString());
                        if(value==null || (value.equals("") && !isEmptyValueAllowed(ai)) )
                            bean.setAttributeValue(descr.getAttributeName(), null);
                        else
                            bean.setAttributeValue(descr.getAttributeName(), value.toString());
                        //                    m_configContext.flush();
                    } catch (IllegalArgumentException e) {
                        bean.setValue(ConfigBean.camelize(descr.getAttributeName()), value);
                    }
                }
            }
        }
       
View Full Code Here

    }
   
    //****************************************************************************************************
    private String[] getAllPropertyNames(boolean bAddPropertyPrefix) {
       
        ConfigBean baseBean = getBaseConfigBean();
        Class cl = baseBean.getClass();
        ElementProperty[] props;
        try {
            Method method = cl.getDeclaredMethod("getElementProperty");
            props = (ElementProperty[])method.invoke(baseBean);
            String[] names = new String[props.length];
View Full Code Here

TOP

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

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.