[New] ExecutionHandler.getControllers() returns a List

This commit is contained in:
Robert von Burg 2022-01-26 12:55:59 +01:00
parent 7f84d81ca6
commit e8964fccb5
2 changed files with 5 additions and 4 deletions

View File

@ -45,11 +45,11 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
} }
@Override @Override
public Collection<Controller> getControllers(String realm) { public List<Controller> getControllers(String realm) {
Map<Locator, Controller> controllersByRealm = this.controllers.getMap(realm); Map<Locator, Controller> controllersByRealm = this.controllers.getMap(realm);
if (controllersByRealm == null) if (controllersByRealm == null)
return Collections.emptyList(); return new ArrayList<>();
return controllersByRealm.values(); return new ArrayList<>(controllersByRealm.values());
} }
@Override @Override

View File

@ -1,6 +1,7 @@
package li.strolch.execution; package li.strolch.execution;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -76,7 +77,7 @@ public abstract class ExecutionHandler extends StrolchComponent {
* *
* @return the controllers * @return the controllers
*/ */
public abstract Collection<Controller> getControllers(String realm); public abstract List<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