Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/480#discussion_r103447467
--- Diff:
core/src/main/java/org/apache/brooklyn/util/core/task/BasicExecutionContext.java
---
@@ -96,7 +98,50 @@ public ExecutionManager getExecutionManager() {
/** returns tasks started by this context (or tasks which have all the
tags on this object) */
@Override
public Set<Task<?>> getTasks() { return
executionManager.getTasksWithAllTags(tags); }
-
+
+ /** performs execution without spawning a new task thread, though it
does temporarily set a fake task for the purpose of getting context;
+ * currently supports suppliers or callables */
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> Maybe<T> getImmediately(Object callableOrSupplier) {
+ BasicTask<?> fakeTaskForContext;
+ if (callableOrSupplier instanceof BasicTask) {
+ fakeTaskForContext = (BasicTask<?>)callableOrSupplier;
--- End diff --
If I change `ValueResolver.getMaybeInternal()` to set
`allowImmediateExecution = true;` when it is passed a `TaskAdaptable`, then the
above test does pass.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---