FileDocCategorySizeDatePackage
FileStrategyBuilder.javaAPI DocGlassfish v2 API4270Fri May 04 22:36:02 BST 2007com.sun.enterprise.web

FileStrategyBuilder

public class FileStrategyBuilder extends BasePersistenceStrategyBuilder implements PersistenceStrategyBuilder

Fields Summary
Constructors Summary
Methods Summary
public voidinitializePersistenceStrategy(org.apache.catalina.Context ctx, com.sun.enterprise.deployment.runtime.web.SessionManager smBean)
Creates a new instance of FileStrategyBuilder

        super.initializePersistenceStrategy(ctx, smBean);
        
        Object[] params = { ctx.getPath() };
        _logger.log(Level.INFO, "webcontainer.filePersistence", params);
        PersistentManager mgr = new PersistentManager();
        mgr.setMaxActiveSessions(maxSessions);
        //FIXME: what is the replacement for setCheckInterval
        //mgr.setCheckInterval(reapInterval);        
        mgr.setMaxIdleBackup(0);           // FIXME: Make configurable

        FileStore store = new FileStore();
        //store.setCheckInterval(storeReapInterval);
        store.setDirectory(directory);
        mgr.setStore(store);
        
        //for intra-vm session locking
        StandardContext sctx = (StandardContext) ctx;
        sctx.restrictedSetPipeline(new PESessionLockingStandardPipeline(sctx));        
        
        //special code for Java Server Faces
        if(ctx.findParameter(JSF_HA_ENABLED) == null) {
            ctx.addParameter(JSF_HA_ENABLED, "true");
        }        
        //START OF 6364900
        mgr.setSessionLocker(new PESessionLocker(ctx));
        //END OF 6364900        
        ctx.setManager(mgr); 
        
        //this must be after ctx.setManager(mgr);
        //StandardContext sctx = (StandardContext) ctx;        
        if(!sctx.isSessionTimeoutOveridden()) {
           mgr.setMaxInactiveInterval(sessionMaxInactiveInterval); 
        }