Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Developer's Guide

- Previous: The LifecycleEvent Class
- Next: Deploying a Lifecycle Module

# The Server Lifecycle Event Context

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.

- Previous: The LifecycleEvent Class
- Next: Deploying a Lifecycle Module

- © 2010, Oracle Corporation and/or its affiliates