String persistenceType = "ha";
String persistenceFrequency = "web-method";
String persistenceScope = "modified-attribute";
Object[] params = { ctx.getPath(), persistenceType, persistenceFrequency, persistenceScope };
_logger.log(Level.INFO, "webcontainer.haPersistence", params);
HAWebEventPersistentManager mgr = new HAWebEventPersistentManager();
mgr.setMaxActiveSessions(maxSessions);
//mgr.setCheckInterval(reapInterval); //FIXME: put this back
mgr.setMaxIdleBackup(-1); // 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);
_logger.finest("UUID_GENERATOR = " + 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 ModifiedAttributeSessionFactory());
//add HAStorePool
ServerConfigReader configReader = new ServerConfigReader();
int haStorePoolSize = configReader.getHAStorePoolSizeFromConfig();
int haStorePoolUpperSize = configReader.getHAStorePoolUpperSizeFromConfig();
int haStorePoolPollTime = configReader.getHAStorePoolPollTimeFromConfig();
/*
HAAttributeStoreFactory haStoreFactory = new HAAttributeStoreFactory();
_logger.finest("haStoreFactory : "+haStoreFactory.getClass());
HAStorePool storePool =
new HAStorePool(haStorePoolSize, haStorePoolUpperSize,
haStorePoolPollTime, haStoreFactory);
mgr.setHAStorePool(storePool);
*/
StoreFactory haStoreFactory = new HAAttributeStoreFactory();
_logger.finest("haStoreFactory : "+haStoreFactory.getClass());
StorePool storePool =
new StorePool(haStorePoolSize, haStorePoolUpperSize,
haStorePoolPollTime, haStoreFactory);
mgr.setStorePool(storePool);
//add HASessionStoreValve
HASessionStoreValve hadbValve = new HASessionStoreValve();
StandardContext stdCtx = (StandardContext) ctx;
stdCtx.addValve(hadbValve);