creates a lifecycle module
create-lifecycle-module [--help] --classname classname [--enabled={true|false}] [--target target] [--classpath classpath] [--loadorder loadorder] [--failurefatal={false|true} ] [--description description] [--property (name=value)[:name=value]*] module_name
The create-lifecycle-module subcommand creates a lifecycle module. A lifecycle module provides a means of running a short or long duration Java-based task at a specific stage in the server life cycle. This subcommand is supported in remote mode only.
--help-?Displays the help text for the subcommand.
--classnameThis is the fully qualified name of the startup class.
--targetIndicates the location where the lifecycle module is to be created. Valid values are
server- Specifies the default server instance as the target for creating the lifecycle module. server is the name of the default server instance and is the default value for this option.
cluster_name- Specifies a particular cluster as the target for creating the lifecycle module.
instance_name- Specifies a particular stand-alone server instance as the target for creating the lifecycle module.
--classpathThis option indicates where the lifecycle module is located. It is a classpath with the standard format: either colon-separated (Unix) or semicolon-separated (Windows) JAR files and directories. The referenced JAR files and directories are not uploaded to the server instance.
--loadorderThis option represents an integer value that can be used to force the order in which deployed lifecycle modules are loaded at server startup. Smaller numbered modules are loaded sooner. Order is unspecified if two or more lifecycle modules have the same load-order value. The default is Integer.MAX_VALUE, which means the lifecycle module is loaded last.
--failurefatalThis option tells the system what to do if the lifecycle module does not load correctly. When this option is set to true, the system aborts the server startup if this module does not load properly. The default value is false.
--enabledThis option determines whether the lifecycle module is enabled at runtime. The default value is true.
--descriptionThis is the text description of the lifecycle module.
--propertyThis is an optional attribute containing name/value pairs used to configure the lifecycle module.
This operand is a unique identifier for the deployed server lifecycle event listener module.
The following example creates a lifecycle module named customSetup.
asadmin> create-lifecycle-module --classname "com.acme.CustomSetup" --classpath "/export/customSetup" --loadorder 1 --failurefatal=true --description "this is a sample customSetup" --property rmi="Server\=acme1\:7070":timeout=30 customSetup Command create-lifecycle-module executed successfully
The escape character \ is used in the property option to specify that the equal sign (=) and colon (:) are part of the rmi property value.
command executed successfully
error in executing the command
delete-lifecycle-module(1), list-lifecycle-modules(1)
"Developing Lifecycle Listeners" in Oracle GlassFish Server Application Development Guide