[infinispan-issues] [JBoss JIRA] (ISPN-1974) Add <T> Future<T> submit(Address target, Callable<T> task) at least to DefaultExecutorService

Thomas Fromm (JIRA) jira-events at lists.jboss.org
Tue Apr 10 12:47:48 EDT 2012


Thomas Fromm created ISPN-1974:
----------------------------------

             Summary: Add <T> Future<T> submit(Address target, Callable<T> task) at least to DefaultExecutorService
                 Key: ISPN-1974
                 URL: https://issues.jboss.org/browse/ISPN-1974
             Project: Infinispan
          Issue Type: Enhancement
          Components: Core API
    Affects Versions: 5.1.3.FINAL
            Reporter: Thomas Fromm
            Assignee: Manik Surtani


To easy execute tasks on specific nodes I'd like to have an additional method at DefaultExecutorService:

{code}
       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;
        }
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list