org.apache.turbine.modules
Class GenericLoader<T extends Assembler>

java.lang.Object
  extended by org.apache.turbine.modules.GenericLoader<T>
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.

Version:
$Id: GenericLoader.java 1078552 2011-03-06 19:58:46Z tv $
Author:
Dave Bryson, Henning P. Schmiedehausen, Peter Courcoux

Field Summary
protected  AssemblerBrokerService ab
          The Assembler Broker Service
 
Constructor Summary
GenericLoader()
          Basic constructor for creating a loader.
 
Method Summary
 void exec(PipelineData pipelineData, String name)
          Attempts to load and execute the external action that has been set.
abstract  void exec(RunData data, String name)
          Deprecated. Use of this method should be avoided. Use exec(PipelineData data, String name) instead.
protected  T getAssembler(String 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 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 void exec(PipelineData pipelineData,
                 String name)
          throws Exception
Attempts to load and execute the external action that has been set. Should revert to abstract when RunData has gone.

Throws:
Exception - a generic exception.

exec

@Deprecated
public abstract void exec(RunData data,
                                     String name)
                   throws Exception
Deprecated. Use of this method should be avoided. Use exec(PipelineData data, String name) instead.

Attempts to load and execute the external action that has been set.

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 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(String 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-2011 The Apache Software Foundation. All Rights Reserved.