1 16 17 package org.apache.catalina.storeconfig; 18 19 import java.io.PrintWriter ; 20 21 import org.apache.catalina.Container; 22 import org.apache.catalina.Lifecycle; 23 import org.apache.catalina.LifecycleListener; 24 import org.apache.catalina.Pipeline; 25 import org.apache.catalina.Realm; 26 import org.apache.catalina.Valve; 27 import org.apache.catalina.core.StandardEngine; 28 import org.apache.commons.logging.Log; 29 import org.apache.commons.logging.LogFactory; 30 31 36 public class StandardEngineSF extends StoreFactoryBase { 37 38 private static Log log = LogFactory.getLog(StandardEngineSF.class); 39 40 53 public void storeChilds(PrintWriter aWriter, int indent, Object aEngine, 54 StoreDescription parentDesc) throws Exception { 55 if (aEngine instanceof StandardEngine) { 56 StandardEngine engine = (StandardEngine) aEngine; 57 if (engine instanceof Lifecycle) { 59 LifecycleListener listeners[] = ((Lifecycle) engine) 60 .findLifecycleListeners(); 61 storeElementArray(aWriter, indent, listeners); 62 } 63 64 Realm realm = engine.getRealm(); 66 if (realm != null) { 67 Realm parentRealm = null; 68 if (engine.getParent() != null) { 70 parentRealm = engine.getParent().getRealm(); 71 } 72 if (realm != parentRealm) { 73 storeElement(aWriter, indent, realm); 74 75 } 76 } 77 78 if (engine instanceof Pipeline) { 80 Valve valves[] = ((Pipeline) engine).getValves(); 81 storeElementArray(aWriter, indent, valves); 82 83 } 84 Container children[] = engine.findChildren(); 86 storeElementArray(aWriter, indent, children); 87 } 88 } 89 } | Popular Tags |