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