/* */ Iterator i;
/* 86 */ if ((raProperties != null) && (raProperties.size() != 0))
/* */ {
/* 88 */ for (i = raProperties.iterator(); i.hasNext(); )
/* */ {
/* 90 */ ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)i.next();
/* 91 */ String name = cpmd.getName();
/* 92 */ String value = cpmd.getValue();
/* 93 */ if ((value != null) && (value.length() > 0))
/* */ {
/* 95 */ if (properties.containsKey(name))
/* */ {
/* 97 */ if (trace) {
/* 98 */ log.trace("AdminObject '" + jndiName + "' property=" + name + " IGNORING value=" + value + " specified in MBean properties.");
/* */ }
/* */ }
/* */ else
/* */ {
/* 103 */ String typeName = cpmd.getType();
/* 104 */ if (trace)
/* 105 */ log.trace("AdminObject '" + jndiName + "' property=" + name + " loading class=" + typeName);
/* 106 */ Class type = cl.loadClass(typeName);
/* */
/* 109 */ PropertyEditor editor = PropertyEditorManager.findEditor(type);
/* 110 */ if (editor == null)
/* 111 */ throw new DeploymentException("No property editor found for property '" + name + " class='" + type + "' for admin object '" + interfaceClass + "' ra=" + rarName);
/* 112 */ editor.setAsText(value);
/* 113 */ Object object = editor.getValue();
/* */ try
/* */ {
/* 117 */ String setter = "set" + Character.toUpperCase(name.charAt(0));
/* 118 */ if (name.length() > 1)
/* 119 */ setter = setter.concat(name.substring(1));
/* 120 */ Method method = implClass.getMethod(setter, new Class[] { type });
/* 121 */ if (trace)
/* 122 */ log.trace("AdminObject '" + jndiName + "' property=" + name + " set=" + object);
/* 123 */ method.invoke(result, new Object[] { object });
/* */ }
/* */ catch (InvocationTargetException e)
/* */ {
/* 127 */ DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class=" + implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, e.getTargetException());
/* */ }
/* */ catch (Throwable t)
/* */ {
/* 131 */ DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class=" + implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, t);
/* */ }
/* */ }
/* */ }
/* */ }
/* */ }
/* */ Iterator i;
/* 139 */ if (properties != null)
/* */ {
/* 141 */ for (i = properties.entrySet().iterator(); i.hasNext(); )
/* */ {
/* 143 */ Map.Entry property = (Map.Entry)i.next();
/* 144 */ String name = (String)property.getKey();
/* 145 */ String value = (String)property.getValue();
/* 146 */ if (trace) {
/* 147 */ log.trace("AdminObject '" + jndiName + "' property=" + name + " value=" + value);
/* */ }
/* */
/* 150 */ ConfigPropertyMetaData cpmd = aomd.getProperty(name);
/* 151 */ if (cpmd == null)
/* 152 */ throw new DeploymentException("No property '" + name + "' for admin object '" + interfaceClass + "' ra=" + rarName);
/* 153 */ if (trace) {
/* 154 */ log.trace("AdminObject '" + jndiName + "' property=" + name + " metadata=" + cpmd);
/* */ }
/* */
/* 157 */ String typeName = cpmd.getType();
/* 158 */ if (trace)
/* 159 */ log.trace("AdminObject '" + jndiName + "' property=" + name + " loading class=" + typeName);
/* 160 */ Class type = cl.loadClass(typeName);
/* */
/* 163 */ PropertyEditor editor = PropertyEditorManager.findEditor(type);