org.springframework.core.task.support

Class TaskExecutorAdapter

    • Constructor Detail

      • TaskExecutorAdapter

        public TaskExecutorAdapter(Executor concurrentExecutor)
        Create a new TaskExecutorAdapter, using the given JDK concurrent executor.
        Parameters:
        concurrentExecutor - the JDK concurrent executor to delegate to
    • Method Detail

      • submit

        public Future<?> submit(Runnable task)
        Description copied from interface: AsyncTaskExecutor
        Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.
        Specified by:
        submit in interface  AsyncTaskExecutor
        Parameters:
        task - the Runnable to execute (never null)
        Returns:
        a Future representing pending completion of the task
      • submit

        public <T> Future<T> submit(Callable<T> task)
        Description copied from interface: AsyncTaskExecutor
        Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.
        Specified by:
        submit in interface  AsyncTaskExecutor
        Parameters:
        task - the Callable to execute (never null)
        Returns:
        a Future representing pending completion of the task