test_class.declarator: CTX_THREAD_NAME = "test-async"
test_class.modifier: private static final
test_class.original_string: private static final String CTX_THREAD_NAME = "test-async";
test_class.type: String
test_class.var_name: CTX_THREAD_NAME
test_class.declarator: CUSTOM_THREAD_NAME = "test-custom-async"
test_class.modifier: private static final
test_class.original_string: private static final String CUSTOM_THREAD_NAME = "test-custom-async";
test_class.type: String
test_class.var_name: CUSTOM_THREAD_NAME
test_class.declarator: ctxExec
test_class.modifier: private
test_class.original_string: private ExecutorService ctxExec;
test_class.type: ExecutorService
test_class.var_name: ctxExec
test_class.declarator: customExec
test_class.modifier: private
test_class.original_string: private ExecutorService customExec;
test_class.type: ExecutorService
test_class.var_name: customExec
test_class.file: modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
test_class.identifier: IgniteFutureImplTest
test_class.superclass: extends GridCommonAbstractTest
test_case.body: @Test
      public void testChainAsync() throws Exception {
          GridFutureAdapter<String> fut0 = new GridFutureAdapter<>();
  
          IgniteFuture<String> fut = createFuture(fut0);
  
          C1<IgniteFuture<String>, Integer> chainClos = new C1<IgniteFuture<String>, Integer>() {
              @Override public Integer apply(IgniteFuture<String> fut) {
                  assertEquals(CUSTOM_THREAD_NAME, Thread.currentThread().getName());
  
                  return Integer.valueOf(fut.get());
              }
          };
  
          IgniteFuture<Integer> chained1 = fut.chainAsync(chainClos, customExec);
  
          assertFalse(chained1.isDone());
  
          final CountDownLatch latch = new CountDownLatch(1);
  
          class TestClosure implements CI1<IgniteFuture<Integer>> {
              private final CountDownLatch latch;
  
              private TestClosure(CountDownLatch latch) {
                  this.latch = latch;
              }
  
              @Override public void apply(IgniteFuture<Integer> fut) {
                  assertEquals(CUSTOM_THREAD_NAME, Thread.currentThread().getName());
                  assertEquals(10, (int)fut.get());
  
                  latch.countDown();
              }
          }
  
          chained1.listen(new TestClosure(latch));
  
          fut0.onDone("10");
  
          // Chained future will be completed asynchronously.
          chained1.get(100, TimeUnit.MILLISECONDS);
  
          assertTrue(chained1.isDone());
  
          assertEquals(10, (int)chained1.get());
  
          assert latch.await(100, TimeUnit.MILLISECONDS);
  
          assertTrue(fut.isDone());
  
          assertEquals("10", fut.get());
  
          // Test finished future
          GridFinishedFuture<String> ffut0 = new GridFinishedFuture<>("10");
  
          CountDownLatch latch1 = new CountDownLatch(1);
  
          IgniteFuture<Integer> chained2 = createFuture(ffut0).chainAsync(chainClos, customExec);
  
          chained2.listen(new TestClosure(latch1));
  
          chained2.get(100, TimeUnit.MILLISECONDS);
  
          assertTrue(chained2.isDone());
  
          assertEquals(10, (int)chained2.get());
  
          assert latch1.await(100, TimeUnit.MILLISECONDS);
      }
