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
}