Skip to content

Commit

Permalink
first attempt to implement ContextServiceImpl.contextualSupplier()
Browse files Browse the repository at this point in the history
  • Loading branch information
aubi authored and breakponchito committed May 13, 2022
1 parent b0bd598 commit c04d5dc
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,16 @@ public Runnable contextualRunnable(Runnable r) {

@Override
public <R> Supplier<R> contextualSupplier(Supplier<R> splr) {
throw new UnsupportedOperationException("Not supported yet.");
// TODO: NOT TESTED!!!
Callable<R> callable = () -> splr.get();
Callable<R> proxy = createContextualProxy(callable, null, Callable.class);
return () -> {
try {
return proxy.call();
} catch (Exception e) {
throw new RuntimeException("Exception during contextual supplier: " + e.getMessage(), e);
}
};
}

@Override
Expand Down

0 comments on commit c04d5dc

Please sign in to comment.