org.mmbase.module
Class ProcessorModule

java.lang.Object
  extended byorg.mmbase.util.functions.FunctionProvider
      extended byorg.mmbase.module.Module
          extended byorg.mmbase.module.ProcessorModule
All Implemented Interfaces:
ProcessorInterface
Direct Known Subclasses:
JDBC, LinkChecker, MMAdmin, MMBase, Naming, XSLConvert

public class ProcessorModule
extends Module
implements ProcessorInterface

The Processor Module extends the basic module to the Processor interface so it can perform for servscan (pagelets).

Author:
Daniel Ockeloen
To Do:
Should be abstract, deprecated?

Nested Class Summary
protected  class ProcessorModule.GetNodeListFunction
          Function implementation around getNodeList(Object, String, Map).
protected  class ProcessorModule.ProcessFunction
          Function implementation around process(PageInfo, Hashtable, Hashtable).
protected  class ProcessorModule.ReplaceFunction
          Function implementation around replace(PageInfo, String).
 
Field Summary
protected static Parameter.Wrapper PARAM_PAGEINFO
           
protected static Parameter[] PARAMS_PAGEINFO
           
 
Fields inherited from class org.mmbase.module.Module
getMaintainerFunction, getVersionFunction
 
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions, getFunctions
 
Constructor Summary
ProcessorModule()
           
 
Method Summary
 boolean cacheCheck(PageInfo sp, String cmd)
          Do a cache check (304) for this request.
 Vector getList(PageInfo sp, StringTagger params, String command)
          Generate a list of values from a command to the processor.
 MMObjectBuilder getListBuilder(String command, Map params)
          Used to create node lists from the results returned by ProcessorInterface.getList(org.mmbase.util.PageInfo, org.mmbase.util.StringTagger, java.lang.String). The default method does not associate the builder with a cloud (mmbase module), so processormodules that need this association need to override this method. Note that different lists may return different builders.
 Vector getNodeList(Object context, String command, Map params)
          This method is a wrapper around getList(PageInfo, StringTagger, String)
 void init()
          Initializes the module. Init must be overridden to read the environment variables it needs.
This method is called by Module.startModule(), which makes sure it is not called more than once. You should not call init() directly, call startModule() instead.
 void onload()
          prepares the module when loaded. Onload must be overridden to execute methods that need to be performed when the module is loaded but before any other modules are initailized.
This method is called by Module.startModules(). You should not call onload() directly.
 boolean process(PageInfo sp, Hashtable cmds, Hashtable vars)
          Execute the commands provided in the form values.
 void reload()
          Deprecated. called by nothing
 String replace(PageInfo sp, String command)
          Replace a command by a string.
 String replace(PageInfo sp, StringTagger command)
          Replace a command by a string. who the hell uses this (daniel)
 void unload()
          Deprecated. called by nothing
 
Methods inherited from class org.mmbase.module.Module
getInitParameter, getInitParameters, getMaintainer, getModule, getModule, getModuleInfo, getModuleLoader, getModuleReader, getModules, getName, getProperties, getProperty, getVersion, hasStarted, maintainance, setInitParameter, setMaintainer, setName, setVersion, shutdown, shutdownModules, startModule, startModules, state
 
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMS_PAGEINFO

protected static final Parameter[] PARAMS_PAGEINFO

PARAM_PAGEINFO

protected static final Parameter.Wrapper PARAM_PAGEINFO
Constructor Detail

ProcessorModule

public ProcessorModule()
Method Detail

getListBuilder

public MMObjectBuilder getListBuilder(String command,
                                      Map params)
Used to create node lists from the results returned by ProcessorInterface.getList(org.mmbase.util.PageInfo, org.mmbase.util.StringTagger, java.lang.String). The default method does not associate the builder with a cloud (mmbase module), so processormodules that need this association need to override this method. Note that different lists may return different builders.

Specified by:
getListBuilder in interface ProcessorInterface
Parameters:
command - the LIST command for which to retrieve the builder
params - contains the attributes for the list

getNodeList

public Vector getNodeList(Object context,
                          String command,
                          Map params)
This method is a wrapper around getList(PageInfo, StringTagger, String)

Specified by:
getNodeList in interface ProcessorInterface
Parameters:
context - The PageInfo object. It beats me why it is Object and not PageInfo. I think it's silly.
command - The command to execute
params - Parameters, they will be added to the StringTagger.
Returns:
a Vector that contains the list values contained in MMObjectNode objects

getList

public Vector getList(PageInfo sp,
                      StringTagger params,
                      String command)
Description copied from interface: ProcessorInterface
Generate a list of values from a command to the processor.

Specified by:
getList in interface ProcessorInterface
Parameters:
sp - the page context
params - contains the attributes for the list
command - the list command to execute.
Warning: No Java Documentation Available.

process

public boolean process(PageInfo sp,
                       Hashtable cmds,
                       Hashtable vars)
Execute the commands provided in the form values.

Specified by:
process in interface ProcessorInterface
Parameters:
sp - the page context
cmds - contains the list of commands to run
vars - contains the attributes for the process

replace

public String replace(PageInfo sp,
                      String command)
Replace a command by a string.

Specified by:
replace in interface ProcessorInterface
Parameters:
sp - the page context
command - the command to execute.

replace

public String replace(PageInfo sp,
                      StringTagger command)
Replace a command by a string. who the hell uses this (daniel)

Specified by:
replace in interface ProcessorInterface
Parameters:
sp - the page context
command - the command to execute

cacheCheck

public boolean cacheCheck(PageInfo sp,
                          String cmd)
Do a cache check (304) for this request.

Specified by:
cacheCheck in interface ProcessorInterface
Parameters:
sp - the page context
cmd - the command to execute.

reload

public void reload()
Deprecated. called by nothing

What should this do, when is this called?

Warning: No Java Documentation Available.

unload

public void unload()
Deprecated. called by nothing

What should this do, when is this called?

Warning: No Java Documentation Available.

init

public void init()
Initializes the module. Init must be overridden to read the environment variables it needs.
This method is called by Module.startModule(), which makes sure it is not called more than once. You should not call init() directly, call startModule() instead.

Overrides:
init in class Module
Warning: Scope will be changed to:
abstract

onload

public void onload()
prepares the module when loaded. Onload must be overridden to execute methods that need to be performed when the module is loaded but before any other modules are initailized.
This method is called by Module.startModules(). You should not call onload() directly.

Overrides:
onload in class Module
Warning: Scope will be changed to:
abstract


MMBase build 1.8.1.20060716