1 16 17 package org.apache.catalina.storeconfig; 18 19 import java.io.PrintWriter ; 20 21 import org.apache.catalina.Cluster; 22 import org.apache.catalina.Container; 23 import org.apache.catalina.Lifecycle; 24 import org.apache.catalina.LifecycleListener; 25 import org.apache.catalina.Pipeline; 26 import org.apache.catalina.Realm; 27 import org.apache.catalina.Valve; 28 import org.apache.catalina.core.StandardHost; 29 import org.apache.commons.logging.Log; 30 import org.apache.commons.logging.LogFactory; 31 32 37 public class StandardHostSF extends StoreFactoryBase { 38 39 private static Log log = LogFactory.getLog(StandardHostSF.class); 40 41 55 public void storeChilds(PrintWriter aWriter, int indent, Object aHost, 56 StoreDescription parentDesc) throws Exception { 57 if (aHost instanceof StandardHost) { 58 StandardHost host = (StandardHost) aHost; 59 if (host instanceof Lifecycle) { 61 LifecycleListener listeners[] = ((Lifecycle) host) 62 .findLifecycleListeners(); 63 storeElementArray(aWriter, indent, listeners); 64 } 65 66 String aliases[] = host.findAliases(); 68 getStoreAppender().printTagArray(aWriter, "Alias", indent + 2, 69 aliases); 70 71 Realm realm = host.getRealm(); 73 if (realm != null) { 74 Realm parentRealm = null; 75 if (host.getParent() != null) { 76 parentRealm = host.getParent().getRealm(); 77 } 78 if (realm != parentRealm) { 79 storeElement(aWriter, indent, realm); 80 } 81 } 82 83 if (host instanceof Pipeline) { 85 Valve valves[] = ((Pipeline) host).getValves(); 86 storeElementArray(aWriter, indent, valves); 87 } 88 89 Cluster cluster = host.getCluster(); 91 if (cluster != null) { 92 storeElement(aWriter, indent, cluster); 93 } 94 95 Container children[] = host.findChildren(); 97 storeElementArray(aWriter, indent, children); 98 } 99 } 100 101 } | Popular Tags |