org.apache.turbine.modules

## Class GenericLoader<T extends Assembler>

- java.lang.Object
- - org.apache.turbine.modules.GenericLoader<T>

- Type Parameters:
    `T` - the specialized assembler type
  Direct Known Subclasses:
    ActionLoader, LayoutLoader, NavigationLoader, PageLoader, ScheduledJobLoader, ScreenLoader

      public abstract class GenericLoader<T extends Assembler>
      extends Object

  This is the base class for the loaders. It contains code that is used across all of the loaders. It also specifies the interface that is required to be called a Loader.
  Author:
    Dave Bryson, Henning P. Schmiedehausen, Peter Courcoux

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AssemblerBrokerService` | `ab` The Assembler Broker Service

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericLoader()` Basic constructor for creating a loader.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `exec(PipelineData pipelineData, String name)` Attempts to load and execute the external action that has been set.
    `protected T` | `getAssembler(Class<T> type, String name)` Pulls out an instance of the object by name.
    `static String` | `getBasePackage()` Gets the base package where Turbine should find its default modules.
    `static List<String>` | `getPackages()` Gets the package list where Turbine should find its modules.
    `boolean` | `reload()` Returns whether or not this external action is reload itself.
    `GenericLoader<T>` | `setReload(boolean reload)` Sets whether or not this external action is reload itself.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ab

          protected AssemblerBrokerService ab

      The Assembler Broker Service

  - ### Constructor Detail

    - #### GenericLoader

          public GenericLoader()

      Basic constructor for creating a loader.

  - ### Method Detail

    - #### exec

          public abstract void exec(PipelineData pipelineData,
                  String name)
                             throws Exception

      Attempts to load and execute the external action that has been set.
      Parameters:
        `pipelineData` - the Turbine request
        `name` - the name of the assembler module
      Throws:
        `Exception` - a generic exception.

    - #### reload

          public boolean reload()

      Returns whether or not this external action is reload itself. This is in cases where the Next button would be clicked, but since we are checking for that, we would go into an endless loop.
      Returns:
        True if the action is reload.

    - #### setReload

          public GenericLoader<T> setReload(boolean reload)

      Sets whether or not this external action is reload itself. This is in cases where the Next button would be clicked, but since we are checking for that, we would go into an endless loop.
      Parameters:
        `reload` - True if the action must be marked as reload.
      Returns:
        Itself.

    - #### getBasePackage

          public static String getBasePackage()

      Gets the base package where Turbine should find its default modules.
      Returns:
        A String with the base package name.

    - #### getPackages

          public static List<String> getPackages()

      Gets the package list where Turbine should find its modules.
      Returns:
        A List with the package names (including the base package).

    - #### getAssembler

          protected T getAssembler(Class<T> type,
                       String name)
                                              throws Exception

      Pulls out an instance of the object by name. Name is just the single name of the object.
      Parameters:
        `type` - Type of the assembler.
        `name` - Name of object instance.
      Returns:
        A Screen with the specified name, or null.
      Throws:
        `Exception` - a generic exception.

Copyright © 2000-2015 The Apache Software Foundation. All Rights Reserved.