/** * For resolving a {@link StructuredConfigKey}, such as a {@link MapConfigKey}. Here we need to * execute the custom logic, as is done by {@link #get(ConfigKey)}, but non-blocking! */ protected <T> Maybe<T> getNonBlockingResolvingStructuredKey(final ConfigKey<T> key) { Callable<T> job = new Callable<T>() { @Override public T call() { try { return get(key); } catch (RuntimeInterruptedException e) { throw Exceptions.propagate(e); // expected; return gracefully } } }; Task<T> t = Tasks.<T>builder().body(job) .displayName("Resolving dependent value") .description("Resolving "+key.getName()) .tag(BrooklynTaskTags.TRANSIENT_TASK_TAG) .build(); try { return getContext().getImmediately(t); } catch (ImmediateUnsupportedException e) { return Maybe.absent(); } }
result = exec.getImmediately(v);