1 23 24 31 32 package com.sun.appserv.server; 33 34 import java.util.Properties ; 35 36 40 public class LifecycleListenerImpl implements LifecycleListener { 41 42 59 public void handleEvent(LifecycleEvent event) throws ServerLifecycleException { 60 LifecycleEventContext ctx = event.getLifecycleEventContext(); 61 62 ctx.log("got event" + event.getEventType() + " event data: " + event.getData()); 63 64 Properties props; 65 66 if (LifecycleEvent.INIT_EVENT == event.getEventType()) { 67 System.out.println("LifecycleListener: INIT_EVENT"); 68 69 props = (Properties ) event.getData(); 70 71 return; 73 } 74 75 if (LifecycleEvent.STARTUP_EVENT == event.getEventType()) { 76 System.out.println("LifecycleListener: STARTUP_EVENT"); 77 78 return; 80 } 81 82 if (LifecycleEvent.SHUTDOWN_EVENT== event.getEventType()) { 83 System.out.println("LifecycleListener: SHUTDOWN_EVENT"); 84 85 return; 87 } 88 89 if (LifecycleEvent.TERMINATION_EVENT == event.getEventType()) { 90 System.out.println("LifecycleListener: TERMINATE_EVENT"); 91 92 return; 94 } 95 } 96 } 97 | Popular Tags |