| java.lang.Object org.mmbase.util.functions.FunctionProvider org.mmbase.util.functions.DescribedFunctionProvider org.mmbase.module.Module
All known Subclasses: org.mmbase.module.ProcessorModule, org.mmbase.module.ReloadableModule,
Module | abstract public class Module extends DescribedFunctionProvider (Code) | | An MMBase Module is an extension of this class, which is configured by an XML file in the <mmbase
config dir>/modules directory. All modules whose xml configuration file defines them as 'active' are
automaticly loaded and initialized.
There are several modules which are more or less compulsary in MMBase, like the 'mmbaseroot'
module, the actual core of MMBase implemented by
org.mmbase.module.core.MMBase , and the
'jdbc' module.
author: Rico Jansen author: Rob Vermeulen (securitypart) author: Pierre van Rooden version: $Id: Module.java,v 1.96 2007/12/06 08:06:43 michiel Exp $ |
STATE_START_TIME | final public String STATE_START_TIME(Code) | | State identifier for module startup time.
|
getMaintainerFunction | protected Function<String> getMaintainerFunction(Code) | | This function returns the Module's maintainer as a String.
It takes no parameters.
This function can be called through the function framework.
since: MMBase-1.8 |
getVersionFunction | protected Function<Integer> getVersionFunction(Code) | | This function returns the Module's version number as an Integer.
It takes no parameters.
This function can be called through the function framework.
since: MMBase-1.8 |
properties | protected Map<String, String> properties(Code) | | Properties (initparameters) set by reading (or re-reading) the module configuration.
|
getInitParameter | public String getInitParameter(String key)(Code) | | Gets an init-parameter key-value pair
|
getModule | public static Module getModule(String name)(Code) | | Retrieves a reference to a Module.
This call does not ensure that the requested module has been initialized.
Parameters: name - the name of the module to retrieve a refernce to a Module , or null if themodule does not exist or is inactive. |
getModule | public static C getModule(Class<C> clazz)(Code) | | Since modules normally all have a different class, you can also obtain a module by its
Class, in stead of by its name. The advantage is that you don't need to cast.
Parameters: clazz - The class of the desired Module A Module instance or null if no such module. since: MMBase-1.9 |
getModule | public static Module getModule(String name, boolean startOnLoad)(Code) | | Retrieves a reference to a Module.
If you set the startOnLoad to true ,
this call ensures that the requested module has been initialized by
calling the
Module.startModule() method.
This is needed if you need to call Module methods from the init() of
another module.
Parameters: name - the name of the module to retrieve Parameters: startOnLoad - if true, the code makes sure the module has been started a reference to a Module , or null if themodule does not exist or is inactive. |
getModuleInfo | public String getModuleInfo()(Code) | | Provide some info on the module;
By default, this returns the module description for the default locale
|
getModules | final public static Iterator<Module> getModules()(Code) | | Returns an iterator of all the modules that are currently active.
This function null if no attempt has the modules have (not) yet been to loaded.
Unlike
Module.getModule , this method does not automatically load modules if this hadn't occurred yet.
an Iterator with all active modules |
getState | public String getState(String name)(Code) | | Returns a state value by name.
since: MMBase-1.9 |
getStates | public Map<String, String> getStates()(Code) | | Returns the module's runtime-generated state information as a unmodifiable map with name-value pairs.
since: MMBase-1.9 |
getVersion | public int getVersion()(Code) | | |
hasModule | public static boolean hasModule(String name)(Code) | | since: MMBase-1.8.3 |
hasStarted | final public boolean hasStarted()(Code) | | Returns whether the module has started (has been initialized or is in
its initialization fase).
|
init | public void init()(Code) | | 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.
|
loadInitParameters | public void loadInitParameters()(Code) | | Override properties through application context
since: MMBase 1.8.5 |
loadInitParameters | protected void loadInitParameters(String contextPath)(Code) | | Override properties through application context
Parameters: contextPath - path in application context where properties are located since: MMBase 1.8.5 |
maintainance | public void maintainance()(Code) | | maintainance call called by the admin module every x seconds.
|
onload | public void onload()(Code) | | 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.
|
setInitParameter | public void setInitParameter(String key, String value)(Code) | | Sets an init-parameter key-value pair
|
setVersion | public void setVersion(int v)(Code) | | |
shutdown | protected void shutdown()(Code) | | Shuts down the module. This method is called by shutdownModules.
since: MMBase-1.6.2 |
shutdownModules | final public static synchronized void shutdownModules()(Code) | | Calls shutdown of all registered modules.
since: MMBase-1.6.2 |
startModule | final public void startModule()(Code) | | Starts the module.
This module calls the
Module.init() of a module exactly once.
In other words, once the init() is called, it does not call it again.
This method is final and cannot be overridden.
It is used to safely initialize modules during startup, and allows other modules
to force the 'startup' of another module without risk.
|
startModules | final public static synchronized void startModules()(Code) | | |
|
|