Examples of invokeAny()


Examples of com.hazelcast.core.IExecutorService.invokeAny()

        IExecutorService service = client.getExecutorService(randomString());
        Collection<Callable<String>> collection = new ArrayList<Callable<String>>();
        collection.add(new AppendCallable());
        collection.add(new AppendCallable());

        service.invokeAny(collection);
    }

    @Test(expected = UnsupportedOperationException.class)
    public void testInvokeAnyTimeOut() throws Throwable {
        IExecutorService service = client.getExecutorService(randomString());
View Full Code Here

Examples of com.hazelcast.core.IExecutorService.invokeAny()

    public void testInvokeAnyTimeOut() throws Throwable {
        IExecutorService service = client.getExecutorService(randomString());
        Collection<Callable<String>> collection = new ArrayList<Callable<String>>();
        collection.add(new AppendCallable());
        collection.add(new AppendCallable());
        service.invokeAny(collection, 1, TimeUnit.MINUTES);
    }
}
View Full Code Here

Examples of java.util.concurrent.ExecutorService.invokeAny()

      Assert.assertNotNull(connection);
      pool.release(connection);
      connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      ExecutorService service = Executors.newSingleThreadExecutor();
      service.invokeAny(Collections.singleton(new Callable<Connection>() {
        @Override
        public Connection call() throws Exception {
          return pool.acquire(host);
        }
      }), 2, TimeUnit.SECONDS);
View Full Code Here

Examples of java.util.concurrent.ExecutorService.invokeAny()

      Assert.assertNotNull(connection);
      pool.release(connection);
      connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      ExecutorService service = Executors.newSingleThreadExecutor();
      service.invokeAny(Collections.singleton(new Callable<Connection>() {
        @Override
        public Connection call() throws Exception {
          return pool.acquire(host);
        }
      }), 2, TimeUnit.SECONDS);
View Full Code Here

Examples of java.util.concurrent.ExecutorService.invokeAny()

            ExecutionException, TimeoutException {
        ExecutorService service = delegate.get();
        if (service != null) {
            // since the tasks are either executed or cancelled, there is no
            // need to track them
            return service.invokeAny(tasks, timeout, unit);
        }
        throw new RejectedExecutionException(
                "Execution service is terminated. No more tasks can be executed.");
    }
View Full Code Here

Examples of java.util.concurrent.ExecutorService.invokeAny()

            throws InterruptedException, ExecutionException {
        ExecutorService service = delegate.get();
        if (service != null) {
            // since the tasks are either executed or cancelled, there is no
            // need to track them
            return service.invokeAny(tasks);
        }
        throw new RejectedExecutionException(
                "Execution service is terminated. No more tasks can be executed.");
    }
View Full Code Here

Examples of java.util.concurrent.ExecutorService.invokeAny()

         });
      }
      try
      {
         // we wait 5 seconds to get the first matching hardware address. After that, we give up and return null
         byte[] address = executor.invokeAny(tasks, 5, TimeUnit.SECONDS);
         return address;
      }
      catch (Exception e)
      {
         return null;
View Full Code Here

Examples of java.util.concurrent.ExecutorService.invokeAny()

         });
      }
      try
      {
         // we wait 5 seconds to get the first matching hardware address. After that, we give up and return null
         byte[] address = executor.invokeAny(tasks, 5, TimeUnit.SECONDS);
         return address;
      }
      catch (Exception e)
      {
         return null;
View Full Code Here

Examples of java.util.concurrent.ExecutorService.invokeAny()

      ExecutionException, TimeoutException {
    ExecutorService service = delegate.get();
    if (service != null) {
      // since the tasks are either executed or cancelled, there is no
      // need to track them
      return service.invokeAny(tasks, timeout, unit);
    }
    throw new RejectedExecutionException(
        "Execution service is terminated. No more tasks can be executed.");
  }
View Full Code Here

Examples of java.util.concurrent.ExecutorService.invokeAny()

      throws InterruptedException, ExecutionException {
    ExecutorService service = delegate.get();
    if (service != null) {
      // since the tasks are either executed or cancelled, there is no
      // need to track them
      return service.invokeAny(tasks);
    }
    throw new RejectedExecutionException(
        "Execution service is terminated. No more tasks can be executed.");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.