-
Enhancement
-
Resolution: Done
-
Major
-
5.1.3.FINAL
-
None
To easy execute tasks on specific nodes I'd like to have an additional method at DefaultExecutorService:
public <T> Future<T> submit(Address target, Callable<T> task){ if (task == null) throw new NullPointerException(); if (target == null) throw new NullPointerException(); List<Address> members = rpc.getTransport().getMembers(); if(!members.contains(target)){ throw new IllegalArgumentException("Unknown node "+target.toString()); } Address me = rpc.getAddress(); DistributedExecuteCommand<T> c = null; if(target.equals(me)){ c = factory.buildDistributedExecuteCommand(clone(task), me, null); } else { c = factory.buildDistributedExecuteCommand(task, me, null); } DistributedRunnableFuture<T> f = new DistributedRunnableFuture<T>(c); executeFuture(target, f); return f; }