{
stateChangingMethod.invoke(this);
}
catch (IllegalAccessException e)
{
throw new ServerScopedRuntimeException("Unexpected access exception when calling state transition", e);
}
catch (InvocationTargetException e)
{
Throwable underlying = e.getTargetException();
if(underlying instanceof RuntimeException)
{
throw (RuntimeException)underlying;
}
if(underlying instanceof Error)
{
throw (Error) underlying;
}
throw new ServerScopedRuntimeException("Unexpected checked exception when calling state transition", underlying);
}
}
}
}