Interface TeamSourceContext
- All Superinterfaces:
SourceContext,SourceProperties
- All Known Subinterfaces:
ExecutiveContext
- All Known Implementing Classes:
ExecutiveContextImpl,TeamSourceContextWrapper
Context for the
TeamSource.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionObtains the name of theTeamto be created from theTeamSource.intObtains the size of theTeam.intgetTeamSize(int defaultSize) Allows obtaining the size of theTeam, without forcing it to be configured.Obtains theThreadFactoryfor theTeam.Methods inherited from interface net.officefloor.frame.api.source.SourceContext
getClassLoader, getClock, getLogger, getName, getOptionalResource, getProfiles, getResource, isLoadingType, loadClass, loadOptionalClass, loadOptionalService, loadOptionalServices, loadService, loadService, loadServicesMethods inherited from interface net.officefloor.frame.api.source.SourceProperties
getProperties, getProperty, getProperty, getPropertyNames
-
Method Details
-
getTeamName
String getTeamName()Obtains the name of the
Teamto be created from theTeamSource.This enables naming the
Threadinstances for theTeamto be specific to theTeam.- Returns:
- Name of the
Teamto be created from theTeamSource.
-
getTeamSize
int getTeamSize()Obtains the size of the
Team.Typically this is the maximum number of
Threadinstances for theTeam. However, for someTeamimplementations it may not be used (e.g.PassiveTeamSource).It is provided to allow the
Executiveto have some control overTeamsizes.- Returns:
Teamsize.
-
getTeamSize
int getTeamSize(int defaultSize) Allows obtaining the size of theTeam, without forcing it to be configured. -
getThreadFactory
ThreadFactory getThreadFactory()Obtains the
ThreadFactoryfor theTeam.It is encouraged for
Teamimplementations to use this in creatingThreadinstances. This is to enable performance improvements byOfficeFloor, such asThreadLocalManagedObjectPoolsolutions to reduce pool locking overheads.- Returns:
ThreadFactoryfor theTeam.
-