InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.3: Administering application servers >
6.6.3.5: Invoking your own classes during application server startup and shutdown

6.6.3.5: Invoking your own classes during application server startup and shutdown

The ServiceInitializer enables you to specify user defined classes that are invoked as the last action (or actions) during application server startup and shutdown.

Creating classes for use with ServiceInitializer

ServiceInitializer classes must have a no-argument constructor (for newInstance()) and must implement the following interface:

import javax.naming.Context;
public interface ServiceInitializer {
public void initialize(Context initialNamingContext) throws Exception;
public void terminate(Context initialNamingContext) throws Exception;
}
Adding ServiceInitializer classes to an application server

Specify your classes as part of the ServiceInitializer command line argument for an application server, such as:

-Dcom.ibm.ejs.sm.server.ServiceInitializer=<class>[,<class>]...
where each <class> is one of your own classes.

ServiceInitializer classes are initialized in the order listed in the property, and are terminated in reverse order.

Go to previous article: Property files pertaining to application servers Go to next article: Administering servlet engines

 

 
Go to previous article: Property files pertaining to application servers Go to next article: Administering servlet engines