1 23 24 package com.sun.enterprise.web; 25 26 import org.apache.catalina.startup.Embedded; 27 import org.apache.catalina.Logger; 28 import org.apache.catalina.Engine; 29 import org.apache.catalina.Lifecycle; 30 import org.apache.catalina.Container; 31 32 35 public class PwcWebContainer implements PwcWebContainerLifecycle { 36 37 41 private Engine _engine = null; 42 43 46 private Embedded _embedded = null; 47 48 49 52 private boolean _started = false; 53 54 public void onInitialization(String rootDir, String instanceName, 55 boolean useNaming, Logger logger, 56 String embeddedClassName) 57 throws Exception { 58 Class c = Class.forName(embeddedClassName); 59 _embedded = (Embedded) c.newInstance(); 60 _embedded.setUseNaming(useNaming); 61 _embedded.setLogger(logger); 62 _engine = _embedded.createEngine(); 63 _embedded.addEngine(_engine); 64 } 65 66 public void onStartup() 67 throws Exception { 68 _started = true; 69 70 _embedded.start(); 71 72 } 73 74 public void onReady() 75 throws Exception { 76 } 77 78 79 public void onShutdown() 80 throws Exception { 81 } 82 83 84 public void onTermination() 85 throws Exception { 86 _started = false; 87 _embedded.stop(); 88 } 89 90 public Engine getEngine() { 91 return _engine; 92 } 93 94 public Embedded getEmbedded() { 95 return _embedded; 96 } 97 98 } 99 | Popular Tags |