Class NamedClusteredExecutorService
- java.lang.Object
-
- com.oracle.coherence.concurrent.executor.ClusteredExecutorService
-
- com.oracle.coherence.concurrent.executor.NamedClusteredExecutorService
-
- All Implemented Interfaces:
RemoteExecutor,TaskExecutorService
public class NamedClusteredExecutorService extends ClusteredExecutorService
AClusteredExecutorServicethat dispatches to executors associated with a logical name.- Since:
- 21.12
- Author:
- rl 11.20.21
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classNamedClusteredExecutorService.NamedOrchestration<T>ClusteredOrchestrationextension that orchestrates only to executors associated with the givenname.-
Nested classes/interfaces inherited from class com.oracle.coherence.concurrent.executor.ClusteredExecutorService
ClusteredExecutorService.CESRunnableFuture<V>, ClusteredExecutorService.State
-
Nested classes/interfaces inherited from interface com.oracle.coherence.concurrent.executor.TaskExecutorService
TaskExecutorService.ExecutorInfo, TaskExecutorService.Registration
-
-
Field Summary
Fields Modifier and Type Field Description protected Namef_nameThe executor's logical name.protected com.tangosol.net.NamedCachem_viewNamedLocal view of executors matching this executor's name.-
Fields inherited from class com.oracle.coherence.concurrent.executor.ClusteredExecutorService
f_mapLocalRegistrations, f_scheduledExecutorService, f_state, m_cacheService
-
Fields inherited from interface com.oracle.coherence.concurrent.executor.RemoteExecutor
DEFAULT_EXECUTOR_NAME
-
-
Constructor Summary
Constructors Constructor Description NamedClusteredExecutorService(Name name)Constructs aNamedClusteredExecutorServicefor the givenName.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(com.tangosol.util.function.Remote.Runnable command)Executes the given command at some time in the future.NamegetName()Return theNameof thisNamedClusteredExecutorService.protected voidinit(com.tangosol.net.CacheService cacheService)Responsible for adding indexes for theClusteredAssignmentcache.<T> Task.Orchestration<T>orchestrate(Task<T> task)Creates a pendingTask.Orchestrationfor aTask.protected voidrelease()Releases resources associated with thisNamedExecutorService.protected static com.tangosol.net.Sessionsession()Return the Coherencesessionfor thecoherence-concurrentmodule.voidshutdown()Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.List<Runnable>shutdownNow()Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.-
Methods inherited from class com.oracle.coherence.concurrent.executor.ClusteredExecutorService
acquire, awaitTermination, cancelAll, cancelAll, deregister, doInvokeAny, getCacheService, getScheduledExecutorService, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, register, schedule, schedule, scheduleAtFixedRate, scheduleRunnable, scheduleWithFixedDelay, setState, shutdownInternal, shutdownNowInternal, submit, submit, submit, submit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.oracle.coherence.concurrent.executor.TaskExecutorService
submit
-
-
-
-
Field Detail
-
f_name
protected final Name f_name
The executor's logical name.
-
m_viewNamed
protected com.tangosol.net.NamedCache m_viewNamed
Local view of executors matching this executor's name. If the map is empty, it means there is no registered executors for the given name causing attempted executions to be rejected.
-
-
Method Detail
-
orchestrate
public <T> Task.Orchestration<T> orchestrate(Task<T> task)
Description copied from interface:TaskExecutorServiceCreates a pendingTask.Orchestrationfor aTask.- Specified by:
orchestratein interfaceTaskExecutorService- Overrides:
orchestratein classClusteredExecutorService- Type Parameters:
T- the type result produced by theTask- Parameters:
task- theTask- Returns:
- an
Task.Orchestration
-
execute
public void execute(com.tangosol.util.function.Remote.Runnable command)
Description copied from interface:RemoteExecutorExecutes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of theExecutorimplementation.- Specified by:
executein interfaceRemoteExecutor- Overrides:
executein classClusteredExecutorService- Parameters:
command- the runnable task
-
shutdown
public void shutdown()
Description copied from interface:RemoteExecutorInitiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down.This method does not wait for previously submitted tasks to complete execution. Use
awaitTerminationto do that.- Specified by:
shutdownin interfaceRemoteExecutor- Overrides:
shutdownin classClusteredExecutorService
-
shutdownNow
public List<Runnable> shutdownNow()
Description copied from interface:RemoteExecutorAttempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.This method does not wait for actively executing tasks to terminate. Use
awaitTerminationto do that.There are no guarantees beyond best-effort attempts to stop processing actively executing tasks. For example, typical implementations will cancel via
Thread.interrupt(), so any task that fails to respond to interrupts may never terminate.- Specified by:
shutdownNowin interfaceRemoteExecutor- Overrides:
shutdownNowin classClusteredExecutorService- Returns:
- list of tasks that never commenced execution
-
init
protected void init(com.tangosol.net.CacheService cacheService)
Description copied from class:ClusteredExecutorServiceResponsible for adding indexes for theClusteredAssignmentcache.- Overrides:
initin classClusteredExecutorService- Parameters:
cacheService- the cache service providing the caches used by the executor service
-
getName
public Name getName()
Return theNameof thisNamedClusteredExecutorService.- Returns:
- the
Nameof thisNamedClusteredExecutorService
-
session
protected static com.tangosol.net.Session session()
Return the Coherencesessionfor thecoherence-concurrentmodule.- Returns:
- the Coherence
sessionfor thecoherence-concurrentmodule - Throws:
IllegalStateException- if no session is found; most likely means this API was called without initializing Coherence using the Bootstrap API
-
release
protected void release()
Releases resources associated with thisNamedExecutorService.
-
-