net.wgen.op.system
Class OpModule

java.lang.Object
  extended bynet.wgen.op.system.OpModule
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExampleModule, FinanceModule, OpFrameworkModule, ProjectModule, SubModule, UnknownModule

public abstract class OpModule
extends java.lang.Object
implements java.io.Serializable

Loaded on startup, this class provides some configuration parameters for an module. The instantiation of your subclass is achieved by setting a OpModule.class property in a .module.properties file in the WEB-INF folder. This file will be read by the OpModuleInitializerServlet.

Version:
$Id: OpModule.html,v 1.2 2007/01/28 04:09:37 paulfeuer Exp $
Author:
Paul Feuer, Wireless Generation, Inc.
See Also:
OpModuleInitializerServlet.MODULE_CLASS_PROPERTY, Serialized Form

Field Summary
protected  java.util.Properties _initProperties
          Initialization properties read in from the .wgapp file.
private  java.lang.String _name
          The name of the OpModule.
static java.lang.String CVSID_PROPERTY
           
protected  org.apache.log4j.Logger LOG
          Logger for the subclass.
static java.lang.String VERSION_PROPERTY
           
 
Constructor Summary
protected OpModule(java.lang.String name)
          Default constructor that requires a name.
 
Method Summary
abstract  int getClassMatchLength(java.lang.Class clazz)
          The amount of the class name that can be claimed by this Application.
 java.lang.String getDataSourceName()
          The datasource name in the oracle-xa-ds configuration file.
 java.lang.String getEjbManagerName()
          The EjbManager String, which for newer Ops should be OpManager, but by default will construct one from the _name.
 java.util.Properties getInitProperties()
          The initialization properties from the wgapp file.
 org.apache.log4j.Logger getLogger()
          The logger for this instance of WGAPplication class.
abstract  java.lang.Long getModuleId()
          The applicationSid of the application.
 java.lang.String getName()
          The application name.
abstract  int getUrlMatchLength(java.lang.String url)
          The amount of the url that can be claimed by this Application.
protected  void setInitializationProperties(java.util.Properties props)
          Called by the initializer servlet with the properties found in the .wgapp file.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION_PROPERTY

public static final java.lang.String VERSION_PROPERTY
See Also:
Constant Field Values

CVSID_PROPERTY

public static final java.lang.String CVSID_PROPERTY
See Also:
Constant Field Values

_name

private final java.lang.String _name
The name of the OpModule.


_initProperties

protected java.util.Properties _initProperties
Initialization properties read in from the .wgapp file.


LOG

protected transient org.apache.log4j.Logger LOG
Logger for the subclass.

Constructor Detail

OpModule

protected OpModule(java.lang.String name)
Default constructor that requires a name.

Parameters:
name - the name of the app
Method Detail

getName

public java.lang.String getName()
The application name.

Returns:
the application name

setInitializationProperties

protected void setInitializationProperties(java.util.Properties props)
Called by the initializer servlet with the properties found in the .wgapp file.

Parameters:
props -
See Also:
OpModuleInitializerServlet.readProperties(java.io.File)

getUrlMatchLength

public abstract int getUrlMatchLength(java.lang.String url)
The amount of the url that can be claimed by this Application. Returning a 0 means that this application makes no claim on the url. The highest scoring claim wins.

Parameters:
url -
Returns:
the amount of the url that can be claimed by this url

getClassMatchLength

public abstract int getClassMatchLength(java.lang.Class clazz)
The amount of the class name that can be claimed by this Application. Returning a 0 means that this application makes no claim on the class. The highest scoring claim wins.

Parameters:
clazz -
Returns:
the amount of the url that can be claimed by this url

getModuleId

public abstract java.lang.Long getModuleId()
The applicationSid of the application.

Returns:
the applicationSid of the application

getEjbManagerName

public java.lang.String getEjbManagerName()
The EjbManager String, which for newer Ops should be OpManager, but by default will construct one from the _name.

Returns:
the EJB

getDataSourceName

public java.lang.String getDataSourceName()
The datasource name in the oracle-xa-ds configuration file.

Returns:
the datasource name in the oracle-xa-ds configuration file.

getLogger

public org.apache.log4j.Logger getLogger()
The logger for this instance of WGAPplication class.

Returns:
the logger for this instance of WGAPplication class

getInitProperties

public java.util.Properties getInitProperties()
The initialization properties from the wgapp file.

Returns:
the initialization properties from the wgapp file

toString

public java.lang.String toString()