Module

public Module()

Method Detail

setName

public final void setName(java.lang.String name)

startModule

public final void startModule()

Starts the module.
This module calls the 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 intilaize modules during startup, amd allows other modules
to force the 'startup' of another module without risk.

hasStarted

public final boolean hasStarted()

Returns whether the module has started (has been initialized or is in
its initialization fase).

init

public abstract void init()

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

onload

public abstract void onload()

state

public java.util.Hashtable state()

state, returns the state hashtable that is/can be used to debug. Should
be overridden when live state should be done.

getProperty

getInitParameters

public java.util.Hashtable getInitParameters()

Gets own modules properties

getModules

public static final java.util.Iterator getModules()

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 getModule(java.lang.String), this method does not automatically load modules if this hadn't occurred yet.

Returns:

an Iterator with all active modules

getName

public final java.lang.String getName()

Returns the name of the module

Returns:

the module name

getModuleInfo

public java.lang.String getModuleInfo()

provide some info on the module

maintainance

public void maintainance()

maintainance call called by the admin module every x seconds.

getMimeType

public java.lang.String getMimeType(java.lang.String ext)

getMimeType: Returns the mimetype using ServletContext.getServletContext which returns the servlet context
which is set when servscan is loaded.
Fixed on 22 December 1999 by daniel & davzev.
XXX: why is this in Module???

Parameters:

ext - A String containing the extension.

Returns:

The mimetype.

getMimeTypeFile

public java.lang.String getMimeTypeFile(java.lang.String filename)

startModules

public static final void startModules()

getModule

public static java.lang.Object getModule(java.lang.String name)

Retrieves a reference to a Module.
This call does not ensure that the requested module has been initialized.
XXX: return type Object in stead of Module?

Parameters:

name - the name of the module to retrieve

Returns:

a refernce to a Module, or null if the
module does not exist or is inactive.

getModule

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 startModule() method.
This is needed if you need to call Module methods from the init() of
another module.
XXX: return type Object in stead of Module?

Parameters:

name - the name of the module to retrieve

startOnLoad - whetehr to make sure the module has been staretd or not.

Returns:

a reference to a Module, or null if the
module does not exist or is inactive.