[New] Added ExecutionHandler.getControllers(String)
This commit is contained in:
parent
17645c11a2
commit
3bdd87bd73
|
@ -45,6 +45,14 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
|
||||||
super(container, componentName);
|
super(container, componentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<Controller> getControllers(String realm) {
|
||||||
|
Map<Locator, Controller> controllersByRealm = this.controllers.getMap(realm);
|
||||||
|
if (controllersByRealm == null)
|
||||||
|
return Collections.emptyList();
|
||||||
|
return controllersByRealm.values();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Controller getController(String realm, Activity activity) {
|
public Controller getController(String realm, Activity activity) {
|
||||||
return this.controllers.getElement(realm, activity.getLocator());
|
return this.controllers.getElement(realm, activity.getLocator());
|
||||||
|
@ -294,8 +302,8 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
|
||||||
if (getContainer().hasComponent(OperationsLog.class)) {
|
if (getContainer().hasComponent(OperationsLog.class)) {
|
||||||
getComponent(OperationsLog.class).addMessage(
|
getComponent(OperationsLog.class).addMessage(
|
||||||
new LogMessage(realm, SYSTEM_USER_AGENT, controller.getLocator(), LogSeverity.Exception,
|
new LogMessage(realm, SYSTEM_USER_AGENT, controller.getLocator(), LogSeverity.Exception,
|
||||||
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"), "execution.handler.failed.execution")
|
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"),
|
||||||
.withException(e).value("reason", e));
|
"execution.handler.failed.execution").withException(e).value("reason", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -316,8 +324,8 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
|
||||||
if (getContainer().hasComponent(OperationsLog.class)) {
|
if (getContainer().hasComponent(OperationsLog.class)) {
|
||||||
getComponent(OperationsLog.class).addMessage(
|
getComponent(OperationsLog.class).addMessage(
|
||||||
new LogMessage(realm, SYSTEM_USER_AGENT, locator, LogSeverity.Exception,
|
new LogMessage(realm, SYSTEM_USER_AGENT, locator, LogSeverity.Exception,
|
||||||
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"), "execution.handler.failed.executed")
|
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"),
|
||||||
.withException(e).value("reason", e));
|
"execution.handler.failed.executed").withException(e).value("reason", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -338,8 +346,8 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
|
||||||
if (getContainer().hasComponent(OperationsLog.class)) {
|
if (getContainer().hasComponent(OperationsLog.class)) {
|
||||||
getComponent(OperationsLog.class).addMessage(
|
getComponent(OperationsLog.class).addMessage(
|
||||||
new LogMessage(realm, SYSTEM_USER_AGENT, locator, LogSeverity.Exception,
|
new LogMessage(realm, SYSTEM_USER_AGENT, locator, LogSeverity.Exception,
|
||||||
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"), "execution.handler.failed.stopped")
|
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"),
|
||||||
.withException(e).value("reason", e));
|
"execution.handler.failed.stopped").withException(e).value("reason", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -360,8 +368,8 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
|
||||||
if (getContainer().hasComponent(OperationsLog.class)) {
|
if (getContainer().hasComponent(OperationsLog.class)) {
|
||||||
getComponent(OperationsLog.class).addMessage(
|
getComponent(OperationsLog.class).addMessage(
|
||||||
new LogMessage(realm, SYSTEM_USER_AGENT, locator, LogSeverity.Exception,
|
new LogMessage(realm, SYSTEM_USER_AGENT, locator, LogSeverity.Exception,
|
||||||
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"), "execution.handler.failed.error")
|
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"),
|
||||||
.withException(e).value("reason", e));
|
"execution.handler.failed.error").withException(e).value("reason", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -382,8 +390,8 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
|
||||||
if (getContainer().hasComponent(OperationsLog.class)) {
|
if (getContainer().hasComponent(OperationsLog.class)) {
|
||||||
getComponent(OperationsLog.class).addMessage(
|
getComponent(OperationsLog.class).addMessage(
|
||||||
new LogMessage(realm, SYSTEM_USER_AGENT, locator, LogSeverity.Exception,
|
new LogMessage(realm, SYSTEM_USER_AGENT, locator, LogSeverity.Exception,
|
||||||
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"), "execution.handler.failed.warning")
|
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"),
|
||||||
.withException(e).value("reason", e));
|
"execution.handler.failed.warning").withException(e).value("reason", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -408,8 +416,8 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
|
||||||
if (getContainer().hasComponent(OperationsLog.class)) {
|
if (getContainer().hasComponent(OperationsLog.class)) {
|
||||||
getComponent(OperationsLog.class).addMessage(
|
getComponent(OperationsLog.class).addMessage(
|
||||||
new LogMessage(realm, SYSTEM_USER_AGENT, activity.getLocator(), LogSeverity.Exception,
|
new LogMessage(realm, SYSTEM_USER_AGENT, activity.getLocator(), LogSeverity.Exception,
|
||||||
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"), "execution.handler.failed.archive")
|
LogMessageState.Information, ResourceBundle.getBundle("strolch-service"),
|
||||||
.withException(e).value("reason", e));
|
"execution.handler.failed.archive").withException(e).value("reason", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package li.strolch.execution;
|
package li.strolch.execution;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
|
@ -57,6 +58,16 @@ public abstract class ExecutionHandler extends StrolchComponent {
|
||||||
return getExecutorService("ExecutionHandler");
|
return getExecutorService("ExecutionHandler");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the controllers for the given realm
|
||||||
|
*
|
||||||
|
* @param realm
|
||||||
|
* the realm for which to get the controller
|
||||||
|
*
|
||||||
|
* @return the controllers
|
||||||
|
*/
|
||||||
|
public abstract Collection<Controller> getControllers(String realm);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the controller for the given realm and activity, null if it does not exist
|
* Returns the controller for the given realm and activity, null if it does not exist
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue