use of org.apache.catalina.ha.ClusterManager in project tomcat by apache.
the class SimpleTcpCluster method removeManager.
/**
* Remove an application from cluster replication bus.
*
* @param manager The manager
* @see org.apache.catalina.Cluster#removeManager(Manager)
*/
@Override
public void removeManager(Manager manager) {
if (manager instanceof ClusterManager) {
ClusterManager cmgr = (ClusterManager) manager;
// Notify our interested LifecycleListeners
fireLifecycleEvent(BEFORE_MANAGERUNREGISTER_EVENT, manager);
managers.remove(getManagerName(cmgr.getName(), manager));
cmgr.setCluster(null);
// Notify our interested LifecycleListeners
fireLifecycleEvent(AFTER_MANAGERUNREGISTER_EVENT, manager);
}
}
use of org.apache.catalina.ha.ClusterManager 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;
}
use of org.apache.catalina.ha.ClusterManager in project tomcat by apache.
the class DeltaSession method setOwner.
@Override
public void setOwner(Object owner) {
if (owner instanceof ClusterManager && getManager() == null) {
ClusterManager cm = (ClusterManager) owner;
this.setManager(cm);
this.setValid(true);
this.setPrimarySession(false);
this.access();
this.resetDeltaRequest();
this.endAccess();
}
}
Aggregations