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
TeamSource
based on theExecutors
cached thread pool.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
AbstractExecutorTeamSource.ExecutorServiceFactory
Factory to create theExecutorService
.static class
AbstractExecutorTeamSource.ExecutorTeam
Team
based 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.String
PROPERTY_SHUTDOWN_TIME_IN_SECONDS
Maximum time to wait in seconds for theExecutorService
to shutdown.static java.lang.String
PROPERTY_THREAD_PRIORITY
Name of property to obtain theThread
priority.
-
Constructor Summary
Constructors Constructor Description AbstractExecutorTeamSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AbstractExecutorTeamSource.ExecutorServiceFactory
createExecutorServiceFactory(TeamSourceContext context, java.util.concurrent.ThreadFactory threadFactory)
Obtains the factory to createExecutorService
.Team
createTeam(int teamSize, java.lang.String... propertyNameValues)
Convenience method to create aTeam
from the implementation of thisAbstractExecutorTeamSource
.Team
createTeam(TeamSourceContext context)
Creates theTeam
.protected void
loadSpecification(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 theThread
priority.- 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 theExecutorService
to 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 aTeam
from the implementation of thisAbstractExecutorTeamSource
.- Parameters:
teamSize
-Team
size.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
-ThreadFactory
to use for the creation of theThread
instances.- Returns:
AbstractExecutorTeamSource.ExecutorServiceFactory
.- Throws:
java.lang.Exception
- If fails to create theAbstractExecutorTeamSource.ExecutorServiceFactory
.
-
loadSpecification
protected void loadSpecification(AbstractTeamSource.SpecificationContext context)
Description copied from class:AbstractTeamSource
Overridden to load specification.- Specified by:
loadSpecification
in classAbstractTeamSource
- Parameters:
context
-AbstractTeamSource.SpecificationContext
.
-
createTeam
public Team createTeam(TeamSourceContext context) throws java.lang.Exception
Description copied from interface:TeamSource
Creates theTeam
.- Parameters:
context
-TeamSourceContext
.- Returns:
Team
.- Throws:
java.lang.Exception
- If fails to configure theTeamSource
.
-
-