com.softwareag.mdm.base.repository
Class ModulesRegister

java.lang.Object
  extended bycom.softwareag.mdm.base.repository.ModulesRegister

public class ModulesRegister
extends Object

This class provides static methods for registering and unregistering webMethods MDM modules.


Constructor Summary
ModulesRegister()
           
 
Method Summary
static List getDependentModuleNames(ServletContext aServletContext)
          Returns all the modules names on which depends the web application specified.
static boolean registerDirectory(File aModuleDirectory)
          Registers a new module rooted at the directory specified.
static boolean registerDirectoryIfModule(File aModuleDirectory)
          Registers a new module rooted at the directory specified.
static boolean registerWebApp(Servlet aServlet, ServletConfig aServletConfig)
          Registers a new module based on the specified servlet's web application.
static void unregisterWebApp(Servlet aServlet, ServletConfig aServletConfig)
          Unregisters a module that has been registered by the registerWebApp().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModulesRegister

public ModulesRegister()
Method Detail

registerDirectoryIfModule

public static boolean registerDirectoryIfModule(File aModuleDirectory)
                                         throws ModuleDefinitionException
Registers a new module rooted at the directory specified.

A directory is identified as a module if, and only if, the file '/WEB-INF/mdm/module.xml' is defined under this directory.

Returns:
true if registration has succeeded, false if registration has failed because a module with same name has been already registered.
Throws:
ModuleDefinitionException - if file '/WEB-INF/mdm/module.xml' is defined but it cannot be read properly (this event is also added as an error to 'kernel' logs).

registerDirectory

public static boolean registerDirectory(File aModuleDirectory)
                                 throws ModuleDefinitionException
Registers a new module rooted at the directory specified.

Requires that file '/WEB-INF/mdm/module.xml' is defined under this directory.

Returns:
true if registration has succeeded, false if registration has failed because a module with same name has been already registered.
Throws:
ModuleDefinitionException - if file '/WEB-INF/mdm/module.xml' is not defined or if it cannot be read properly (this event is also added as an error to 'kernel' logs).

getDependentModuleNames

public static List getDependentModuleNames(ServletContext aServletContext)
                                    throws ModuleDefinitionException
Returns all the modules names on which depends the web application specified.

These dependencies are defined in '/WEB-INF/mdm/module.xml' file.

Throws:
ModuleDefinitionException - if file '/WEB-INF/mdm/module.xml' is not defined by the web application, or if it cannot be read properly (this event is also added as an error to 'kernel' logs).

registerWebApp

public static boolean registerWebApp(Servlet aServlet,
                                     ServletConfig aServletConfig)
                              throws ModuleDefinitionException
Registers a new module based on the specified servlet's web application.

This method must be called by the method Servlet.init().

File '/WEB-INF/mdm/module.xml' in the corresponding web application, defines the module name and other basic module features.

If web application defines some specific module classes (like ServiceInstaller), the Servlet provided must have been loaded by the web application itself (that is , it must be in '/WEB-INF/classes/' or in '/WEB-INF/lib/*.jar').

Returns:
true as registration has succeeded.
Throws:
ModuleDefinitionException - if file '/WEB-INF/mdm/module.xml' is not defined by the web application, or if it cannot be read properly (this event is also added as an error to 'kernel' logs).
See Also:
unregisterWebApp(Servlet, ServletConfig), Servlet.init(javax.servlet.ServletConfig)

unregisterWebApp

public static void unregisterWebApp(Servlet aServlet,
                                    ServletConfig aServletConfig)
Unregisters a module that has been registered by the registerWebApp().

This method must be called by the method Servlet.destroy().

Returns:
true as registration has succeeded.
Throws:
ModuleDefinitionException - if file '/WEB-INF/mdm/module.xml' is not defined by the web application, or if it cannot be read properly (this event is also added as an error to 'kernel' logs).
See Also:
registerWebApp(Servlet, ServletConfig), Servlet.destroy()


(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.