1 23 24 29 30 package com.sun.enterprise.web; 31 32 33 import java.util.logging.Logger ; 34 import java.util.logging.Level ; 35 import org.apache.catalina.Context; 36 import org.apache.catalina.core.StandardContext; 37 import org.apache.catalina.session.FileStore; 38 import org.apache.catalina.session.PersistentManager; 39 import com.sun.enterprise.deployment.runtime.web.SessionManager; 43 44 45 public class FileStrategyBuilder extends BasePersistenceStrategyBuilder implements PersistenceStrategyBuilder { 46 47 48 51 52 public void initializePersistenceStrategy(Context ctx, SessionManager smBean) { 53 super.initializePersistenceStrategy(ctx, smBean); 54 55 Object [] params = { ctx.getPath() }; 56 _logger.log(Level.INFO, "webcontainer.filePersistence", params); 57 PersistentManager mgr = new PersistentManager(); 58 mgr.setMaxActiveSessions(maxSessions); 59 mgr.setMaxIdleBackup(0); 63 FileStore store = new FileStore(); 64 store.setDirectory(directory); 66 mgr.setStore(store); 67 68 StandardContext sctx = (StandardContext) ctx; 70 sctx.restrictedSetPipeline(new PESessionLockingStandardPipeline(sctx)); 71 72 if(ctx.findParameter(JSF_HA_ENABLED) == null) { 74 ctx.addParameter(JSF_HA_ENABLED, "true"); 75 } 76 mgr.setSessionLocker(new PESessionLocker(ctx)); 78 ctx.setManager(mgr); 80 81 if(!sctx.isSessionTimeoutOveridden()) { 84 mgr.setMaxInactiveInterval(sessionMaxInactiveInterval); 85 } 86 } 87 88 } 89 | Popular Tags |