Weblogic provides a very convenient way to perform some activation of application component during application startup for example initializing the DB factories, logger, service agents etc and also some deactivation of the application component while shutdown of the application, All using startup and shutdown classes.
To configure Startup and Shutdown classes is very easy in Weblogic.Just follow the below steps.
Step 1: Write a Ant Script to generate JAR file of the classes(shutdown+startup) e.g strtshutclass.jar
Step 2: Copy the generated JAR into [DOMAIN_HOME] /lib folder. So that when server starts, it will dynamically add that in the server path
Step 2: In the Server startup scripts e.g startWebLogic.cmd or startWebLogic.sh, find the classpath variable and add the reference of your jar
e.g set SAVE_CLASSPATH=%CLASSPATH%;C:\MyApp\builds\lib\strtshutclass.jar;
Step 3: Start the server