Package net.officefloor.frame.util
Class TeamSourceStandAlone
java.lang.Object
net.officefloor.frame.util.TeamSourceStandAlone
Loads a
TeamSource for stand-alone use.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionDefault instantiation.TeamSourceStandAlone(String teamName) Instantiate withTeamname. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(String name, String value) Adds a property for initialising theTeam.voidaddThreadCompletionListener(ThreadCompletionListener threadCompletionListener) Adds aThreadCompletionListener.<TS extends TeamSource>
TeamReturns aTeamfrom the loadedTeamSource.<TS extends TeamSource>
TSloadTeamSource(Class<TS> teamSourceClass) Initialises and returns theTeamSourceinstance.voidsetClockFactory(ClockFactory clockFactory) Specifies theClockFactory.voidsetTeamSize(int teamSize) Specifies theTeamsize.voidsetThreadDecorator(Consumer<Thread> decorator) Specifies the decorator of theThreadinstances created by theTeamSourceContext.
-
Constructor Details
-
Method Details
-
loadTeamSource
Initialises and returns theTeamSourceinstance.- Type Parameters:
TS-TeamSourcetype.- Parameters:
teamSourceClass-Classof theTeamSource.- Returns:
- Initialised
TeamSource. - Throws:
Exception- If fails instantiation and initialising theTeamSource.
-
setTeamSize
public void setTeamSize(int teamSize) Specifies theTeamsize.- Parameters:
teamSize-Teamsize.
-
addProperty
Adds a property for initialising theTeam.- Parameters:
name- Name of property.value- Value of property.
-
setThreadDecorator
Specifies the decorator of theThreadinstances created by theTeamSourceContext.- Parameters:
decorator-Threaddecorator.
-
addThreadCompletionListener
Adds aThreadCompletionListener.- Parameters:
threadCompletionListener-ThreadCompletionListener.
-
setClockFactory
Specifies theClockFactory.- Parameters:
clockFactory-ClockFactory.
-
loadTeam
Returns aTeamfrom the loadedTeamSource.- Type Parameters:
TS-TeamSourcetype.- Parameters:
teamSourceClass-Classof theTeamSource.- Returns:
Teamfrom the loadedTeamSource.- Throws:
Exception- If fails loading theTeamSourceand creating aTeam.
-