Class TeamSourceStandAlone


  • public class TeamSourceStandAlone
    extends java.lang.Object
    Loads a TeamSource for stand-alone use.
    Author:
    Daniel Sagenschneider
    • Constructor Detail

      • TeamSourceStandAlone

        public TeamSourceStandAlone()
        Default instantiation.
      • TeamSourceStandAlone

        public TeamSourceStandAlone​(java.lang.String teamName)
        Instantiate with Team name.
        Parameters:
        teamName - Name of the Team.
    • Method Detail

      • loadTeamSource

        public <TS extends TeamSource> TS loadTeamSource​(java.lang.Class<TS> teamSourceClass)
                                                  throws java.lang.Exception
        Initialises and returns the TeamSource instance.
        Type Parameters:
        TS - TeamSource type.
        Parameters:
        teamSourceClass - Class of the TeamSource.
        Returns:
        Initialised TeamSource.
        Throws:
        java.lang.Exception - If fails instantiation and initialising the TeamSource.
      • setTeamSize

        public void setTeamSize​(int teamSize)
        Specifies the Team size.
        Parameters:
        teamSize - Team size.
      • addProperty

        public void addProperty​(java.lang.String name,
                                java.lang.String value)
        Adds a property for initialising the Team.
        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 the Thread instances created by the TeamSourceContext.
        Parameters:
        decorator - Thread decorator.
      • loadTeam

        public <TS extends TeamSourceTeam loadTeam​(java.lang.Class<TS> teamSourceClass)
                                              throws java.lang.Exception
        Returns a Team from the loaded TeamSource.
        Type Parameters:
        TS - TeamSource type.
        Parameters:
        teamSourceClass - Class of the TeamSource.
        Returns:
        Team from the loaded TeamSource.
        Throws:
        java.lang.Exception - If fails loading the TeamSource and creating a Team.