Class BatchScenario

  • All Implemented Interfaces:

    public class BatchScenario
    extends Scenario
    Allows the programmatic creation of a scenario for use in a batch run.
    Nick Collier
    • Constructor Detail

      • BatchScenario

        public BatchScenario​(Object masterContextID)
        Creates a BatchScenario with the specified master context id.
        masterContextID -
    • Method Detail

      • prepareWatchee

        public void prepareWatchee​(String className,
                                   String fieldName,
                                   String classpath)
        Prepare the specified field in the specified class for watching. If this is not done, any watcher annotations will not work.
        className - the name of the class to watch
        fieldName - the name of the field to watch
        classpath - the classpath on which to find the watcher and watched classes. The separator must be appropriate for the OS.
      • addDataLoader

        public <T extends ContextBuilder> void addDataLoader​(Object contextTypeID,
                                                             T loader)
        Adds a data loader to this scenario. The data loader will be associated with the specific context. If the contextTypeID refers to the master context, then this data loader is responsible for creating the master context and its children. If the contextTypeID refers to a subcontext type, then the data loader is responsible for creating the children of any contexts of that type.
        contextTypeID - the context type to associate the data loader with
        loader - the loader to add to the scenario
      • createRegistry

        public ControllerRegistry createRegistry​(RunEnvironmentBuilder builder)
                                          throws ClassNotFoundException,
        Creates a ControllerRegistry from this BatchScenario. This registry is then used to do the actual batch runs.
        builder - used to create the run enviroment and passed to a user's model initializer, if any
        a ControllerRegistry created from this BatchScenario.
        ClassNotFoundException - if this BatchScenario is unable process (read annotations etc.) the agent classes.
      • getModelInitializer

        public ModelInitializer getModelInitializer()
        Gets a custom ModelInitializer, if any, supplied by the user.
        getModelInitializer in class Scenario
        a custom RunInitializer, if any, supplied by the user.
      • setUserInitializer

        public void setUserInitializer​(ModelInitializer userInit)
        Sets a ModelInitializer that will be run when the scenario is loaded. This is optional and need not be set unless a custom initializer is desired.
        userInit - a customized ModelInitializer
      • setParameterSweeper

        public void setParameterSweeper​(ParameterSweeper sweeper)