newValue = server.getAttribute(bean.getObjectName(), getName());
} catch (ReflectionException e) {
supportedType = false;
registerFailure(e);
throw new EmsException("Could not load attribute value " + e.toString(),e);
} catch (InstanceNotFoundException e) {
registerFailure(e);
throw new EmsException("Could not load attribute value, bean instance not found " + bean.getObjectName().toString(),e);
} catch (MBeanException e) {
registerFailure(e);
Throwable t = e.getTargetException();
if (t != null)
throw new EmsException("Could not load attribute value, target bean threw exception " + t.getLocalizedMessage(),t);
else
throw new EmsException("Could not load attribute value " + e.getLocalizedMessage(), e);
} catch (AttributeNotFoundException e) {
registerFailure(e);
throw new EmsException("Could not load attribute value, attribute [" + getName() + "] not found",e);
} catch(UndeclaredThrowableException e) {
if (e.getUndeclaredThrowable() instanceof InvocationTargetException) {
Throwable t = e.getCause();
if (t.getCause() instanceof NotSerializableException) {
supportedType = false;
registerFailure(t.getCause());
throw new EmsException("Could not load attribute value " + t.getLocalizedMessage(),t.getCause());
} else
throw new EmsException("Could not load attribute value " + t.getLocalizedMessage(),t);
}
throw new EmsException("Could not load attribute value " + e.getLocalizedMessage(),e);
} catch (RuntimeException re) {
supportedType = false;
// TODO GH: Figure this one out
// Getting weblogic.management.NoAccessRuntimeException on wl9
registerFailure(re);
throw new EmsException("Could not load attribute value " + re.getLocalizedMessage(),re);
} catch (NoClassDefFoundError ncdfe) {
supportedType = false;
registerFailure(ncdfe);
throw new EmsException("Could not load attribute value " + ncdfe.getLocalizedMessage(),ncdfe);
} catch (Throwable t) {
throw new EmsException("Could not load attribute value " + t.getLocalizedMessage(),t);
}
alterValue(newValue);
return newValue;
}