Examples of HABackgroundManager


Examples of com.sun.enterprise.ee.web.sessmgmt.HABackgroundManager

        String persistenceType = "ha";
        String persistenceFrequency = "time-based";
        String persistenceScope = "modified-session";
        Object[] params = { ctx.getPath(), persistenceType, persistenceFrequency, persistenceScope };
        _logger.log(Level.INFO, "webcontainer.haPersistence", params);
        HABackgroundManager mgr = new HABackgroundManager();
        mgr.setMaxActiveSessions(maxSessions);
        //mgr.setCheckInterval(reapInterval); //FIXME: put this back
        mgr.setMaxIdleBackup(0);           // FIXME: Make configurable

        HAStore store = new HAStore();
        //store.setCheckInterval(storeReapInterval);  //FIXME: put this back
        mgr.setStore(store);
       
        //in the future can set other implementations
        //of UuidGenerator in server.xml
        //even if not set it defaults to UuidGeneratorImpl
        ServerConfigLookup lookup = new ServerConfigLookup();
        UuidGenerator generator = lookup.getUuidGeneratorFromConfig();
        mgr.setUuidGenerator(generator);
       
        //for intra-vm session locking
        _logger.finest("sctx.restrictedSetPipeline(new SessionLockingStandardPipeline(sctx))");
        StandardContext sctx = (StandardContext) ctx;
        sctx.restrictedSetPipeline(new SessionLockingStandardPipeline(sctx));
       
        //special code for Java Server Faces
        if(sctx.findParameter(JSF_HA_ENABLED) == null) {
            sctx.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);
        if(!sctx.isSessionTimeoutOveridden()) {
           mgr.setMaxInactiveInterval(sessionMaxInactiveInterval);
        }        
       
        //add SessionFactory
        mgr.setSessionFactory(new ModifiedSessionFactory());
       
        //SJSAS 6406580 START
        //add HAStorePool
        ServerConfigReader configReader = new ServerConfigReader();

        int haStorePoolSize = configReader.getHAStorePoolSizeFromConfig();
        int haStorePoolUpperSize = configReader.getHAStorePoolUpperSizeFromConfig();
        int haStorePoolPollTime = configReader.getHAStorePoolPollTimeFromConfig();       
       
        StoreFactory haStoreFactory = new HAFullSessionStoreFactory();
        StorePool storePool =
            new StorePool(haStorePoolSize, haStorePoolUpperSize,
                haStorePoolPollTime, haStoreFactory);
        mgr.setStorePool(storePool);
        //SJSAS 6406580 END       
                       
    }       
View Full Code Here

Examples of com.sun.enterprise.ee.web.sessmgmt.HABackgroundManager

        String persistenceType = "ha";
        String persistenceFrequency = "time-based";
        String persistenceScope = "session";
        Object[] params = { ctx.getPath(), persistenceType, persistenceFrequency, persistenceScope };
        _logger.log(Level.INFO, "webcontainer.haPersistence", params);
        HABackgroundManager mgr = new HABackgroundManager();
        mgr.setMaxActiveSessions(maxSessions);
        //mgr.setCheckInterval(reapInterval);     //FIXME: put this back
        mgr.setMaxIdleBackup(0);           // FIXME: Make configurable

        HAStore store = new HAStore();
        //store.setCheckInterval(storeReapInterval);  //FIXME: put this back
        mgr.setStore(store);
       
        //in the future can set other implementations
        //of UuidGenerator in server.xml
        //even if not set it defaults to UuidGeneratorImpl
        ServerConfigLookup lookup = new ServerConfigLookup();
        UuidGenerator generator = lookup.getUuidGeneratorFromConfig();
        mgr.setUuidGenerator(generator);
       
        //for intra-vm session locking
        _logger.finest("sctx.restrictedSetPipeline(new SessionLockingStandardPipeline(sctx))");
        StandardContext sctx = (StandardContext) ctx;
        sctx.restrictedSetPipeline(new SessionLockingStandardPipeline(sctx));
       
        //special code for Java Server Faces
        if(sctx.findParameter(JSF_HA_ENABLED) == null) {
            sctx.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);
        if(!sctx.isSessionTimeoutOveridden()) {
           mgr.setMaxInactiveInterval(sessionMaxInactiveInterval);
        }        
       
        //add SessionFactory
        mgr.setSessionFactory(new FullSessionFactory());
       
        //SJSAS 6406580 START
        //add HAStorePool
        ServerConfigReader configReader = new ServerConfigReader();

        int haStorePoolSize = configReader.getHAStorePoolSizeFromConfig();
        int haStorePoolUpperSize = configReader.getHAStorePoolUpperSizeFromConfig();
        int haStorePoolPollTime = configReader.getHAStorePoolPollTimeFromConfig();
       
        StoreFactory haStoreFactory = new HAFullSessionStoreFactory();
        StorePool storePool =
            new StorePool(haStorePoolSize, haStorePoolUpperSize,
                haStorePoolPollTime, haStoreFactory);
        mgr.setStorePool(storePool);          
        //SJSAS 6406580 END       
                       
    }  
View Full Code Here

Examples of com.sun.enterprise.ee.web.sessmgmt.HABackgroundManager

        String persistenceType = "ha";
        String persistenceFrequency = "time-based";
        String persistenceScope = "modified-attribute";
        Object[] params = { ctx.getPath(), persistenceType, persistenceFrequency, persistenceScope };
        _logger.log(Level.INFO, "webcontainer.haPersistence", params);
        HABackgroundManager mgr = new HABackgroundManager();
        mgr.setMaxActiveSessions(maxSessions);
        //mgr.setCheckInterval(reapInterval); //FIXME: put this back
        mgr.setMaxIdleBackup(0);           // FIXME: Make configurable

        HAAttributeStore store = new HAAttributeStore();
        //store.setCheckInterval(storeReapInterval);  //FIXME: put this back
        mgr.setStore(store);
       
        //in the future can set other implementations
        //of UuidGenerator in server.xml
        //even if not set it defaults to UuidGeneratorImpl
        ServerConfigLookup lookup = new ServerConfigLookup();
        UuidGenerator generator = lookup.getUuidGeneratorFromConfig();
        mgr.setUuidGenerator(generator);
       
        //for intra-vm session locking
        StandardContext sctx = (StandardContext) ctx;
        sctx.restrictedSetPipeline(new SessionLockingStandardPipeline(sctx));
       
        //special code for Java Server Faces
        if(sctx.findParameter(JSF_HA_ENABLED) == null) {
            sctx.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);
        if(!sctx.isSessionTimeoutOveridden()) {
           mgr.setMaxInactiveInterval(sessionMaxInactiveInterval);
        }        
       
        //add SessionFactory
        mgr.setSessionFactory(new ModifiedAttributeSessionFactory());
        //mgr.setSessionFactory(new FullSessionFactory());
       
        //SJSAS 6406580 START
        //add HAStorePool
        ServerConfigReader configReader = new ServerConfigReader();

        int haStorePoolSize = configReader.getHAStorePoolSizeFromConfig();
        int haStorePoolUpperSize = configReader.getHAStorePoolUpperSizeFromConfig();
        int haStorePoolPollTime = configReader.getHAStorePoolPollTimeFromConfig();       
       
        StoreFactory haStoreFactory = new HAAttributeStoreFactory();
        _logger.finest("haStoreFactory  : "+haStoreFactory.getClass());
        StorePool storePool =
            new StorePool(haStorePoolSize, haStorePoolUpperSize,
                haStorePoolPollTime, haStoreFactory);
        mgr.setStorePool(storePool);
        //SJSAS 6406580 END       
                       
    }      
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.