/* 73 */ if (null == resource)
/* */ {
/* 75 */ throw new IllegalArgumentException("resource cannot be null");
/* */ }
/* */
/* 78 */ MethodMapper mmap = new MethodMapper(resource.getClass());
/* 79 */ ReflectedMBeanDispatcher dispatcher = new ReflectedMBeanDispatcher(info, resolver, resource);
/* */
/* 81 */ String flag = PropertyAccess.getProperty("jbossmx.optimized.dispatcher", "false");
/* 82 */ if (flag.equalsIgnoreCase("true"))
/* */ {
/* 86 */ dispatcher = OptimizedMBeanDispatcher.create(info, resource);
/* */ }
/* */
/* 89 */ MBeanAttributeInfo[] attributes = info.getAttributes();
/* 90 */ for (int i = 0; i < attributes.length; i++)
/* */ {
/* 92 */ MBeanAttributeInfo attribute = attributes[i];
/* 93 */ Method getter = null;
/* 94 */ Method setter = null;
/* */
/* 96 */ if (attribute.isReadable())
/* */ {
/* 98 */ if ((attribute instanceof ModelMBeanAttributeInfo))
/* */ {
/* 100 */ ModelMBeanAttributeInfo mmbAttribute = (ModelMBeanAttributeInfo)attribute;
/* 101 */ Descriptor desc = mmbAttribute.getDescriptor();
/* 102 */ if ((desc != null) && (desc.getFieldValue("getMethod") != null))
/* */ {
/* 104 */ getter = mmap.lookupGetter(mmbAttribute);
/* 105 */ if (getter == null)
/* */ {
/* 107 */ throw new IntrospectionException("no getter method found for attribute: " + attribute.getName());
/* */ }
/* */ }
/* */ }
/* */ else
/* */ {
/* 113 */ getter = mmap.lookupGetter(attribute);
/* 114 */ if (getter == null)
/* */ {
/* 116 */ throw new IntrospectionException("no getter method found for attribute: " + attribute.getName());
/* */ }
/* */ }
/* */ }
/* */
/* 121 */ if (attribute.isWritable())
/* */ {
/* 123 */ if ((attribute instanceof ModelMBeanAttributeInfo))
/* */ {
/* 125 */ ModelMBeanAttributeInfo mmbAttribute = (ModelMBeanAttributeInfo)attribute;
/* 126 */ Descriptor desc = mmbAttribute.getDescriptor();
/* 127 */ if ((desc != null) && (desc.getFieldValue("setMethod") != null))
/* */ {
/* 129 */ setter = mmap.lookupSetter(mmbAttribute);
/* 130 */ if (setter == null)
/* */ {
/* 132 */ throw new IntrospectionException("no setter method found for attribute: " + attribute.getName());
/* */ }
/* */ }
/* */ }
/* */ else
/* */ {
/* 138 */ setter = mmap.lookupSetter(attribute);
/* 139 */ if (setter == null)
/* */ {
/* 141 */ throw new IntrospectionException("no setter method found for attribute: " + attribute.getName());
/* */ }
/* */ }
/* */ }
/* */
/* 146 */ dispatcher.bindAttributeAt(i, getter, setter);
/* */ }
/* */
/* 149 */ MBeanOperationInfo[] operations = info.getOperations();
/* 150 */ for (int i = 0; i < operations.length; i++)
/* */ {
/* 152 */ MBeanOperationInfo operation = operations[i];
/* 153 */ Method method = mmap.lookupOperation(operation);
/* 154 */ if (method == null)
/* */ {
/* 156 */ throw new IntrospectionException("no method found for operation: " + operation.getName());
/* */ }
/* */