Class AbstractOrchestration<T, C extends TaskExecutorService>
java.lang.Object
com.oracle.coherence.concurrent.executor.AbstractOrchestration<T,C>
- Type Parameters:
T- the type of results produced by aTaskC- theTaskExecutorServicethat created theTask.Orchestration
- All Implemented Interfaces:
Task.Orchestration<T>,Task.SubscribedOrchestration<T>
- Direct Known Subclasses:
ClusteredOrchestration
public abstract class AbstractOrchestration<T, C extends TaskExecutorService>
extends Object
implements Task.Orchestration<T>
A base implementation of a
Task.Orchestration.- Since:
- 21.12
- Author:
- bo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OptionsByType<Task.Option> TheTask.Options forTask.Orchestration.protected Task.PropertiesTheTask.Propertiesfor the orchestratedTask.protected DurationThe optionalDurationto retain the task after it is completed.protected Set<Task.Subscriber<? super T>> The set ofTask.Subscribers for the orchestratedTask.protected StringTheTaskidentity.protected ExecutionStrategyprotected ExecutionStrategyBuilderTheExecutionStrategyBuilderused to build theExecutionStrategy.TheTaskto execute.protected CTheTaskExecutorServicethat created theTask.Orchestration. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractOrchestration(C taskExecutorService, Task<T> task) Constructs aTask.Orchestration. -
Method Summary
Modifier and TypeMethodDescriptionSets the unique identity for theTaskwhen it is orchestrated.protected abstract Task.Collectable<T, T> collect()Obtain aTask.Collectableusing the default collection mechanism.<V extends Serializable>
Task.Orchestration<T> Defines theTask.Propertiesfor theTask.filter(Remote.Predicate<? super TaskExecutorService.ExecutorInfo> predicate) Limit theExecutors to only those that satisfy the specifiedRemote.Predicate.Obtains theExecutionStrategyfor theTaskorchestration.Obtains theOptionsByTypefor theTaskorchestration.Obtains theTask.Propertiesfor theTaskorchestration.protected Supplier<Task.Properties> Return aSupplierof aTask.Propertiesinstance.getTask()Obtains theTaskto orchestrate.Obtains theTask.Orchestrationthat created theTask.Orchestration.Obtains theTaskidentity.limit(int cLimit) Sets theDurationto retain the task after it is completed.submit()Submits theTaskfor orchestration by theTaskExecutorService.subscribe(Task.Subscriber<? super T> subscriber) Registers the specifiedTask.Subscriberas part of the orchestration of theTask.with(Task.Option... options) Sets theTask.Options for orchestration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oracle.coherence.concurrent.executor.Task.Orchestration
collect
-
Field Details
-
m_taskExecutorService
TheTaskExecutorServicethat created theTask.Orchestration. -
m_task
-
m_sTaskId
-
m_strategyBuilder
TheExecutionStrategyBuilderused to build theExecutionStrategy. -
m_strategy
-
m_optionsByType
TheTask.Options forTask.Orchestration. -
m_properties
TheTask.Propertiesfor the orchestratedTask. -
m_retainDuration
-
m_setSubscribers
The set ofTask.Subscribers for the orchestratedTask.
-
-
Constructor Details
-
AbstractOrchestration
Constructs aTask.Orchestration.- Parameters:
taskExecutorService- theTaskExecutorServicethat created theTask.Orchestrationtask- theTaskto be orchestrated
-
-
Method Details
-
concurrently
Description copied from interface:Task.OrchestrationSpecify that theTaskshould be executed concurrently on its assignedExecutors.This is the default setting for execution.
- Specified by:
concurrentlyin interfaceTask.Orchestration<T>- Returns:
- the
Task.Orchestrationto permit fluent-style method chaining
-
sequentially
Description copied from interface:Task.Orchestration- Specified by:
sequentiallyin interfaceTask.Orchestration<T>- Returns:
- the
Task.Orchestrationto permit fluent-style method chaining
-
filter
public Task.Orchestration<T> filter(Remote.Predicate<? super TaskExecutorService.ExecutorInfo> predicate) Description copied from interface:Task.OrchestrationLimit theExecutors to only those that satisfy the specifiedRemote.Predicate.- Specified by:
filterin interfaceTask.Orchestration<T>- Parameters:
predicate- theTaskExecutorService.ExecutorInfopredicate- Returns:
- the
Task.Orchestrationto permit fluent-style method chaining
-
limit
Description copied from interface:Task.Orchestration- Specified by:
limitin interfaceTask.Orchestration<T>- Parameters:
cLimit- the number ofExecutors to use- Returns:
- the
Task.Orchestrationto permit fluent-style method chaining
-
as
Description copied from interface:Task.OrchestrationSets the unique identity for theTaskwhen it is orchestrated.- Specified by:
asin interfaceTask.Orchestration<T>- Parameters:
taskId- the unique identity for theTask- Returns:
- the
Task.Orchestrationto permit fluent-style method chaining
-
with
Description copied from interface:Task.OrchestrationSets theTask.Options for orchestration.- Specified by:
within interfaceTask.Orchestration<T>- Parameters:
options- theTask.Option- Returns:
- the
Task.Orchestrationto permit fluent-style method chaining
-
retain
Description copied from interface:Task.OrchestrationSets theDurationto retain the task after it is completed.- Specified by:
retainin interfaceTask.Orchestration<T>- Parameters:
duration- the duration to retain the task after it is completed.- Returns:
- the
Task.Orchestrationto permit fluent-style method chaining
-
subscribe
Description copied from interface:Task.SubscribedOrchestrationRegisters the specifiedTask.Subscriberas part of the orchestration of theTask.This method may be used multiple times to register multiple
Task.Subscribers.This method is mutually exclusive to
Task.Orchestration.collect(Collector). To subscribe when using aTask.Collector, useTask.Collectable.subscribe(Subscriber)on theTask.Collectablereturned byTask.Orchestration.collect(Collector).- Specified by:
subscribein interfaceTask.SubscribedOrchestration<T>- Parameters:
subscriber- theTask.Subscriber- Returns:
- the
Task.Orchestrationto permit fluent-style method chaining - See Also:
-
submit
Description copied from interface:Task.SubscribedOrchestrationSubmits theTaskfor orchestration by theTaskExecutorService.- Specified by:
submitin interfaceTask.SubscribedOrchestration<T>- Returns:
- a
Task.Coordinatorfor managing an orchestratedTaskand publishing of collected results toTask.Subscribers - See Also:
-
define
Description copied from interface:Task.OrchestrationDefines theTask.Propertiesfor theTask.- Specified by:
definein interfaceTask.Orchestration<T>- Type Parameters:
V- the value type of the property- Parameters:
sName- the name of the propertyvalue- the value of the property- Returns:
- the
Task.Orchestrationto permit fluent-style method chaining
-
collect
Obtain aTask.Collectableusing the default collection mechanism.- Returns:
- a
Task.Collectable
-
getTaskExecutorService
Obtains theTask.Orchestrationthat created theTask.Orchestration.- Returns:
- the
Task.Orchestration
-
getTask
-
getTaskId
-
getAssignmentStrategy
Obtains theExecutionStrategyfor theTaskorchestration.- Returns:
- the
ExecutionStrategy
-
getOptionsByType
Obtains theOptionsByTypefor theTaskorchestration.- Returns:
- the
OptionsByType
-
getProperties
Obtains theTask.Propertiesfor theTaskorchestration.- Returns:
- the
Task.Properties
-
getRetainDuration
-
getPropertiesSupplier
Return aSupplierof aTask.Propertiesinstance.- Returns:
- a
Supplierof aTask.Propertiesinstance
-