Author: pero
Date: Sun Sep  9 01:41:35 2007
New Revision: 573959

URL: http://svn.apache.org/viewvc?rev=573959&view=rev
Log:
 Made session createTime accessible for all SessionManager via JMX 

Modified:
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/mbeans-descriptors.xml
    
tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/mbeans-descriptors.xml
    tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java?rev=573959&r1=573958&r2=573959&view=diff
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java
 Sun Sep  9 01:41:35 2007
@@ -1218,12 +1218,22 @@
     public String getLastAccessedTime( String sessionId ) {
         Session s=(Session)sessions.get(sessionId);
         if( s==null ) {
-            log.info("Session not found " + sessionId);
+            if(log.isInfoEnabled())
+                log.info("Session not found " + sessionId);
             return "";
         }
         return new Date(s.getLastAccessedTime()).toString();
     }
 
+    public String getCreationTime( String sessionId ) {
+        Session s=(Session)sessions.get(sessionId);
+        if( s==null ) {
+            if(log.isInfoEnabled())
+                log.info("Session not found " + sessionId);
+            return "";
+        }
+        return new Date(s.getCreationTime()).toString();
+    }
 
     // -------------------- JMX and Registration  --------------------
     protected String domain;

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/mbeans-descriptors.xml
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/mbeans-descriptors.xml?rev=573959&r1=573958&r2=573959&view=diff
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/mbeans-descriptors.xml
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/mbeans-descriptors.xml
 Sun Sep  9 01:41:35 2007
@@ -160,6 +160,15 @@
                  type="java.lang.String"/>
     </operation>
 
+    <operation   name="getCreationTime"
+          description="Get the creation time"
+               impact="ACTION"
+           returnType="java.lang.String">
+      <parameter name="sessionId"
+          description="Id of the session"
+                 type="java.lang.String"/>
+    </operation>
+
   </mbean>
 
   <mbean         name="PersistentManager"
@@ -305,6 +314,15 @@
 
     <operation   name="getLastAccessedTime"
           description="Get the last access time"
+               impact="ACTION"
+           returnType="java.lang.String">
+      <parameter name="sessionId"
+          description="Id of the session"
+                 type="java.lang.String"/>
+    </operation>
+
+    <operation   name="getCreationTime"
+          description="Get the creation time"
                impact="ACTION"
            returnType="java.lang.String">
       <parameter name="sessionId"

Modified: 
tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/mbeans-descriptors.xml
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/mbeans-descriptors.xml?rev=573959&r1=573958&r2=573959&view=diff
==============================================================================
--- 
tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/mbeans-descriptors.xml
 (original)
+++ 
tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/mbeans-descriptors.xml
 Sun Sep  9 01:41:35 2007
@@ -19,41 +19,85 @@
    "-//Apache Software Foundation//DTD Model MBeans Configuration File"
    "http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd";>
 <mbeans-descriptors>
+    
     <mbean name="JvmRouteBinderValve" description="mod_jk jvmRoute jsessionid 
cookie backup correction" domain="Catalina"
         group="Valve" 
type="org.apache.catalina.cluster.session.JvmRouteBinderValve">
+      
         <attribute name="className"
                description="Fully qualified class name of the managed object"
                type="java.lang.String"
                writeable="false"/>        
+      
         <attribute name="info" 
                           description="describe version" 
type="java.lang.String" writeable="false"/>
+      
         <attribute name="enabled" 
                           description="enable a jvm Route check" 
type="boolean"/>
+      
         <attribute name="numberOfSessions"
                           description="number of jvmRoute session corrections" 
type="long" writeable="false"/>
+      
         <attribute name="sessionIdAttribute" 
-                   description="Name of attribute with sessionid value before 
turnover a session" 
+                   description="Name of request attribute with sessionid value 
before turnover a session" 
                    type="java.lang.String" 
                    />
+      
         <operation name="start" description="Stops the Cluster 
JvmRouteBinderValve" 
                           impact="ACTION" returnType="void"/>
+      
         <operation name="stop" description="Stops the Cluster 
JvmRouteBinderValve" 
                           impact="ACTION" returnType="void"/>
     </mbean>
+    
+    <mbean name="JvmRouteMigrationValve" description="migrate session to other 
cluster nodes" domain="Catalina"
+        group="Valve" 
type="org.apache.catalina.cluster.session.JvmRouteMigrationValve">
+        <attribute name="className"
+               description="Fully qualified class name of the managed object"
+               type="java.lang.String"
+               writeable="false"/>        
+      
+        <attribute name="info" 
+                          description="describe version" 
type="java.lang.String" writeable="false"/>
+      
+        <attribute name="enabled" 
+                          description="enable migration" type="boolean"/>
+      
+        <attribute name="jvmRoutes" 
+                   description="comma-delimited set of the jvmRoutes for 
migration nodes" 
+                   type="java.lang.String" 
+                   />
+      
+        <attribute name="numberOfSessions"
+                          description="number of migrated sessions" 
type="long" writeable="false"/>
+      
+        <attribute name="sessionIdAttribute" 
+                   description="Name of request attribute with sessionid value 
before migrate a session" 
+                   type="java.lang.String" 
+                   />
+      
+        <operation name="start" description="Stops the Cluster 
JvmRouteMigrationValve" 
+                          impact="ACTION" returnType="void"/>
+      
+        <operation name="stop" description="Stops the Cluster 
JvmRouteMigrationValve" 
+                          impact="ACTION" returnType="void"/>
+    </mbean>
+    
        <mbean name="JvmRouteSessionIDBinderListener"
                description="Monitors the jvmRoute activity"
                domain="Catalina"
         group="Listener"
                
type="org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListener">
+      
         <attribute name="info" 
                           description="describe version" 
type="java.lang.String" writeable="false"/>
+      
         <attribute name="numberOfSessions" 
                    description="number of jvmRoute session corrections" 
                    type="long" 
                    writeable="false"/>
     </mbean>
     
-   <mbean        name="DeltaManager"
+    <mbean        name="DeltaManager"
           description="Cluster Manager implementation of the Manager interface"
                domain="Catalina"
                 group="Manager"
@@ -318,6 +362,15 @@
 
     <operation   name="getLastAccessedTime"
           description="Get the last access time"
+               impact="ACTION"
+           returnType="java.lang.String">
+      <parameter name="sessionId"
+          description="Id of the session"
+                 type="java.lang.String"/>
+    </operation>
+    
+    <operation   name="getCreationTime"
+          description="Get the creation time"
                impact="ACTION"
            returnType="java.lang.String">
       <parameter name="sessionId"

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=573959&r1=573958&r2=573959&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Sun Sep  9 01:41:35 2007
@@ -42,6 +42,9 @@
         <bug>43216</bug>: Set correct StandardSession#accessCount as system 
property STRICT_SERVLET_COMPLIANCE is true after application restart with 
SESSION.ser file.
         Patch provided by Takayuki Kaneko (pero)
       </fix>
+      <add>
+        Made session createTime accessible for all SessionManager via JMX 
(pero)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Cluster">



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to