Class AsyncSupportAdapter<T extends IgniteAsyncSupport>

    • Constructor Detail

      • AsyncSupportAdapter

        public AsyncSupportAdapter()
        Default constructor.
      • AsyncSupportAdapter

        public AsyncSupportAdapter​(boolean async)
        Parameters:
        async - Async enabled flag.
    • Method Detail

      • withAsync

        public T withAsync()
        Gets instance of this component with asynchronous mode enabled.
        Specified by:
        withAsync in interface IgniteAsyncSupport
        Returns:
        Instance of this component with asynchronous mode enabled.
      • createAsyncInstance

        protected T createAsyncInstance()
        Creates component with asynchronous mode enabled.
        Returns:
        Component with asynchronous mode enabled.
      • isAsync

        public boolean isAsync()
        Specified by:
        isAsync in interface IgniteAsyncSupport
        Returns:
        True if asynchronous mode is enabled.
      • future

        public <R> IgniteFuture<R> future()
        Gets and resets future for previous asynchronous operation.
        Specified by:
        future in interface IgniteAsyncSupport
        Type Parameters:
        R - Type of the future result.
        Returns:
        Future for previous asynchronous operation.
      • future

        public <R> IgniteFuture<R> future​(boolean reset)
        Gets and optionally resets future for previous asynchronous operation.
        Parameters:
        reset - Specifies whether to reset future.
        Returns:
        Future for previous asynchronous operation.
      • saveOrGet

        public <R> R saveOrGet​(IgniteInternalFuture<R> fut)
                        throws IgniteCheckedException
        Parameters:
        fut - Future.
        Returns:
        If async mode is enabled saves future and returns null, otherwise waits for future and returns result.
        Throws:
        IgniteCheckedException - If asynchronous mode is disabled and future failed.