From: markt Date: Fri, 3 Sep 2010 09:48:46 +0000 (+0000) Subject: Expose current state of Lifecycle components via JMX beans (where a component has... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=537713ff3c221bc31363d8f667181718d0cd3f23;p=tomcat7.0 Expose current state of Lifecycle components via JMX beans (where a component has one). Mainly useful for monitoring web application status. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@992245 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/Lifecycle.java b/java/org/apache/catalina/Lifecycle.java index f58d28556..fe432e09b 100644 --- a/java/org/apache/catalina/Lifecycle.java +++ b/java/org/apache/catalina/Lifecycle.java @@ -287,4 +287,11 @@ public interface Lifecycle { * @return The current state of the source component. */ public LifecycleState getState(); + + + /** + * Obtain a textual representation of the current component state. Useful + * for JMX. + */ + public String getStateName(); } diff --git a/java/org/apache/catalina/authenticator/mbeans-descriptors.xml b/java/org/apache/catalina/authenticator/mbeans-descriptors.xml index 4db6b9d2f..ef2a9c539 100644 --- a/java/org/apache/catalina/authenticator/mbeans-descriptors.xml +++ b/java/org/apache/catalina/authenticator/mbeans-descriptors.xml @@ -23,7 +23,7 @@ group="Valve" type="org.apache.catalina.authenticator.BasicAuthenticator"> - @@ -31,7 +31,7 @@ description="Should we cache authenticated Principals if the request is part of an HTTP session?" type="boolean"/> - @@ -39,6 +39,10 @@ + + @@ -56,14 +60,18 @@ description="Should we cache authenticated Principals if the request is part of an HTTP session?" type="boolean"/> - - + + - - - - + + + + @@ -121,7 +137,7 @@ group="Valve" type="org.apache.catalina.authenticator.SingleSignOn"> - @@ -133,7 +149,10 @@ - + + @@ -159,6 +178,10 @@ + + diff --git a/java/org/apache/catalina/connector/mbeans-descriptors.xml b/java/org/apache/catalina/connector/mbeans-descriptors.xml index 0dbe579ef..e14960f48 100644 --- a/java/org/apache/catalina/connector/mbeans-descriptors.xml +++ b/java/org/apache/catalina/connector/mbeans-descriptors.xml @@ -145,6 +145,10 @@ description="Comma-separated list of SSL protocol variants to be enabled" type="java.lang.String"/> + + + + - + + + + - + + + + + + + + + + + + + - + + diff --git a/java/org/apache/catalina/ha/session/mbeans-descriptors.xml b/java/org/apache/catalina/ha/session/mbeans-descriptors.xml index 8c73b7e52..68c3816eb 100644 --- a/java/org/apache/catalina/ha/session/mbeans-descriptors.xml +++ b/java/org/apache/catalina/ha/session/mbeans-descriptors.xml @@ -50,6 +50,9 @@ name="sessionIdAttribute" description="Name of attribute with sessionid value before turnover a session" type="java.lang.String"/> + + + + + + + + + + + diff --git a/java/org/apache/catalina/realm/mbeans-descriptors.xml b/java/org/apache/catalina/realm/mbeans-descriptors.xml index ce4c6f295..19dfde945 100644 --- a/java/org/apache/catalina/realm/mbeans-descriptors.xml +++ b/java/org/apache/catalina/realm/mbeans-descriptors.xml @@ -57,6 +57,10 @@ description="The column in the user role table that names a role" type="java.lang.String"/> + + @@ -120,6 +124,10 @@ description="The realm path" type="java.lang.String"/> + + @@ -187,6 +195,10 @@ description="The realm path" type="java.lang.String"/> + + @@ -305,6 +317,10 @@ description="Should we search the entire subtree for matching memberships?" type="boolean"/> + + @@ -371,6 +387,10 @@ description="The realm path" type="java.lang.String"/> + + @@ -413,6 +433,10 @@ description="The realm path" type="java.lang.String"/> + + @@ -456,6 +480,10 @@ description="The realm path" type="java.lang.String"/> + + diff --git a/java/org/apache/catalina/session/mbeans-descriptors.xml b/java/org/apache/catalina/session/mbeans-descriptors.xml index 510fb1a25..464b54662 100644 --- a/java/org/apache/catalina/session/mbeans-descriptors.xml +++ b/java/org/apache/catalina/session/mbeans-descriptors.xml @@ -111,6 +111,10 @@ description="Longest time an expired session had been alive" type="int" /> + + @@ -306,6 +310,10 @@ description="Longest time an expired session had been alive" type="int" /> + + diff --git a/java/org/apache/catalina/util/LifecycleBase.java b/java/org/apache/catalina/util/LifecycleBase.java index 0d5ccabd7..b1850c63d 100644 --- a/java/org/apache/catalina/util/LifecycleBase.java +++ b/java/org/apache/catalina/util/LifecycleBase.java @@ -286,6 +286,15 @@ public abstract class LifecycleBase implements Lifecycle { /** + * {@inheritDoc} + */ + @Override + public String getStateName() { + return getState().toString(); + } + + + /** * Provides a mechanism for sub-classes to update the component state. * Calling this method will automatically fire any associated * {@link Lifecycle} event. diff --git a/java/org/apache/catalina/valves/mbeans-descriptors.xml b/java/org/apache/catalina/valves/mbeans-descriptors.xml index ea60cd7fd..bf8b3b540 100644 --- a/java/org/apache/catalina/valves/mbeans-descriptors.xml +++ b/java/org/apache/catalina/valves/mbeans-descriptors.xml @@ -86,6 +86,10 @@ is="true" type="boolean"/> + + @@ -125,6 +129,10 @@ type="java.lang.String" writeable="false"/> + + + + + + + + + +