Package com.sun.enterprise.config

Examples of com.sun.enterprise.config.ConfigBean


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


*/   
    //****************************************************************************************************
    public ConfigBean createChildByType(String childName, AttributeList childValues, Properties props, boolean bOnlyOneChildPossible) throws Exception
    {
        //First. Create standalone bean of child type with Attributes and Properties set
        ConfigBean bean = createChildByType(childName, childValues, props);
        if(bean==null)
            return null;
       
        // Now, connect it to papa bean
        addChildBean(childName, bean, bOnlyOneChildPossible);
View Full Code Here

        if(m_baseConfigBean==null)
            return null;
        String xpath = MBeanHelper.getXPathPattern( (ModelMBeanInfo)m_mbeanInfo) +
                           ServerXPathHelper.XPATH_SEPARATOR + childName;
        Class cl = ConfigMBeanHelper.getConfigBeanClass(xpath);
        ConfigBean bean = (ConfigBean)cl.newInstance();
        MBeanRegistryEntry regEntry = m_registry.findMBeanRegistryEntryByXPathPattern(xpath);
        if(childValues!=null)
            for(int i=0; i<childValues.size(); i++)
            {
               
                Attribute attr = (Attribute)childValues.get(i);
                if( (attr.getValue()==null || attr.getValue().equals("")))
                { 
                    //empty value set bypass if not allowed in the registry
                    boolean bEmptyValueAllowed = false;
                    try {
                       // analyze registry_Entry emptyValueAllowed (if mentioned)
                       bEmptyValueAllowed = regEntry.isAttributeEmptyValueAllowed(attr.getName());
                    } catch (MBeanMetaException mme)
                    {
                        //field not found in registry
                    }
                    if(!bEmptyValueAllowed)
                        continue; //skip set of empty value
                }
                if(attr.getValue()==null)
                    bean.setAttributeValue(MBeanMetaHelper.mapToConfigBeanAttributeName(attr.getName()), (String)attr.getValue());
                else
                    bean.setAttributeValue(MBeanMetaHelper.mapToConfigBeanAttributeName(attr.getName()), ""+attr.getValue());
            }
        if(props!=null && props.size()>0)
        {
            final Enumeration e = props.propertyNames();
            ArrayList propsList = new ArrayList();
            while (e.hasMoreElements())
            {
                ElementProperty ep = new ElementProperty();
                String key = (String)e.nextElement();
                ep.setName(key);
                ep.setValue(props.getProperty(key));
                propsList.add(ep);
            }
            if(propsList.size()>0)
            {
               ElementProperty eps[] = (ElementProperty[])propsList.toArray(
                                 new ElementProperty[propsList.size()]);
               bean.setValue("ElementProperty", eps);
            }
        }
        return bean;
    }
View Full Code Here

      String xpath = null;
//try {
        xpath = m_baseConfigBean.getAbsoluteXPath(null);
        xpath = ServerXPathHelper.getParentXPath(xpath);
        ConfigContext ctx = getConfigContext(); //com.sun.enterprise.admin.config.BaseConfigMBean.getConfigContext(); //FIXME: this method should not be in MBEAN
        ConfigBean parent = ConfigBeansFactory.getConfigBeanByXPath(ctx, xpath);
        parent.removeChild(m_baseConfigBean);
//} catch(Exception e)
//{
   //FIXME:temporary solution
//   System.out.println("Exception during deleteSelf()  xpath="+xpath);
//}
View Full Code Here

        if(multi!=null && multi.length()>0 &&
           multi.charAt(0)=='t')
            bOnlyOne = false;
        if(child!=null && opName.startsWith("create"))
        {
           ConfigBean bean = createChildByType(child, (AttributeList)params[0], null, bOnlyOne);
           ObjectName objectName = ConfigMBeanHelper.getChildObjectName(m_registry, (ModelMBeanInfo)m_mbeanInfo, bean);
           m_registry.notifyRegisterMBean(objectName, getConfigContext());
           return objectName;
        }
       
View Full Code Here

    //**************************************************************************
    public void notifyUnregisterMBean(ObjectName objectName, ConfigContext ctx)
    {
        try {
            MBeanNamingInfo namingInfo = getMBeanNamingInfo(objectName);
            ConfigBean bean = null;
            try
            {
                bean = (ConfigBean)ConfigBeansFactory.getConfigBeanByXPath(ctx, namingInfo.getXPath());
            }
            catch (Exception e)
View Full Code Here

    }
   
    //**************************************************************************
    public void generateAndRegisterAllDottedNames(ConfigContext ctx, String domainName) throws MBeanMetaException
    {
        ConfigBean bean = null;
        try
        {
            bean = (ConfigBean)ConfigBeansFactory.getConfigBeanByXPath(ctx, "/domain");
            registerDottedName(bean, domainName);
        }
View Full Code Here

    public void instantiateAndRegisterAllConfigMBeans(
                                ConfigContext ctx,
                                String domainName)
                                throws MBeanMetaException
    {
        ConfigBean bean = null;
        try
        {
            bean = (ConfigBean)ConfigBeansFactory.getConfigBeanByXPath(ctx,
                                                ServerXPathHelper.XPATH_DOMAIN);
        }
View Full Code Here

            {
                try {
                    MBeanNamingInfo namingInfo =
                       new MBeanNamingInfo(entry.getNamingDescriptor(), resolvedName);
                    String xpath = namingInfo.getXPath();
                    ConfigBean configBean =
                       (ConfigBean)ConfigBeansFactory.getConfigBeanByXPath(_ctx, xpath);
                    if(configBean!=null)
                    {
                        ModelMBeanInfo mbi = entry.createMBeanInfo(namingInfo, "offline");
                        mbc =  new ManagedConfigBean((MBeanInfo)mbi, configBean, _registry);
View Full Code Here

    // ---- START OF ApplicationsMgr Interface ---------------------------

    public void synchronize(String name) throws SynchronizationException {

        ConfigBean bean = null;
        try {
            bean = ApplicationHelper.findApplication(_ctx, name);
        } catch (ConfigException ce) {
            String msg=_localStrMgr.getString("UnknownApplicationId", name);
            throw new SynchronizationException(msg, ce);
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.