Inspired by a recent javadoc fix commit r1723681. /** - * Support for "stateManageable" JSR77 + * @return support for "stateManageable" JSR77 */ public boolean isStateManageable() { return true; /** - * JSR 77. Always return false. + * @return JSR 77. Always return <code>false</code>. */ public boolean isStateManageable() { return false; } The above methods are implemented by StandardContext and StandardWrapper respectively. JSR77: https://jcp.org/en/jsr/detail?id=77 I have not read JSR77 in detail, just a quick review. reviewed ch.77.5 State Management A StateManageable object is defined as implementing the following properties: state: int startTime: long methods: start() startRecursive() stop() and sending events when a state changes. The state is defined as 5 states coded by integer values, 0 STARTING 1 RUNNING 2 STOPPING 3 STOPPED 4 FAILED Actual implementation in Tomcat: StandardWrapper: - Tomcat 6 ======================== public boolean isEventProvider() { return false; } public boolean isStateManageable() { return false; } public boolean isStatisticsProvider() { return false; } The "eventProvider", "stateManageable", "statisticsProvider" properties exposed to JMX. The methods start(), stop() are implemented, but are our internal methods -- they are not exposed to JMX. There is no implementation of getState(), getStartTime(), startRecursive(). StandardWrapper - Tomcat 7 ======= The "eventProvider", "stateManageable", "statisticsProvider" properties exposed to JMX. Methods isEventProvider(), isStatisticsProvider() are declared as deprecated. StandardWrapper - Tomcat 8, 9 ======= "stateManageable" is exposed to JMX. Methods isEventProvider(), isStatisticsProvider() and their JMX properties removed. StandardContext - Tomcat 6 ============ StandardContext implements all the above properties / methods, although "startRecursive" is not exposed to JMX. [[[ public int getState() { if( started ) { return 1; // RUNNING } if( initialized ) { return 0; // starting ? } if( ! available ) { return 4; //FAILED } // 2 - STOPPING return 3; // STOPPED } ]]] StandardContext - Tomcat 7 ============ Lifecycle was redefined, the getState() method is defined in Lifecycle interface and now returns a LifecycleState The "state" property is no longer exposed to JMX. startRecursive(), isEventProvider(), isStatisticsProvider() methods deprecated. StandardContext - Tomcat 7/9 ============ isStateManageable()/start()/stop()/getStartTime() are OK. Deprecated methods are removed.
Thoughts ========= 1. It may still be possible to support that StateManageable "interface" -- I think with a custom MBean modeler object that will provide that "state" property, -- but I do not see much point. Nobody complained since removal of "state" property in Tomcat 7. 2. isStateManageable() can be safely removed from StandardWrapper. The wrapper did not expose its start/stop methods via JMX, nor the "state" property. 3. isStateManageable() in StandardContext I think it is OK to keep it, but update a comment to say that we do not really implement JSR 77.
My initial reaction was to say fix the JSR77 implementation. However, having seen that this was broken back in Tomcat 7 and that no-one has complained, my preference would be to mark anything JSR77 related deprecated in 8.0.x and remove it entirely in 9.0.x.
The remains of the JSR-77 implementation have been removed from 9.0.x.
And deprecated in 8.0.x for 8.0.32 onwards.