Interface TaskExecutorService
-
- All Superinterfaces:
RemoteExecutor
- All Known Implementing Classes:
ClusteredExecutorService,NamedClusteredExecutorService
public interface TaskExecutorService extends RemoteExecutor
AnExecutorServicethat orchestrates execution of submitted executables, for exampleRunnables,Callables andTasks, across zero or more registeredExecutorServices. Specifically,TaskExecutorServices don't execute executables. They simply orchestrate submissions to other registeredExecutorServices for execution.- Since:
- 21.06
- Author:
- bo
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceTaskExecutorService.ExecutorInfoProvides access to the currently available information for a registeredExecutorService.static interfaceTaskExecutorService.RegistrationProvides registration information about anExecutorServiceregistration.
-
Field Summary
-
Fields inherited from interface com.oracle.coherence.concurrent.executor.RemoteExecutor
DEFAULT_EXECUTOR_NAME
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <R> Task.Coordinator<R>acquire(String taskId)Attempts to acquire theTask.Coordinatorfor a previously submittedTask.TaskExecutorService.Registrationderegister(ExecutorService executor)De-registers a previously registeredExecutorService.<T> Task.Orchestration<T>orchestrate(Task<T> task)Creates a pendingTask.Orchestrationfor aTask.TaskExecutorService.Registrationregister(ExecutorService executor, TaskExecutorService.Registration.Option... options)Registers anExecutorServiceto commence execution of orchestrated tasks.default <T> Task.Coordinator<T>submit(Task<T> task)Submits theTaskfor execution by theTaskExecutorService.-
Methods inherited from interface com.oracle.coherence.concurrent.executor.RemoteExecutor
awaitTermination, execute, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownNow, submit, submit, submit
-
-
-
-
Method Detail
-
register
TaskExecutorService.Registration register(ExecutorService executor, TaskExecutorService.Registration.Option... options)
Registers anExecutorServiceto commence execution of orchestrated tasks.- Parameters:
executor- theExecutorServiceto registeroptions- theTaskExecutorService.Registration.Options for theExecutorService- Returns:
- the
TaskExecutorService.Registrationcreated for the registeredExecutorService, or the existingTaskExecutorService.Registrationwhen theExecutorServiceis already registered
-
deregister
TaskExecutorService.Registration deregister(ExecutorService executor)
De-registers a previously registeredExecutorService.Upon execution, all allocated executables are deemed to be suspended. Any results made towards completing said executables will be ignored. Executables specifically allocated to the identified
ExecutorServicewill be lost, unless they were submitted as being retained. All other executables will be re-allocated and submitted to other available and appropriate subscribedExecutorServices.- Parameters:
executor- theExecutorServiceto deregister- Returns:
- the
TaskExecutorService.Registrationthat was originally created for the registeredExecutorService, ornullif theExecutorServiceis unknown/not registered
-
orchestrate
<T> Task.Orchestration<T> orchestrate(Task<T> task)
Creates a pendingTask.Orchestrationfor aTask.- Type Parameters:
T- the type result produced by theTask- Parameters:
task- theTask- Returns:
- an
Task.Orchestration
-
submit
default <T> Task.Coordinator<T> submit(Task<T> task)
Submits theTaskfor execution by theTaskExecutorService.The default implementation is
orchestrate(task).submit()- Type Parameters:
T- the type result produced by theTask- Parameters:
task- theTask- Returns:
- a
Task.Coordinatorfor theTask - See Also:
Task.SubscribedOrchestration.submit(),Task.Collectable.submit()
-
acquire
<R> Task.Coordinator<R> acquire(String taskId)
Attempts to acquire theTask.Coordinatorfor a previously submittedTask.- Type Parameters:
R- the collected result type published by theTask.Coordinator- Parameters:
taskId- the unique identity originally allocated to theTask(available by callingTask.Coordinator.getTaskId())- Returns:
- the
Task.Coordinatorfor the specifiedTaskornullif theTaskis unknown
-
-