You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2008/04/12 19:45:12 UTC
svn commit: r647477 -
/tomcat/sandbox/tomcat-oacc/trunk/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
Author: rjung
Date: Sat Apr 12 10:45:11 2008
New Revision: 647477
URL: http://svn.apache.org/viewvc?rev=647477&view=rev
Log:
Mostly undo r641265:
We need the new Cluster interface methods
registerManager() and removeManager() but since our managers
never call them, keep logic inside the old methods.
Modified:
tomcat/sandbox/tomcat-oacc/trunk/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
Modified: tomcat/sandbox/tomcat-oacc/trunk/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-oacc/trunk/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java?rev=647477&r1=647476&r2=647477&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-oacc/trunk/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java (original)
+++ tomcat/sandbox/tomcat-oacc/trunk/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java Sat Apr 12 10:45:11 2008
@@ -553,31 +553,28 @@
} catch (Exception x) {
log.error("Unable to load class for replication manager", x);
manager = new org.apache.catalina.cluster.session.DeltaManager();
- }
- }finally {
+ } finally {
+ if (manager != null) {
+ manager.setDistributable(true);
+ if (manager instanceof ClusterManager) {
+ ClusterManager cmanager = (ClusterManager) manager;
+ cmanager.setDefaultMode(true);
+ cmanager.setName(getManagerName(name, manager));
+ cmanager.setCluster(this);
+ }
+ }
+ } }finally {
Thread.currentThread().setContextClassLoader(oldCtxLoader);
}
return manager;
}
+ /** This method is actually never called.
+ * The TC 6 cluster interface forces it to exist,
+ * but the ported cluster managers from TC 5.5
+ * use addManager(String, Manager) instead.
+ */
public void registerManager(Manager manager) {
-
- if (! (manager instanceof ClusterManager)) {
- log.warn("Manager [ " + manager + "] does not implement ClusterManager, addition to cluster has been aborted.");
- return;
- }
- ClusterManager cmanager = (ClusterManager) manager ;
- cmanager.setDistributable(true);
- // Notify our interested LifecycleListeners
- lifecycle.fireLifecycleEvent(BEFORE_MANAGERREGISTER_EVENT, manager);
- String clusterName = getManagerName(cmanager.getName(), manager);
- cmanager.setName(clusterName);
- cmanager.setCluster(this);
- cmanager.setDefaultMode(true);
-
- managers.put(clusterName, manager);
- // Notify our interested LifecycleListeners
- lifecycle.fireLifecycleEvent(AFTER_MANAGERREGISTER_EVENT, manager);
}
/**
@@ -599,17 +596,12 @@
}
}
- /**
- * remove an application form cluster replication bus
- *
- * @see org.apache.catalina.ha.CatalinaCluster#removeManager(java.lang.String,Manager)
+ /** This method is actually never called.
+ * The TC 6 cluster interface forces it to exist,
+ * but the ported cluster managers from TC 5.5
+ * use RemoveManager(String, Manager) instead.
*/
public void removeManager(Manager manager) {
- if (manager != null && manager instanceof ClusterManager ) {
- ClusterManager cmgr = (ClusterManager) manager;
- String name = cmgr.getName();
- removeManager(name, manager);
- }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org