1 17 18 19 package org.apache.catalina.startup; 20 21 22 import org.apache.catalina.Engine; 23 import org.apache.catalina.Lifecycle; 24 import org.apache.catalina.LifecycleEvent; 25 import org.apache.catalina.LifecycleListener; 26 import org.apache.catalina.util.StringManager; 27 28 29 36 37 public class EngineConfig 38 implements LifecycleListener { 39 40 41 protected static org.apache.commons.logging.Log log= 42 org.apache.commons.logging.LogFactory.getLog( EngineConfig.class ); 43 44 46 47 50 protected Engine engine = null; 51 52 53 56 protected static final StringManager sm = 57 StringManager.getManager(Constants.Package); 58 59 60 62 63 68 public void lifecycleEvent(LifecycleEvent event) { 69 70 try { 72 engine = (Engine) event.getLifecycle(); 73 } catch (ClassCastException e) { 74 log.error(sm.getString("engineConfig.cce", event.getLifecycle()), e); 75 return; 76 } 77 78 if (event.getType().equals(Lifecycle.START_EVENT)) 80 start(); 81 else if (event.getType().equals(Lifecycle.STOP_EVENT)) 82 stop(); 83 84 } 85 86 87 89 90 93 protected void start() { 94 95 if (engine.getLogger().isDebugEnabled()) 96 engine.getLogger().debug(sm.getString("engineConfig.start")); 97 98 } 99 100 101 104 protected void stop() { 105 106 if (engine.getLogger().isDebugEnabled()) 107 engine.getLogger().debug(sm.getString("engineConfig.stop")); 108 109 } 110 111 112 } 113 | Popular Tags |