1 16 package org.apache.catalina.storeconfig; 17 18 import java.io.PrintWriter ; 19 20 import org.apache.catalina.deploy.NamingResources; 21 import org.apache.commons.logging.Log; 22 import org.apache.commons.logging.LogFactory; 23 24 30 public class GlobalNamingResourcesSF extends StoreFactoryBase { 31 private static Log log = LogFactory.getLog(GlobalNamingResourcesSF.class); 32 33 39 public void store(PrintWriter aWriter, int indent, Object aElement) 40 throws Exception { 41 42 if (aElement instanceof NamingResources) { 43 44 StoreDescription elementDesc = getRegistry().findDescription( 45 NamingResources.class.getName() 46 + ".[GlobalNamingResources]"); 47 48 if (elementDesc != null) { 49 getStoreAppender().printIndent(aWriter, indent + 2); 50 getStoreAppender().printOpenTag(aWriter, indent + 2, aElement, 51 elementDesc); 52 NamingResources resources = (NamingResources) aElement; 53 StoreDescription resourcesdesc = getRegistry().findDescription( 54 NamingResources.class.getName()); 55 if (resourcesdesc != null) { 56 resourcesdesc.getStoreFactory().store(aWriter, indent + 2, 57 resources); 58 } else { 59 if(log.isWarnEnabled()) 60 log.warn("Can't find NamingRsources Store Factory!"); 61 } 62 63 getStoreAppender().printIndent(aWriter, indent + 2); 64 getStoreAppender().printCloseTag(aWriter, elementDesc); 65 } else { 66 if (log.isWarnEnabled()) 67 log.warn("Descriptor for element" + aElement.getClass() 68 + " not configured!"); 69 } 70 } else { 71 if (log.isWarnEnabled()) 72 log.warn("wrong element " + aElement.getClass()); 73 74 } 75 } 76 } 77 78 | Popular Tags |