Object descriptorTarget = d.getFieldValue(ModelMBeanConstants.TARGET_OBJECT);
if (descriptorTarget != null)
{
String targetType = (String) d.getFieldValue(ModelMBeanConstants.TARGET_TYPE);
if (ModelMBeanConstants.OBJECT_REF.equalsIgnoreCase(targetType) == false)
throw new InvalidTargetObjectTypeException("Target type is " + targetType);
target = descriptorTarget;
}
String getMethodString = (String) d.getFieldValue(ModelMBeanConstants.GET_METHOD);
if (getMethodString != null && (getMethod == null || getMethodString.equals(getMethod.getName()) == false))
{
MBeanInvoker invoker = invocation.getInvoker();
Object object = invoker.invoke(getMethodString, new Object[0], new String[0]);
checkAssignable(getMethodString, invocation.getAttributeTypeClass(), object);
return object;
}
}
}
if (target == null)
throw new MBeanException(new ServiceNotFoundException("No Target"));
try
{
value = getMethod.invoke(target, args);
}
catch (Throwable t)
{
handleInvocationExceptions(t);
return null;
}
}
// Setter
else
{
Method setMethod = setter;
if (dynamic)
{
Descriptor d = invocation.getDescriptor();
if (d != null)
{
Object descriptorTarget = d.getFieldValue(ModelMBeanConstants.TARGET_OBJECT);
if (descriptorTarget != null)
{
String targetType = (String) d.getFieldValue(ModelMBeanConstants.TARGET_TYPE);
if (ModelMBeanConstants.OBJECT_REF.equalsIgnoreCase(targetType) == false)
throw new InvalidTargetObjectTypeException("Target type is " + targetType);
target = descriptorTarget;
}
String setMethodString = (String) d.getFieldValue(ModelMBeanConstants.SET_METHOD);
if (setMethodString != null && (setMethod == null || setMethodString.equals(setMethod.getName()) == false))
{