Package net.officefloor.frame.util
Class TeamSourceStandAlone
- java.lang.Object
-
- net.officefloor.frame.util.TeamSourceStandAlone
-
public class TeamSourceStandAlone extends java.lang.Object
Loads aTeamSource
for stand-alone use.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description TeamSourceStandAlone()
Default instantiation.TeamSourceStandAlone(java.lang.String teamName)
Instantiate withTeam
name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(java.lang.String name, java.lang.String value)
Adds a property for initialising theTeam
.void
addThreadCompletionListener(ThreadCompletionListener threadCompletionListener)
Adds aThreadCompletionListener
.<TS extends TeamSource>
TeamloadTeam(java.lang.Class<TS> teamSourceClass)
Returns aTeam
from the loadedTeamSource
.<TS extends TeamSource>
TSloadTeamSource(java.lang.Class<TS> teamSourceClass)
Initialises and returns theTeamSource
instance.void
setClockFactory(ClockFactory clockFactory)
Specifies theClockFactory
.void
setTeamSize(int teamSize)
Specifies theTeam
size.void
setThreadDecorator(java.util.function.Consumer<java.lang.Thread> decorator)
Specifies the decorator of theThread
instances created by theTeamSourceContext
.
-
-
-
Method Detail
-
loadTeamSource
public <TS extends TeamSource> TS loadTeamSource(java.lang.Class<TS> teamSourceClass) throws java.lang.Exception
Initialises and returns theTeamSource
instance.- Type Parameters:
TS
-TeamSource
type.- Parameters:
teamSourceClass
-Class
of theTeamSource
.- Returns:
- Initialised
TeamSource
. - Throws:
java.lang.Exception
- If fails instantiation and initialising theTeamSource
.
-
setTeamSize
public void setTeamSize(int teamSize)
Specifies theTeam
size.- Parameters:
teamSize
-Team
size.
-
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 theThread
instances created by theTeamSourceContext
.- Parameters:
decorator
-Thread
decorator.
-
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 aTeam
from the loadedTeamSource
.- Type Parameters:
TS
-TeamSource
type.- Parameters:
teamSourceClass
-Class
of theTeamSource
.- Returns:
Team
from the loadedTeamSource
.- Throws:
java.lang.Exception
- If fails loading theTeamSource
and creating aTeam
.
-
-