org.norther.tammi.spray.loader
Interface TaskLoader

All Superinterfaces:
CacheClient<String,Task>, Refreshable
All Known Implementing Classes:
DefaultTaskLoader

public interface TaskLoader
extends CacheClient<String,Task>

An interface to a task loader used in pipes to load and execute request specific tasks in addition to standard filter processing.

Based on ModuleLoader in the Apache Jakarta Turbine project.

Version:
$Id: TaskLoader.java,v 1.18 2010-05-28 12:52:23 cvsimp Exp $
Author:
Jason van Zyl, Ilkka Priha

Method Summary
 void addPackageName(int index, String pckage)
          Adds a package name to the specified location of the task search list.
 void addPackageName(String pckage)
          Adds a package name to the task search list.
 void clearPackageNames()
          Clears all package name from the task search list.
 Task.Control execute(String name, ServletRequest request, ServletResponse response, FilterChain chain, Object context)
          Executes an instance of a task
 String[] getPackageNames()
          Gets package names in the task search list.
 boolean initialize(String name, ServletRequest request, ServletResponse response, FilterChain chain, Object context)
          Initializes an instance of a task without execution.
 boolean isScriptingEnabled()
          Checks whether scripting is enabled.
 void removePackageName(String pckage)
          Removes a package name from the task search list.
 void setPackageNames(String[] pckages)
          Sets package names in the task search list.
 void setScriptingEnabled(boolean flag)
          Sets the scripting enabled flag.
 
Methods inherited from interface org.norther.tammi.core.cache.CacheClient
clearCached, expireCached, expireFraction, getCache, getSharedCacheName, isCachingDisabled, removeCache, setCachingDisabled, setSharedCacheName
 
Methods inherited from interface org.norther.tammi.core.base.Refreshable
getRefreshed, refresh
 

Method Detail

isScriptingEnabled

boolean isScriptingEnabled()
Checks whether scripting is enabled.

Returns:
true, if the scripting is enabled.

setScriptingEnabled

void setScriptingEnabled(boolean flag)
Sets the scripting enabled flag.

Parameters:
flag - the scripting enabled flag.

getPackageNames

String[] getPackageNames()
Gets package names in the task search list.

Returns:
an array of package names.

setPackageNames

void setPackageNames(String[] pckages)
Sets package names in the task search list.

Parameters:
pckages - an array of package names.

addPackageName

void addPackageName(String pckage)
Adds a package name to the task search list.

Parameters:
pckage - the package name to add.

addPackageName

void addPackageName(int index,
                    String pckage)
Adds a package name to the specified location of the task search list.

Parameters:
index - an index in the list.
pckage - the package name to add.
Throws:
IndexOutOfBoundsException - if index is out of range.

removePackageName

void removePackageName(String pckage)
Removes a package name from the task search list.

Parameters:
pckage - the package name to remove.

clearPackageNames

void clearPackageNames()
Clears all package name from the task search list.


initialize

boolean initialize(String name,
                   ServletRequest request,
                   ServletResponse response,
                   FilterChain chain,
                   Object context)
Initializes an instance of a task without execution. If caching is enabled, the initialized task is cached. If an initialized task is already in the cache, the method does nothing.

Parameters:
name - the name of the task.
request - the request.
response - the response.
chain - the filter chain.
context - a task specific context.
Returns:
true if initialized, false if not found.

execute

Task.Control execute(String name,
                     ServletRequest request,
                     ServletResponse response,
                     FilterChain chain,
                     Object context)
                     throws ExecutionException,
                            InterruptedException
Executes an instance of a task

Parameters:
name - the name of the task.
request - the request.
response - the response.
chain - the filter chain.
context - a task specific context.
Returns:
the execution state.
Throws:
ExecutionException - for execution errors.
InterruptedException - if a task is interrupted.


Copyright © 2004 The Norther Organization. All rights reserved.