1 16 17 package org.apache.catalina.storeconfig; 18 19 import java.io.PrintWriter ; 20 21 import org.apache.catalina.session.StandardManager; 22 import org.apache.commons.logging.Log; 23 import org.apache.commons.logging.LogFactory; 24 25 30 public class ManagerSF extends StoreFactoryBase { 31 32 private static Log log = LogFactory.getLog(ManagerSF.class); 33 34 40 public void store(PrintWriter aWriter, int indent, Object aElement) 41 throws Exception { 42 StoreDescription elementDesc = getRegistry().findDescription( 43 aElement.getClass()); 44 if (elementDesc != null && aElement instanceof StandardManager) { 45 StandardManager manager = (StandardManager) aElement; 46 if (!isDefaultManager(manager)) { 47 if (log.isDebugEnabled()) 48 log.debug(sm.getString("factory.storeTag", elementDesc 49 .getTag(), aElement)); 50 getStoreAppender().printIndent(aWriter, indent + 2); 51 getStoreAppender().printTag(aWriter, indent + 2, manager, 52 elementDesc); 53 } 54 } else { 55 if (log.isWarnEnabled()) 56 log.warn(sm.getString("factory.storeNoDescriptor", aElement 57 .getClass())); 58 } 59 } 60 61 68 protected boolean isDefaultManager(StandardManager smanager) { 69 70 if (!"SESSIONS.ser".equals(smanager.getPathname()) 71 || !"java.security.SecureRandom".equals(smanager 72 .getRandomClass()) 73 || (smanager.getMaxActiveSessions() != -1) 74 || !"MD5".equals(smanager.getAlgorithm())) { 75 return (false); 76 } 77 return (true); 78 79 } 80 81 } | Popular Tags |