From: markt Date: Thu, 29 Jul 2010 12:28:40 +0000 (+0000) Subject: Follow on to r980418 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9f4d2681e847ccb15b1ad1d2ac2106f79efa9774;p=tomcat7.0 Follow on to r980418 Need to move registration with context to ManagerBase too git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@980424 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/ha/session/DeltaManager.java b/java/org/apache/catalina/ha/session/DeltaManager.java index 087197fd7..e6b8eb7ea 100644 --- a/java/org/apache/catalina/ha/session/DeltaManager.java +++ b/java/org/apache/catalina/ha/session/DeltaManager.java @@ -442,31 +442,6 @@ public class DeltaManager extends ClusterManagerBase{ this.cluster = cluster; } - /** - * Set the Container with which this Manager has been associated. If it is a - * Context (the usual case), listen for changes to the session timeout - * property. - * - * @param container - * The associated Container - */ - @Override - public void setContainer(Container container) { - // De-register from the old Container (if any) - if ((this.container != null) && (this.container instanceof Context)) - ((Context) this.container).removePropertyChangeListener(this); - - // Default processing provided by our superclass - super.setContainer(container); - - // Register with the new Container (if any) - if ((this.container != null) && (this.container instanceof Context)) { - setMaxInactiveInterval(((Context) this.container).getSessionTimeout() * 60); - ((Context) this.container).addPropertyChangeListener(this); - } - - } - // --------------------------------------------------------- Public Methods /** diff --git a/java/org/apache/catalina/session/ManagerBase.java b/java/org/apache/catalina/session/ManagerBase.java index c3d20c285..78299af3b 100644 --- a/java/org/apache/catalina/session/ManagerBase.java +++ b/java/org/apache/catalina/session/ManagerBase.java @@ -308,9 +308,21 @@ public abstract class ManagerBase extends LifecycleMBeanBase */ public void setContainer(Container container) { + // De-register from the old Container (if any) + if ((this.container != null) && (this.container instanceof Context)) + ((Context) this.container).removePropertyChangeListener(this); + Container oldContainer = this.container; this.container = container; support.firePropertyChange("container", oldContainer, this.container); + + // Register with the new Container (if any) + if ((this.container != null) && (this.container instanceof Context)) { + setMaxInactiveInterval + ( ((Context) this.container).getSessionTimeout()*60 ); + ((Context) this.container).addPropertyChangeListener(this); + } + } diff --git a/java/org/apache/catalina/session/PersistentManagerBase.java b/java/org/apache/catalina/session/PersistentManagerBase.java index 832ddf2a7..14d130056 100644 --- a/java/org/apache/catalina/session/PersistentManagerBase.java +++ b/java/org/apache/catalina/session/PersistentManagerBase.java @@ -25,8 +25,6 @@ import java.security.PrivilegedExceptionAction; import java.util.HashMap; import java.util.Map; -import org.apache.catalina.Container; -import org.apache.catalina.Context; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleState; @@ -299,34 +297,6 @@ public abstract class PersistentManagerBase extends ManagerBase { /** - * Set the Container with which this Manager has been associated. If it is a - * Context (the usual case), listen for changes to the session timeout - * property. - * - * @param container - * The associated Container - */ - @Override - public void setContainer(Container container) { - - // De-register from the old Container (if any) - if ((this.container != null) && (this.container instanceof Context)) - ((Context) this.container).removePropertyChangeListener(this); - - // Default processing provided by our superclass - super.setContainer(container); - - // Register with the new Container (if any) - if ((this.container != null) && (this.container instanceof Context)) { - setMaxInactiveInterval - ( ((Context) this.container).getSessionTimeout()*60 ); - ((Context) this.container).addPropertyChangeListener(this); - } - - } - - - /** * Return descriptive information about this Manager implementation and * the corresponding version number, in the format * <description>/<version>. diff --git a/java/org/apache/catalina/session/StandardManager.java b/java/org/apache/catalina/session/StandardManager.java index 567dfb745..b479e7f6e 100644 --- a/java/org/apache/catalina/session/StandardManager.java +++ b/java/org/apache/catalina/session/StandardManager.java @@ -18,7 +18,6 @@ package org.apache.catalina.session; -import java.beans.PropertyChangeEvent; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; @@ -34,7 +33,6 @@ import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Iterator; import javax.servlet.ServletContext; -import org.apache.catalina.Container; import org.apache.catalina.Context; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleState; @@ -125,33 +123,6 @@ public class StandardManager extends ManagerBase { /** - * Set the Container with which this Manager has been associated. If - * it is a Context (the usual case), listen for changes to the session - * timeout property. - * - * @param container The associated Container - */ - @Override - public void setContainer(Container container) { - - // De-register from the old Container (if any) - if ((this.container != null) && (this.container instanceof Context)) - ((Context) this.container).removePropertyChangeListener(this); - - // Default processing provided by our superclass - super.setContainer(container); - - // Register with the new Container (if any) - if ((this.container != null) && (this.container instanceof Context)) { - setMaxInactiveInterval - ( ((Context) this.container).getSessionTimeout()*60 ); - ((Context) this.container).addPropertyChangeListener(this); - } - - } - - - /** * Return descriptive information about this Manager implementation and * the corresponding version number, in the format * <description>/<version>.