Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64B8D6D72 for ; Thu, 30 Jun 2011 08:40:35 +0000 (UTC) Received: (qmail 75636 invoked by uid 500); 30 Jun 2011 08:40:31 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 75292 invoked by uid 500); 30 Jun 2011 08:40:20 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 75264 invoked by uid 99); 30 Jun 2011 08:40:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2011 08:40:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2011 08:40:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 107242388900 for ; Thu, 30 Jun 2011 08:39:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1141441 - in /tomcat/trunk: java/org/apache/catalina/ha/session/DeltaManager.java java/org/apache/catalina/ha/session/mbeans-descriptors.xml webapps/docs/changelog.xml webapps/docs/config/cluster-manager.xml Date: Thu, 30 Jun 2011 08:39:53 -0000 To: dev@tomcat.apache.org From: kfujino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110630083954.107242388900@eris.apache.org> Author: kfujino Date: Thu Jun 30 08:39:53 2011 New Revision: 1141441 URL: http://svn.apache.org/viewvc?rev=1141441&view=rev Log: The change in session ID is notified to the container event listener. Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java tomcat/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml tomcat/trunk/webapps/docs/changelog.xml tomcat/trunk/webapps/docs/config/cluster-manager.xml Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java?rev=1141441&r1=1141440&r2=1141441&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java Thu Jun 30 08:39:53 2011 @@ -97,6 +97,7 @@ public class DeltaManager extends Cluste private boolean expireSessionsOnShutdown = false; private boolean notifyListenersOnReplication = true; private boolean notifySessionListenersOnReplication = true; + private boolean notifyContainerListenersOnReplication = true; private volatile boolean stateTransfered = false ; private int stateTransferTimeout = 60; private boolean sendAllSessions = true; @@ -420,9 +421,17 @@ public class DeltaManager extends Cluste this.notifyListenersOnReplication = notifyListenersOnReplication; } + public boolean isNotifyContainerListenersOnReplication() { + return notifyContainerListenersOnReplication; + } + + public void setNotifyContainerListenersOnReplication( + boolean notifyContainerListenersOnReplication) { + this.notifyContainerListenersOnReplication = notifyContainerListenersOnReplication; + } - @Override -public CatalinaCluster getCluster() { + @Override + public CatalinaCluster getCluster() { return cluster; } @@ -1463,7 +1472,11 @@ public CatalinaCluster getCluster() { if (session != null) { String newSessionID = deserializeSessionId(msg.getSession()); session.setPrimarySession(false); - session.setId(newSessionID, notifySessionListenersOnReplication); + session.setId(newSessionID, false); + if (notifyContainerListenersOnReplication) { + getContainer().fireContainerEvent(Context.CHANGE_SESSION_ID_EVENT, + new String[] {msg.getSessionID(), newSessionID}); + } } } @@ -1494,6 +1507,7 @@ public CatalinaCluster getCluster() { result.expireSessionsOnShutdown = expireSessionsOnShutdown; result.notifyListenersOnReplication = notifyListenersOnReplication; result.notifySessionListenersOnReplication = notifySessionListenersOnReplication; + result.notifyContainerListenersOnReplication = notifyContainerListenersOnReplication; result.stateTransferTimeout = stateTransferTimeout; result.sendAllSessions = sendAllSessions; result.sendAllSessionsSize = sendAllSessionsSize; Modified: tomcat/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml?rev=1141441&r1=1141440&r2=1141441&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml (original) +++ tomcat/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml Thu Jun 30 08:39:53 2011 @@ -249,6 +249,11 @@ description="Send session start/stop events on backup nodes" type="boolean"/> + Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1141441&r1=1141440&r2=1141441&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Thu Jun 30 08:39:53 2011 @@ -238,6 +238,12 @@ should be controlled by notifySessionListenersOnReplication rather than notifyListenersOnReplication. (markt) + + The change in session ID is notified to the container event listener on + the backup node in cluster. + This notification is controlled by + notifyContainerListenersOnReplication.(kfujino) + Modified: tomcat/trunk/webapps/docs/config/cluster-manager.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/cluster-manager.xml?rev=1141441&r1=1141440&r2=1141441&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/config/cluster-manager.xml (original) +++ tomcat/trunk/webapps/docs/config/cluster-manager.xml Thu Jun 30 08:39:53 2011 @@ -105,6 +105,10 @@ when sessions are created and expired across Tomcat nodes in the cluster. + + Set to true if you wish to have container listeners notified + across Tomcat nodes in the cluster. + The time in seconds to wait for a session state transfer to complete from another node when a node is starting up. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org