setSessionFactory(mgr);
setDuplicateIdsSemanticsAllowed(mgr);
ReplicaCache sasReplicaCache = new ReplicaCache(mgr);
mgr.setSipApplicationSessionReplicaCache(sasReplicaCache);
ReplicaCache ssReplicaCache = new ReplicaCache(mgr);
mgr.setSipSessionReplicaCache(ssReplicaCache);
ReplicaCache stReplicaCache = new ReplicaCache(mgr);
mgr.setServletTimerReplicaCache(stReplicaCache);
mgr.setSkipRollingUpgradeBackupRestore(skipRollingUpgradeBackupRestore);
mgr.setRollingUpgradeBackupDirectory(rollingUpgradeBackupDirectory);
mgr.setSipApplicationSessionStore(new SipApplicationSessionStoreImpl());
mgr.setSipSessionStore(new SipSessionStoreImpl());
mgr.setServletTimerStore(new ServletTimerStoreImpl());
/*
* Add StorePools
*/
ServerConfigReader configReader = new ServerConfigReader();
int haStorePoolSize = configReader.getHAStorePoolSizeFromConfig();
int haStorePoolUpperSize = configReader.getHAStorePoolUpperSizeFromConfig();
int haStorePoolPollTime = configReader.getHAStorePoolPollTimeFromConfig();
// SipApplicationSession StorePool
StoreFactory sipApplicationSessionStoreFactory = new SipApplicationSessionStoreFactory();
StorePool sipApplicationSessionStorePool = new StorePool(haStorePoolSize,
haStorePoolUpperSize, haStorePoolPollTime,
sipApplicationSessionStoreFactory);
mgr.setSipApplicationSessionStorePool(sipApplicationSessionStorePool);
// SipSession StorePool
StoreFactory sipSessionStoreFactory = new SipSessionStoreFactory();
StorePool sipSessionStorePool = new StorePool(haStorePoolSize,
haStorePoolUpperSize, haStorePoolPollTime,
sipSessionStoreFactory);
mgr.setSipSessionStorePool(sipSessionStorePool);
// ServletTimer StorePool
StoreFactory servletTimerStoreFactory = new ServletTimerStoreFactory();
StorePool servletTimerStorePool = new StorePool(haStorePoolSize,
haStorePoolUpperSize, haStorePoolPollTime,
servletTimerStoreFactory);
mgr.setServletTimerStorePool(servletTimerStorePool);
ctx.setSipSessionManager(mgr);
// If we are doing replication initialize jxta pipes if they
// haven't been already
String passedInPersistenceType = getPassedInPersistenceType();
if (EEPersistenceTypeResolver.REPLICATED_TYPE.equalsIgnoreCase(passedInPersistenceType)) {
JxtaReplicationReceiver receiver = JxtaReplicationReceiver.createInstance();
receiver.doPipeInitialization();
// ensure the Replication DialogFragmentManager service is initialized and started.
DialogFragmentManager dfm = DialogFragmentManager.getInstance();
try {
if (dfm instanceof ReplicationDialogFragmentManager) {
ReplicationDialogFragmentManager rdfm = (ReplicationDialogFragmentManager) dfm;
ReplicaCache replicaCache = new ReplicaCache(mgr);
rdfm.setReplicaCache(replicaCache);
setDuplicateIdsSemanticsAllowedForDialogs(rdfm);
rdfm.initializeReplication(passedInPersistenceType, haStorePoolSize, haStorePoolUpperSize, haStorePoolPollTime);
rdfm.startReplication();
}