test_case.class_method_signature: IgniteFutureImplTest.testChainAsync()
test_case.full_signature: @Test public void testChainAsync()
test_case.identifier: testChainAsync
test_case.invocations: createFuture assertEquals getName currentThread valueOf get chainAsync assertFalse isDone assertEquals getName currentThread assertEquals get countDown listen onDone get assertTrue isDone assertEquals get await assertTrue isDone assertEquals get chainAsync createFuture listen get assertTrue isDone assertEquals get await
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testChainAsync()
focal_class.declarator: fut
focal_class.modifier: protected final
focal_class.original_string: protected final IgniteInternalFuture<V> fut;
focal_class.type: IgniteInternalFuture<V>
focal_class.var_name: fut
focal_class.file: modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
focal_class.identifier: IgniteFutureImpl
focal_class.interfaces: implements IgniteFuture<V>
focal_class.class_method_signature: IgniteFutureImpl.IgniteFutureImpl(IgniteInternalFuture<V> fut)
focal_class.full_signature: public  IgniteFutureImpl(IgniteInternalFuture<V> fut)
focal_class.identifier: IgniteFutureImpl
focal_class.modifiers: public
focal_class.parameters: (IgniteInternalFuture<V> fut)
focal_class.signature:  IgniteFutureImpl(IgniteInternalFuture<V> fut)
focal_class.class_method_signature: IgniteFutureImpl.internalFuture()
focal_class.full_signature: public IgniteInternalFuture<V> internalFuture()
focal_class.identifier: internalFuture
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: IgniteInternalFuture<V>
focal_class.signature: IgniteInternalFuture<V> internalFuture()
focal_class.class_method_signature: IgniteFutureImpl.isCancelled()
focal_class.full_signature: @Override public boolean isCancelled()
focal_class.identifier: isCancelled
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isCancelled()
focal_class.class_method_signature: IgniteFutureImpl.isDone()
focal_class.full_signature: @Override public boolean isDone()
focal_class.identifier: isDone
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isDone()
focal_class.class_method_signature: IgniteFutureImpl.listen(IgniteInClosure<? super IgniteFuture<V>> lsnr)
focal_class.full_signature: @Override public void listen(IgniteInClosure<? super IgniteFuture<V>> lsnr)
focal_class.identifier: listen
focal_class.modifiers: @Override public
focal_class.parameters: (IgniteInClosure<? super IgniteFuture<V>> lsnr)
focal_class.return: void
focal_class.signature: void listen(IgniteInClosure<? super IgniteFuture<V>> lsnr)
focal_class.class_method_signature: IgniteFutureImpl.listenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr, Executor exec)
focal_class.full_signature: @Override public void listenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr, Executor exec)
focal_class.identifier: listenAsync
focal_class.modifiers: @Override public
focal_class.parameters: (IgniteInClosure<? super IgniteFuture<V>> lsnr, Executor exec)
focal_class.return: void
focal_class.signature: void listenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr, Executor exec)
focal_class.class_method_signature: IgniteFutureImpl.chain(final IgniteClosure<? super IgniteFuture<V>, T> doneCb)
focal_class.full_signature: @Override public IgniteFuture<T> chain(final IgniteClosure<? super IgniteFuture<V>, T> doneCb)
focal_class.identifier: chain
focal_class.modifiers: @Override public
focal_class.parameters: (final IgniteClosure<? super IgniteFuture<V>, T> doneCb)
focal_class.return: IgniteFuture<T>
focal_class.signature: IgniteFuture<T> chain(final IgniteClosure<? super IgniteFuture<V>, T> doneCb)
focal_class.class_method_signature: IgniteFutureImpl.chainAsync(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          Executor exec)
focal_class.full_signature: @Override public IgniteFuture<T> chainAsync(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          Executor exec)
focal_class.identifier: chainAsync
focal_class.modifiers: @Override public
focal_class.parameters: (final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          Executor exec)
focal_class.return: IgniteFuture<T>
focal_class.signature: IgniteFuture<T> chainAsync(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          Executor exec)
focal_class.class_method_signature: IgniteFutureImpl.chainInternal(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          @Nullable Executor exec)
focal_class.full_signature: protected IgniteInternalFuture<T> chainInternal(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          @Nullable Executor exec)
focal_class.identifier: chainInternal
focal_class.modifiers: protected
focal_class.parameters: (final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          @Nullable Executor exec)
focal_class.return: IgniteInternalFuture<T>
focal_class.signature: IgniteInternalFuture<T> chainInternal(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          @Nullable Executor exec)
focal_class.class_method_signature: IgniteFutureImpl.cancel()
focal_class.full_signature: @Override public boolean cancel()
focal_class.identifier: cancel
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean cancel()
focal_class.class_method_signature: IgniteFutureImpl.get()
focal_class.full_signature: @Override public V get()
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: V
focal_class.signature: V get()
focal_class.class_method_signature: IgniteFutureImpl.get(long timeout)
focal_class.full_signature: @Override public V get(long timeout)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (long timeout)
focal_class.return: V
focal_class.signature: V get(long timeout)
focal_class.class_method_signature: IgniteFutureImpl.get(long timeout, TimeUnit unit)
focal_class.full_signature: @Override public V get(long timeout, TimeUnit unit)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (long timeout, TimeUnit unit)
focal_class.return: V
focal_class.signature: V get(long timeout, TimeUnit unit)
focal_class.class_method_signature: IgniteFutureImpl.convertException(IgniteCheckedException e)
focal_class.full_signature: protected RuntimeException convertException(IgniteCheckedException e)
focal_class.identifier: convertException
focal_class.modifiers: protected
focal_class.parameters: (IgniteCheckedException e)
focal_class.return: RuntimeException
focal_class.signature: RuntimeException convertException(IgniteCheckedException e)
focal_class.class_method_signature: IgniteFutureImpl.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: @Override public <T> IgniteFuture<T> chainAsync(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          Executor exec) {
          A.notNull(doneCb, "doneCb");
          A.notNull(exec, "exec");
  
          return new IgniteFutureImpl<>(chainInternal(doneCb, exec));
      }
focal_method.class_method_signature: IgniteFutureImpl.chainAsync(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          Executor exec)
focal_method.full_signature: @Override public IgniteFuture<T> chainAsync(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          Executor exec)
focal_method.identifier: chainAsync
focal_method.invocations: notNull notNull chainInternal
focal_method.modifiers: @Override public
focal_method.parameters: (final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          Executor exec)
focal_method.return: IgniteFuture<T>
focal_method.signature: IgniteFuture<T> chainAsync(final IgniteClosure<? super IgniteFuture<V>, T> doneCb,
          Executor exec)