Made session createTime accessible for all SessionManager via JMX - Backport from...
authorpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 9 Sep 2007 09:04:27 +0000 (09:04 +0000)
committerpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 9 Sep 2007 09:04:27 +0000 (09:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@573964 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/ha/session/mbeans-descriptors.xml
java/org/apache/catalina/session/ManagerBase.java
java/org/apache/catalina/session/mbeans-descriptors.xml
webapps/docs/changelog.xml

index 59434fe..ee59096 100644 (file)
@@ -334,6 +334,14 @@ created by this Manager"
         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"
+          description="Id of the session"
+                 type="java.lang.String"/>
+    </operation>
     <operation
       name="expireAllLocalSessions"
       description="Exipre all active local sessions and replicate the invalid sessions"
@@ -562,5 +570,14 @@ created by this Manager"
         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"
+          description="Id of the session"
+                 type="java.lang.String"/>
+    </operation>
+    
   </mbean>
 </mbeans-descriptors>
index 7ec2fa6..9f3c131 100644 (file)
@@ -1207,12 +1207,22 @@ public abstract class ManagerBase implements Manager, MBeanRegistration {
     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;
index 8baef3b..2d0692f 100644 (file)
                  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"
                  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>
 
 </mbeans-descriptors>
index e77fe4b..3791116 100644 (file)
         Takayuki Kaneko. (markt)
       </fix>
       <fix>
-         <bug>43216</bug>: Set correct StandardSession#accessCount as StandardSession.ACTIVITY_CHECK is true.
-          Patch provided by Takayuki Kaneko (pero)
+        <bug>43216</bug>: Set correct StandardSession#accessCount as StandardSession.ACTIVITY_CHECK is true.
+        Patch provided by Takayuki Kaneko (pero)
       </fix>
+      <add>
+        Made session createTime accessible for all SessionManager via JMX (pero)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Coyote">