/** * Update the property with the string value in each config manager. * * @param property the property to update * @param value the value to set */ public void setBooleanValue(String property, String value) { try { if (jsMBean != null) { PropertyUtils.setProperty(jsMBean, property, Boolean.valueOf(value)); } if (cssMBean != null) { PropertyUtils.setProperty(cssMBean, property, Boolean.valueOf(value)); } if (imgMBean != null) { PropertyUtils.setProperty(imgMBean, property, Boolean.valueOf(value)); } } catch (IllegalAccessException e) { throw new JmxConfigException("Exception while setting the boolean value", e); } catch (InvocationTargetException e) { throw new JmxConfigException("Exception while setting the boolean value", e); } catch (NoSuchMethodException e) { throw new JmxConfigException("Exception while setting the boolean value", e); } }
/** * Returns the string value of the configuration managers * * @param property the property to retrieve * @return the string value of the configuration managers */ public String getStringValue(String property) { final List<JawrConfigManagerMBean> mBeans = getInitializedConfigurationManagers(); try { if (mBeans.size() == 3) { if (areEquals( PropertyUtils.getProperty(jsMBean, property), PropertyUtils.getProperty(cssMBean, property), PropertyUtils.getProperty(imgMBean, property))) { return PropertyUtils.getProperty(jsMBean, property); } else { return NOT_IDENTICAL_VALUES; } } if (mBeans.size() == 2) { JawrConfigManagerMBean mBean1 = (JawrConfigManagerMBean) mBeans.get(0); JawrConfigManagerMBean mBean2 = (JawrConfigManagerMBean) mBeans.get(1); if (areEquals( PropertyUtils.getProperty(mBean1, property), PropertyUtils.getProperty(mBean2, property))) { return PropertyUtils.getProperty(mBean1, property); } else { return NOT_IDENTICAL_VALUES; } } JawrConfigManagerMBean mBean1 = (JawrConfigManagerMBean) mBeans.get(0); return PropertyUtils.getProperty(mBean1, property); } catch (Exception e) { return ERROR_VALUE; } }