tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r612971 - in /tomcat/trunk: 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
Date Thu, 17 Jan 2008 20:43:47 GMT
Author: pero
Date: Thu Jan 17 12:43:43 2008
New Revision: 612971

URL: http://svn.apache.org/viewvc?rev=612971&view=rev
Log:
Add getLastAccessedTimestamp and getCreationTimestamp for remote JMX Access.

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

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=612971&r1=612970&r2=612971&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 Jan 17 12:43:43
2008
@@ -342,6 +342,22 @@
         description="Id of the session"
         type="java.lang.String"/>
     </operation>
+    <operation   name="getLastAccessedTimestamp"
+          description="Get the last access timestamp"
+               impact="ACTION"
+           returnType="long">
+      <parameter name="sessionId"
+          description="Id of the session"
+                 type="java.lang.String"/>
+    </operation>
+    <operation   name="getCreationTimestamp"
+          description="Get the creation timestamp"
+               impact="ACTION"
+           returnType="long">
+      <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"

Modified: tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java?rev=612971&r1=612970&r2=612971&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java Thu Jan 17 12:43:43 2008
@@ -1203,7 +1203,13 @@
         s.expire();
     }
 
-
+    public long getLastAccessedTimestamp( String sessionId ) {
+        Session s=(Session)sessions.get(sessionId);
+        if(s== null)
+            return -1 ;
+        return s.getLastAccessedTime();
+    }
+  
     public String getLastAccessedTime( String sessionId ) {
         Session s=(Session)sessions.get(sessionId);
         if( s==null ) {
@@ -1222,6 +1228,13 @@
             return "";
         }
         return new Date(s.getCreationTime()).toString();
+    }
+
+    public long getCreationTimestamp( String sessionId ) {
+        Session s=(Session)sessions.get(sessionId);
+        if(s== null)
+            return -1 ;
+        return s.getCreationTime();
     }
 
     // -------------------- JMX and Registration  --------------------

Modified: tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml?rev=612971&r1=612970&r2=612971&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml (original)
+++ tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml Thu Jan 17 12:43:43
2008
@@ -160,6 +160,24 @@
                  type="java.lang.String"/>
     </operation>
 
+   <operation   name="getLastAccessedTimestamp"
+          description="Get the last access timestamp"
+               impact="ACTION"
+           returnType="long">
+      <parameter name="sessionId"
+          description="Id of the session"
+                 type="java.lang.String"/>
+    </operation>
+
+    <operation   name="getCreationTimestamp"
+          description="Get the creation timestamp"
+               impact="ACTION"
+           returnType="long">
+      <parameter name="sessionId"
+          description="Id of the session"
+                 type="java.lang.String"/>
+    </operation>
+
   </mbean>
 
   <mbean         name="PersistentManager"
@@ -316,6 +334,24 @@
           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="getLastAccessedTimestamp"
+          description="Get the last access timestamp"
+               impact="ACTION"
+           returnType="long">
+      <parameter name="sessionId"
+          description="Id of the session"
+                 type="java.lang.String"/>
+    </operation>
+
+    <operation   name="getCreationTimestamp"
+          description="Get the creation timestamp"
+               impact="ACTION"
+           returnType="long">
       <parameter name="sessionId"
           description="Id of the session"
                  type="java.lang.String"/>

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=612971&r1=612970&r2=612971&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jan 17 12:43:43 2008
@@ -46,6 +46,10 @@
   </subsection>
   <subsection name="Catalina">
     <changelog>
+      <add>
+        Add ManagerBase session getLastAccessedTimestamp and getCreationTimestamp for better
+        remote JMX access. (pero)
+      </add>
       <fix>
         Set correct StandardManager.sessionCounter after reload/restart. (pero)
       </fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message