Part I Development Tasks and Tools
1. Setting Up a Development Environment
Part II Developing Applications and Application Components
6. Using the Java Persistence API
7. Developing Web Applications
8. Using Enterprise JavaBeans Technology
9. Using Container-Managed Persistence
12. Developing Lifecycle Listeners
The LifecycleListener Interface
Considerations for Lifecycle Modules
13. Developing OSGi-enabled Java EE Applications
Part III Using Services and APIs
14. Using the JDBC API for Database Access
15. Using the Transaction Service
16. Using the Java Naming and Directory Interface
The com.sun.appserv.server.LifecycleEventContext interface exposes runtime information about the server. The lifecycle event context is created when the LifecycleEvent class is instantiated at server initialization. The LifecycleEventContext interface defines these methods:
public java.lang.String[].getCmdLineArgs()
This method returns the server startup command-line arguments.
public java.lang.String.getInstallRoot()
This method returns the server installation root directory.
public java.lang.String.getInstanceName()
This method returns the server instance name.
public javax.naming.InitialContext.getInitialContext()
This method returns the initial JNDI naming context. The naming environment for lifecycle modules is installed after the STARTUP_EVENT. A lifecycle module can look up any resource by its jndi-name attribute after the READY_EVENT.
If a lifecycle module needs to look up resources, it can do so after the READY_EVENT. It can use the getInitialContext method to get the initial context to which all the resources are bound.