Class AbstractExecutorTeamSource
java.lang.Object
net.officefloor.frame.api.team.source.impl.AbstractTeamSource
net.officefloor.frame.impl.spi.team.AbstractExecutorTeamSource
- All Implemented Interfaces:
TeamSource
- Direct Known Subclasses:
ExecutorCachedTeamSource,ExecutorFixedTeamSource
TeamSource based on the Executors cached thread pool.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceFactory to create theExecutorService.static classTeambased on theExecutorService.Nested classes/interfaces inherited from class net.officefloor.frame.api.team.source.impl.AbstractTeamSource
AbstractTeamSource.SpecificationContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMaximum time to wait in seconds for theExecutorServiceto shutdown.static final StringName of property to obtain theThreadpriority. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractExecutorTeamSource.ExecutorServiceFactorycreateExecutorServiceFactory(TeamSourceContext context, ThreadFactory threadFactory) Obtains the factory to createExecutorService.createTeam(int teamSize, String... propertyNameValues) Convenience method to create aTeamfrom the implementation of thisAbstractExecutorTeamSource.createTeam(TeamSourceContext context) Creates theTeam.protected voidOverridden to load specification.Methods inherited from class net.officefloor.frame.api.team.source.impl.AbstractTeamSource
getSpecification
-
Field Details
-
PROPERTY_THREAD_PRIORITY
Name of property to obtain theThreadpriority.- See Also:
-
PROPERTY_SHUTDOWN_TIME_IN_SECONDS
Maximum time to wait in seconds for theExecutorServiceto shutdown.- See Also:
-
-
Constructor Details
-
AbstractExecutorTeamSource
public AbstractExecutorTeamSource()
-
-
Method Details
-
createTeam
Convenience method to create aTeamfrom the implementation of thisAbstractExecutorTeamSource.- Parameters:
teamSize-Teamsize.propertyNameValues- Property name/value pairs for theTeamSource.- Returns:
Team.- Throws:
IllegalArgumentException- If fails to provide correct information to load theTeam.
-
createExecutorServiceFactory
protected abstract AbstractExecutorTeamSource.ExecutorServiceFactory createExecutorServiceFactory(TeamSourceContext context, ThreadFactory threadFactory) throws Exception Obtains the factory to createExecutorService.- Parameters:
context-TeamSourceContext.threadFactory-ThreadFactoryto use for the creation of theThreadinstances.- Returns:
AbstractExecutorTeamSource.ExecutorServiceFactory.- Throws:
Exception- If fails to create theAbstractExecutorTeamSource.ExecutorServiceFactory.
-
loadSpecification
Description copied from class:AbstractTeamSourceOverridden to load specification.- Specified by:
loadSpecificationin classAbstractTeamSource- Parameters:
context-AbstractTeamSource.SpecificationContext.
-
createTeam
Description copied from interface:TeamSourceCreates theTeam.- Parameters:
context-TeamSourceContext.- Returns:
Team.- Throws:
Exception- If fails to configure theTeamSource.
-