FileDocCategorySizeDatePackage
LifecycleListenerImpl.javaAPI DocGlassfish v2 API4281Fri May 04 22:32:54 BST 2007com.sun.appserv.server

LifecycleListenerImpl

public class LifecycleListenerImpl extends Object implements LifecycleListener
LifecycleListenerImpl is a dummy implementation for the LifecycleListener interface. This implementaion stubs out various lifecycle interface methods.

Fields Summary
Constructors Summary
Methods Summary
public voidhandleEvent(LifecycleEvent event)
receive a server lifecycle event

param
event associated event
throws
ServerLifecycleException for exceptional condition. Configure this module as a lifecycle-module in server.xml: Setis-failure-fatalin server.xml to true for fatal conditions.

        LifecycleEventContext ctx = event.getLifecycleEventContext();

        ctx.log("got event" + event.getEventType() + " event data: " + event.getData());

        Properties props;

        if (LifecycleEvent.INIT_EVENT == event.getEventType()) {
            System.out.println("LifecycleListener: INIT_EVENT");

            props = (Properties) event.getData();

            // handle INIT_EVENT
            return;
        }

        if (LifecycleEvent.STARTUP_EVENT == event.getEventType()) {
            System.out.println("LifecycleListener: STARTUP_EVENT");

            // handle STARTUP_EVENT
            return;
        }

        if (LifecycleEvent.SHUTDOWN_EVENT== event.getEventType()) {
            System.out.println("LifecycleListener: SHUTDOWN_EVENT");

            // handle SHUTDOWN_EVENT
            return;
        }

        if (LifecycleEvent.TERMINATION_EVENT == event.getEventType()) {
            System.out.println("LifecycleListener: TERMINATE_EVENT");

            // handle TERMINATION_EVENT
            return;
        }