protected <T extends Enum<?>> T getComponentMappedState(ManagedComponent comp, ManagedObject mo, Object name, ContextStateMapper<T> mapper)
{
T state = mapper.getErrorState();
try
{
RuntimeComponentDispatcher dispatcher;
if (mo != null && mo.getTransientAttachment(MBeanRuntimeComponentDispatcher.class.getName()) != null)
{
dispatcher = mbeanProxyFactory.getDispatcher();
}
else
{
dispatcher = this.dispatcher;
}
if (dispatcher != null)
{
state = dispatcher.mapControllerState(name, mapper);
}
}
catch(Exception e)
{
log.debug("Failed to get controller state", e);