return (T) getGetter().invoke(configuredObject);
}
catch (IllegalAccessException e)
{
// This should never happen as it would imply a getter which is not public
throw new ServerScopedRuntimeException("Unable to get value for '"+getName()
+"' from configured object of category "
+ configuredObject.getCategoryClass().getSimpleName(), e);
}
catch (InvocationTargetException e)
{
Throwable targetException = e.getTargetException();
if(targetException instanceof RuntimeException)
{
throw (RuntimeException)targetException;
}
else if(targetException instanceof Error)
{
throw (Error)targetException;
}
else
{
// This should never happen as it would imply a getter which is declaring a checked exception
throw new ServerScopedRuntimeException("Unable to get value for '"+getName()
+"' from configured object of category "
+ configuredObject.getCategoryClass().getSimpleName(), e);
}
}