org.mmbase.bridge.implementation
Class ModuleHandler

java.lang.Object
  |
  +--org.mmbase.bridge.implementation.ModuleHandler
All Implemented Interfaces:
java.lang.Comparable, Module

public class ModuleHandler
extends java.lang.Object
implements Module, java.lang.Comparable

ModuleHandler Creates a framework for calling modules. Supports calls to the methods supported by the MMBase ProcessorModules.

Version:
$Id: ModuleHandler.java,v 1.18.2.2 2003/03/06 13:52:44 pierre Exp $
Author:
Pierre van Rooden, Rob Vermeulen

Method Summary
 int compareTo(java.lang.Object o)
          Compares this module to the passed object.
 boolean equals(java.lang.Object o)
          Compares two modules, and returns true if they are equal.
 CloudContext getCloudContext()
          Retrieves the CloudContext to which this module belongs
 java.lang.String getDescription()
          Retrieve the description of the module.
 java.lang.String getInfo(java.lang.String command)
          Retrieve info from a module based on a command string.
 java.lang.String getInfo(java.lang.String command, javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp)
          Retrieve info from a module based on a command string Similar to the $MOD command in SCAN.
 NodeList getList(java.lang.String command, java.util.Map parameters)
          Retrieve info (as a list of virtual nodes) from a module based on a command string.
 NodeList getList(java.lang.String command, java.util.Map parameters, javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp)
          Retrieve info from a module based on a command string Similar to the LIST command in SCAN.
static Module getModule(Module mod, CloudContext cloudcontext)
           
 java.lang.String getName()
          Retrieve the name of the module (in the default language defined in mmbaseroot.xml).
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
 void process(java.lang.String command, java.lang.Object parameter)
          Runs the command with the given parameter(s).
 void process(java.lang.String command, java.lang.Object parameter, java.util.Map auxparameters)
          Runs the command with the given parameter(s).
 void process(java.lang.String command, java.lang.Object parameter, java.util.Map auxparameters, javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp)
          Runs the command with the given parameter(s).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getModule

public static Module getModule(Module mod,
                               CloudContext cloudcontext)

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable

getCloudContext

public CloudContext getCloudContext()
Description copied from interface: Module
Retrieves the CloudContext to which this module belongs
Specified by:
getCloudContext in interface Module

getName

public java.lang.String getName()
Description copied from interface: Module
Retrieve the name of the module (in the default language defined in mmbaseroot.xml).
Specified by:
getName in interface Module

getDescription

public java.lang.String getDescription()
Description copied from interface: Module
Retrieve the description of the module.
Specified by:
getDescription in interface Module

getInfo

public java.lang.String getInfo(java.lang.String command)
Description copied from interface: Module
Retrieve info from a module based on a command string. Similar to the $MOD command in SCAN.
Specified by:
getInfo in interface Module
Following copied from interface: org.mmbase.bridge.Module
Parameters:
command - the info to obtain, i.e. "USER-OS".

getInfo

public java.lang.String getInfo(java.lang.String command,
                                javax.servlet.ServletRequest req,
                                javax.servlet.ServletResponse resp)
Description copied from interface: Module
Retrieve info from a module based on a command string Similar to the $MOD command in SCAN.
Specified by:
getInfo in interface Module
Following copied from interface: org.mmbase.bridge.Module
Parameters:
command - the info to obtain, i.e. "USER-OS".
req - the Request item to use for obtaining user information. For backward compatibility.
resp - the Response item to use for redirecting users. For backward compatibility.

process

public void process(java.lang.String command,
                    java.lang.Object parameter)
Description copied from interface: Module
Runs the command with the given parameter(s).
Specified by:
process in interface Module
Following copied from interface: org.mmbase.bridge.Module
Parameters:
command - the command to run, i.e. "MESSAGE-UPDATE".
parameters - the main parameter for the command. Depends on the command issued. Not all commands make use of this parameter.

process

public void process(java.lang.String command,
                    java.lang.Object parameter,
                    java.util.Map auxparameters)
Description copied from interface: Module
Runs the command with the given parameter(s).
Specified by:
process in interface Module
Following copied from interface: org.mmbase.bridge.Module
Parameters:
command - the command to run, i.e. "MESSAGE-UPDATE".
parameters - the main parameter for the command. Depends on the command issued. Not all commands make use of this parameter.
auxparameters - additional parameters for this command.

process

public void process(java.lang.String command,
                    java.lang.Object parameter,
                    java.util.Map auxparameters,
                    javax.servlet.ServletRequest req,
                    javax.servlet.ServletResponse resp)
Description copied from interface: Module
Runs the command with the given parameter(s).
Specified by:
process in interface Module
Following copied from interface: org.mmbase.bridge.Module
Parameters:
command - the command to run, i.e. "MESSAGE-UPDATE".
parameters - the main parameter for the command. Depends on the command issued. Not all commands make use of this parameter.
auxparameters - additional parameters for this command.
req - the Request item to use for obtaining user information. For backward compatibility.
resp - the Response item to use for redirecting users. For backward compatibility.

getList

public NodeList getList(java.lang.String command,
                        java.util.Map parameters)
Description copied from interface: Module
Retrieve info (as a list of virtual nodes) from a module based on a command string. Similar to the LIST command in SCAN. The values retrieved are represented as fields of a virtual node, named following the fieldnames listed in the fields paramaters..
Specified by:
getList in interface Module
Following copied from interface: org.mmbase.bridge.Module
Parameters:
command - the info to obtain, i.e. "USER-OS".
fields - The names for the fields to retrieve. This allows a user to set it's own names for the fields (i.e. when calling the COLORS List command of the info module, this could be "RGB,name". If the number of names do not match the number of items returns, any additional items are numbered according to their position, given names such as "item1".
parameters - a hashtable containing the named parameters of the list.

getList

public NodeList getList(java.lang.String command,
                        java.util.Map parameters,
                        javax.servlet.ServletRequest req,
                        javax.servlet.ServletResponse resp)
Description copied from interface: Module
Retrieve info from a module based on a command string Similar to the LIST command in SCAN. The values retrieved are represented as fields of a virtual node, named following the fieldnames listed in the fields paramaters..
Specified by:
getList in interface Module
Following copied from interface: org.mmbase.bridge.Module
Parameters:
command - the info to obtain, i.e. "USER-OS".
parameters - a hashtable containing the named parameters of the list.
fields - The names for the fields to retrieve. This allows a user to set it's own names for the fields (i.e. when calling the COLORS List command of the info module, this could be "RGB,name". If the number of names do not match the number of items returns, any additional items are numbered according to their position, given names such as "item1".
req - the Request item to use for obtaining user information. For backward compatibility.
resp - the Response item to use for redirecting users. For backward compatibility.

compareTo

public int compareTo(java.lang.Object o)
Compares this module to the passed object. Returns 0 if they are equal, -1 if the object passed is a NodeManager and larger than this manager, and +1 if the object passed is a NodeManager and smaller than this manager. A module is 'larger' than another module if its name is larger (alphabetically, case sensitive) than that of the other module. If names are the same, the modules are compared on cloud context.
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the object to compare it with

equals

public boolean equals(java.lang.Object o)
Compares two modules, and returns true if they are equal.
Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare it with


MMBase build 1.6.5.20030923