1 23 24 package com.sun.enterprise.server; 25 26 import java.util.logging.Level ; 27 import java.util.logging.Logger ; 28 import com.sun.logging.LogDomains; 29 30 import com.sun.enterprise.admin.event.AdminEventListener; 31 import com.sun.enterprise.admin.event.ShutdownEventListener; 32 import com.sun.enterprise.admin.event.ShutdownEvent; 33 import com.sun.enterprise.admin.event.AdminEventListenerException; 34 import com.sun.enterprise.server.PEMain; 35 import com.sun.enterprise.server.J2EEServer; 36 import com.sun.appserv.server.ServerLifecycleException; 37 38 import com.sun.enterprise.util.i18n.StringManager; 40 41 import com.sun.enterprise.security.audit.AuditManager; 42 import com.sun.enterprise.security.audit.AuditManagerFactory; 43 44 47 48 public class Shutdown implements ShutdownEventListener { 49 50 51 static Logger _logger = LogDomains.getLogger(LogDomains.CORE_LOGGER); 52 53 58 public void startShutdown(ShutdownEvent event) 59 throws AdminEventListenerException { 60 61 try { 62 PEMain.getApplicationServer().onShutdown(); 63 PEMain.getApplicationServer().onTermination(); 64 65 } catch (ServerLifecycleException e) { 66 _logger.log(Level.SEVERE,"shutdown.error",e.getMessage()); 67 } 68 69 AuditManager auditManager = 70 AuditManagerFactory.getAuditManagerInstance(); 71 72 if (auditManager.isAuditOn()){ 73 auditManager.serverShutdown(); 74 } 75 76 J2EEServer.shutdown(); 77 _logger.log(Level.FINE, "finished calling J2EEServer.clientShutdown().."); 78 79 } 80 81 82 83 } 84 | Popular Tags |