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
public abstract class AbstractExecutorTeamSource extends AbstractTeamSource
TeamSourcebased on theExecutorscached thread pool.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceAbstractExecutorTeamSource.ExecutorServiceFactoryFactory to create theExecutorService.static classAbstractExecutorTeamSource.ExecutorTeamTeambased on theExecutorService.-
Nested classes/interfaces inherited from class net.officefloor.frame.api.team.source.impl.AbstractTeamSource
AbstractTeamSource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_SHUTDOWN_TIME_IN_SECONDSMaximum time to wait in seconds for theExecutorServiceto shutdown.static java.lang.StringPROPERTY_THREAD_PRIORITYName of property to obtain theThreadpriority.
-
Constructor Summary
Constructors Constructor Description AbstractExecutorTeamSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AbstractExecutorTeamSource.ExecutorServiceFactorycreateExecutorServiceFactory(TeamSourceContext context, java.util.concurrent.ThreadFactory threadFactory)Obtains the factory to createExecutorService.TeamcreateTeam(int teamSize, java.lang.String... propertyNameValues)Convenience method to create aTeamfrom the implementation of thisAbstractExecutorTeamSource.TeamcreateTeam(TeamSourceContext context)Creates theTeam.protected voidloadSpecification(AbstractTeamSource.SpecificationContext context)Overridden to load specification.-
Methods inherited from class net.officefloor.frame.api.team.source.impl.AbstractTeamSource
getSpecification
-
-
-
-
Field Detail
-
PROPERTY_THREAD_PRIORITY
public static final java.lang.String PROPERTY_THREAD_PRIORITY
Name of property to obtain theThreadpriority.- See Also:
- Constant Field Values
-
PROPERTY_SHUTDOWN_TIME_IN_SECONDS
public static final java.lang.String PROPERTY_SHUTDOWN_TIME_IN_SECONDS
Maximum time to wait in seconds for theExecutorServiceto shutdown.- See Also:
- Constant Field Values
-
-
Method Detail
-
createTeam
public Team createTeam(int teamSize, java.lang.String... propertyNameValues) throws java.lang.IllegalArgumentException
Convenience method to create aTeamfrom the implementation of thisAbstractExecutorTeamSource.- Parameters:
teamSize-Teamsize.propertyNameValues- Property name/value pairs for theTeamSource.- Returns:
Team.- Throws:
java.lang.IllegalArgumentException- If fails to provide correct information to load theTeam.
-
createExecutorServiceFactory
protected abstract AbstractExecutorTeamSource.ExecutorServiceFactory createExecutorServiceFactory(TeamSourceContext context, java.util.concurrent.ThreadFactory threadFactory) throws java.lang.Exception
Obtains the factory to createExecutorService.- Parameters:
context-TeamSourceContext.threadFactory-ThreadFactoryto use for the creation of theThreadinstances.- Returns:
AbstractExecutorTeamSource.ExecutorServiceFactory.- Throws:
java.lang.Exception- If fails to create theAbstractExecutorTeamSource.ExecutorServiceFactory.
-
loadSpecification
protected void loadSpecification(AbstractTeamSource.SpecificationContext context)
Description copied from class:AbstractTeamSourceOverridden to load specification.- Specified by:
loadSpecificationin classAbstractTeamSource- Parameters:
context-AbstractTeamSource.SpecificationContext.
-
createTeam
public Team createTeam(TeamSourceContext context) throws java.lang.Exception
Description copied from interface:TeamSourceCreates theTeam.- Parameters:
context-TeamSourceContext.- Returns:
Team.- Throws:
java.lang.Exception- If fails to configure theTeamSource.
-
-