FileDocCategorySizeDatePackage
MemoryStrategyBuilder.javaAPI DocGlassfish v2 API4878Wed Jul 11 10:59:40 BST 2007com.sun.enterprise.web

MemoryStrategyBuilder

public class MemoryStrategyBuilder 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 MemoryStrategyBuilder

        super.initializePersistenceStrategy(ctx, smBean);
        String persistenceType = "memory";        
        String ctxPath = ctx.getPath();
        if(ctxPath != null && !ctxPath.equals("")) {    
            Object[] params = { ctx.getPath(), persistenceType };
            _logger.log(Level.FINE, "webcontainer.noPersistence", params); 
        }
        StandardManager mgr = new StandardManager();
        //remove this fix because we don't want unload persistence
        //unless sessionFilename has been set explicitly
        //following line replaces commented out code
        /*
        if (sessionFilename != null) {
            mgr.setPathname(sessionFilename);
        }
         */
        if (sessionFilename == null) {
            mgr.setPathname(sessionFilename);
        } else {
            mgr.setPathname(prependContextPathTo(sessionFilename, ctx));
        }
        StandardContext sctx = (StandardContext) ctx;
        sctx.restrictedSetPipeline(new WebPipeline(sctx));         
        
        mgr.setMaxActiveSessions(maxSessions);
        //START OF 6364900
        mgr.setSessionLocker(new PESessionLocker(ctx));
        //END OF 6364900        
        //FIXME: what is the replacement for setCheckInterval
        //mgr.setCheckInterval(reapInterval);
        ctx.setManager(mgr);

        // START CR 6275709
        if (sessionIdGeneratorClassname != null) {
            try {
                UuidGenerator generator = (UuidGenerator)
                    Class.forName(sessionIdGeneratorClassname).newInstance();
                mgr.setUuidGenerator(generator);
            } catch (Exception ex) {
                _logger.log(Level.SEVERE,
                            "Unable to load session uuid generator "
                            + sessionIdGeneratorClassname,
                            ex);
            }
        }
        // END CR 6275709
        
        //this must be after ctx.setManager(mgr);       
        if(!sctx.isSessionTimeoutOveridden()) {
            mgr.setMaxInactiveInterval(sessionMaxInactiveInterval); 
        }