Author: remy.maucherat(a)jboss.com
Date: 2008-06-02 07:49:30 -0400 (Mon, 02 Jun 2008)
New Revision: 655
Modified:
trunk/java/org/jboss/web/cluster/ClusterListener.java
Log:
- Fix problem with reset leading to adding lifecycle listeners
every time it is called (this was a side effect of
add/removeContext).
Modified: trunk/java/org/jboss/web/cluster/ClusterListener.java
===================================================================
--- trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-05-30 19:22:27 UTC (rev
654)
+++ trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-06-02 11:49:30 UTC (rev
655)
@@ -256,6 +256,7 @@
if (type.equals(Container.ADD_CHILD_EVENT)) {
if (container instanceof Host) {
// Deploying a webapp
+ ((Lifecycle) child).addLifecycleListener(this);
addContext((Context) child, -1);
} else if (container instanceof Engine) {
// Deploying a host
@@ -264,6 +265,7 @@
} else if (type.equals(Container.REMOVE_CHILD_EVENT)) {
if (container instanceof Host) {
// Undeploying a webapp
+ ((Lifecycle) child).removeLifecycleListener(this);
removeContext((Context) child, -1);
} else if (container instanceof Engine) {
// Undeploying a host
@@ -536,6 +538,7 @@
children[j].addContainerListener(this);
Container[] children2 = children[j].findChildren();
for (int k = 0; k < children2.length; k++) {
+ ((Lifecycle) children2[k]).addLifecycleListener(this);
addContext((Context) children2[k], pos);
}
}
@@ -568,6 +571,7 @@
children[j].removeContainerListener(this);
Container[] children2 = children[j].findChildren();
for (int k = 0; k < children2.length; k++) {
+ ((Lifecycle) children2[k]).removeLifecycleListener(this);
removeContext((Context) children2[k], pos);
}
}
@@ -739,8 +743,6 @@
log.debug(sm.getString("clusterListener.context.enable",
context.getPath(), context.getParent().getName(), ((StandardContext)
context).getState()));
}
- ((Lifecycle) context).addLifecycleListener(this);
-
HashMap<String, String> parameters = new HashMap<String, String>();
parameters.put("JVMRoute", getJvmRoute(context));
parameters.put("Context", ("".equals(context.getPath())) ?
"/" : context.getPath());
@@ -763,8 +765,6 @@
log.debug(sm.getString("clusterListener.context.disable",
context.getPath(), context.getParent().getName(), ((StandardContext)
context).getState()));
}
- ((Lifecycle) context).removeLifecycleListener(this);
-
HashMap<String, String> parameters = new HashMap<String, String>();
String jvmRoute = getJvmRoute(context);
// JVMRoute can be null here if nothing was ever initialized
@@ -970,7 +970,6 @@
String requestLine = command + " " + ((wildcard) ?
"*" : proxyURL) + " HTTP/1.0";
int contentLength = body.getLength();
- System.out.println("Body: " + new String(body.getBuffer(),
body.getStart(), body.getLength()));
writer = new BufferedWriter(new
OutputStreamWriter(connection.getOutputStream()));
writer.write(requestLine);
writer.write("\r\n");
Show replies by date