receive a server lifecycle event
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;
}