Creating a Lifecycle Module
A lifecycle module performs tasks when it is triggered by one or more events in the server lifecycle. These server events are:
- initialization
- start up
- ready to service requests
- shut down
Lifecycle modules are not part of the J2EE specification, but are an enhancement to the Sun Java System Application Server.
To create a lifecycle module:
- In the tree component, expand the Applications node.
- Select the Lifecycle Modules node.
- On the Lifecycle Modules page, click New.
- On the Create Lifecycle Module page, specify the settings:
- In the Name field, type a name that denotes the function of the module.
- In the Class Name field, type the fully qualified name of the lifecycle module’s class file.
- If the JAR file containing the lifecycle is in the server’s classpath, then leave the Classpath field blank. Otherwise, type the fully qualified path.
If you don’t specify the classpath, you must unpack the classes in application_server_home/domains/domain/applications/lifecycle-module/module_name. If you specify a classpath, nothing else is required.
- In the Load Order field, type an integer greater than 100 and less than the operating system’s
MAXINT
value.
The integer determines the order in which lifecycle modules are loaded when the server starts up. Modules with smaller integers are loaded sooner.
- When you start the server, it loads lifecycle modules that are already deployed. By default, if a load fails, the server continues the start-up operation. To prevent the server from starting up when a load fails, select the On Load Failure checkbox.
- By default, a module is available as soon as it is deployed. To disable the module so that is unavailable after deployment, select the Disabled radio button.
- Click OK.
Equivalent asadmin
command: create-lifecycle-module
Legal Notices