A lifecycle module, also called a lifecycle listener module, provides a means of running long or short Java-based tasks within the GlassFish Server environment, such as instantiation of singletons or RMI servers. Lifecycle modules are automatically initiated at server startup and are notified at various phases of the server life cycle. All lifecycle module interfaces are in the as-install/modules/glassfish-api.jar file.
For general information about lifecycle modules, see Chapter 12, Developing Lifecycle Listeners, in Oracle GlassFish Server 3.1 Application Development Guide.
You do not need to specify a classpath for the lifecycle module if you place it in the domain-dir/lib or domain-dir/lib/classes directory for the Domain Administration Server (DAS). Do not place it in the lib directory for a particular server instance, or it will be deleted when that instance synchronizes with the GlassFish Server.
After you deploy a lifecycle module, you must restart the server. During server initialization, the server instantiates the module and registers it as a lifecycle event listener.