Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide

ProcedureTo create 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:

Lifecycle modules are not part of the J2EE specification, but are an enhancement to the Application Server.

  1. In the tree component, expand the Applications node.

  2. Select the Lifecycle Modules node.

  3. On the Lifecycle Modules page, click New.

  4. On the Create Lifecycle Module page, specify these settings:

    1. In the Name field, type a name that denotes the function of the module.

    2. In the Class Name field, type the fully qualified name of the lifecycle module’s class file.

    3. If the JAR file containing the lifecycle is in the server’s classpath, leave the Classpath field blank. Otherwise, type the fully qualified path.

      If you don’t specify the classpath, you must unpack the classes in domain-dir/applications/lifecycle-module/module-name. If you specify a classpath, nothing else is required.

    4. 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.

    5. When you start the server, it loads lifecycle modules that are already deployed.

      By default, if a load fails, the server continues the startup operation. To prevent the server from starting up when a load fails, select the On Load Failure checkbox.

    6. To disable the module so that is unavailable after deployment, select the Disabled radio button.

      Because a lifecycle module is invoked at server startup, a disabled lifecycle module won’t cease to have an effect until the server instance is restarted.

    7. Choose the targets to which to deploy the module.

      From the list of available targets, choose the target or targets and click Add. Targets can be clusters or stand-alone server instances. If you do not select a target, the module is deployed to the default server instance server.

  5. Click OK.

Equivalent asadmin command

create-lifecycle-module