use of org.apache.catalina.ha.session.DeltaManager in project cas by apereo.
the class CasTomcatEmbeddedServletContainerFactory method getClusteringManagerInstance.
private ClusterManagerBase getClusteringManagerInstance() {
switch(clusteringProperties.getManagerType().toUpperCase()) {
case "DELTA":
final DeltaManager manager = new DeltaManager();
manager.setExpireSessionsOnShutdown(clusteringProperties.isExpireSessionsOnShutdown());
manager.setNotifyListenersOnReplication(true);
return manager;
default:
final BackupManager backupManager = new BackupManager();
backupManager.setNotifyListenersOnReplication(true);
return backupManager;
}
}
use of org.apache.catalina.ha.session.DeltaManager in project tomcat70 by apache.
the class SimpleTcpCluster method createManager.
/**
* Create new Manager without add to cluster (comes with start the manager)
*
* @param name
* Context Name of this manager
* @see org.apache.catalina.Cluster#createManager(java.lang.String)
* @see DeltaManager#start()
*/
@Override
public synchronized Manager createManager(String name) {
if (log.isDebugEnabled()) {
log.debug("Creating ClusterManager for context " + name + " using class " + getManagerTemplate().getClass().getName());
}
ClusterManager manager = null;
try {
manager = managerTemplate.cloneFromTemplate();
manager.setName(name);
} catch (Exception x) {
log.error("Unable to clone cluster manager, defaulting to org.apache.catalina.ha.session.DeltaManager", x);
manager = new org.apache.catalina.ha.session.DeltaManager();
} finally {
if (manager != null)
manager.setCluster(this);
}
return manager;
}
use of org.apache.catalina.ha.session.DeltaManager in project tomcat70 by apache.
the class SimpleTcpCluster method checkDefaults.
protected void checkDefaults() {
if (clusterListeners.size() == 0) {
addClusterListener(new JvmRouteSessionIDBinderListener());
if (managerTemplate instanceof DeltaManager) {
addClusterListener(new ClusterSessionListener());
}
}
if (valves.size() == 0) {
addValve(new JvmRouteBinderValve());
addValve(new ReplicationValve());
}
if (clusterDeployer != null)
clusterDeployer.setCluster(this);
if (channel == null)
channel = new GroupChannel();
if (channel instanceof GroupChannel && !((GroupChannel) channel).getInterceptors().hasNext()) {
channel.addInterceptor(new MessageDispatch15Interceptor());
channel.addInterceptor(new TcpFailureDetector());
}
if (heartbeatBackgroundEnabled)
channel.setHeartbeat(false);
}
use of org.apache.catalina.ha.session.DeltaManager in project tomcat by apache.
the class SimpleTcpCluster method checkDefaults.
protected void checkDefaults() {
if (clusterListeners.size() == 0 && managerTemplate instanceof DeltaManager) {
addClusterListener(new ClusterSessionListener());
}
if (valves.size() == 0) {
addValve(new JvmRouteBinderValve());
addValve(new ReplicationValve());
}
if (clusterDeployer != null) {
clusterDeployer.setCluster(this);
}
if (channel == null) {
channel = new GroupChannel();
}
if (channel instanceof GroupChannel && !((GroupChannel) channel).getInterceptors().hasNext()) {
channel.addInterceptor(new MessageDispatchInterceptor());
channel.addInterceptor(new TcpFailureDetector());
}
if (heartbeatBackgroundEnabled) {
channel.setHeartbeat(false);
}
}
use of org.apache.catalina.ha.session.DeltaManager in project tomcat by apache.
the class SimpleTcpCluster method createManager.
/**
* Create new Manager without add to cluster (comes with start the manager)
*
* @param name
* Context Name of this manager
* @see org.apache.catalina.Cluster#createManager(java.lang.String)
* @see DeltaManager#start()
*/
@Override
public synchronized Manager createManager(String name) {
if (log.isDebugEnabled()) {
log.debug("Creating ClusterManager for context " + name + " using class " + getManagerTemplate().getClass().getName());
}
ClusterManager manager = null;
try {
manager = managerTemplate.cloneFromTemplate();
manager.setName(name);
} catch (Exception x) {
log.error(sm.getString("simpleTcpCluster.clustermanager.cloneFailed"), x);
manager = new org.apache.catalina.ha.session.DeltaManager();
} finally {
if (manager != null) {
manager.setCluster(this);
}
}
return manager;
}
Aggregations