On 10 May 2012 08:50,  <rj...@apache.org> wrote:
> Author: rjung
> Date: Thu May 10 07:50:29 2012
> New Revision: 1336516
>
> URL: http://svn.apache.org/viewvc?rev=1336516&view=rev
> Log:
> Add public method to retrieve the current connectionCount
> from an endpoint.
>
> It will also show up in the ThreadPool MBean.
>
> Backport of r1336515 from trunk.
>
> Modified:
>    tomcat/tc7.0.x/trunk/   (props changed)
>    tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
>    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>
> Propchange: tomcat/tc7.0.x/trunk/
> ------------------------------------------------------------------------------
>  Merged /tomcat/trunk:r1336515
>
> Modified: 
> tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1336516&r1=1336515&r2=1336516&view=diff
> ==============================================================================
> --- 
> tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
> (original)
> +++ 
> tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
> Thu May 10 07:50:29 2012
> @@ -173,6 +173,14 @@ public abstract class AbstractEndpoint {
>     }
>
>     public int  getMaxConnections() { return this.maxConnections; }
> +

Javadoc?
In particular, it would help if the condition under which -1 is
returned were documented. ...

> +    public long getConnectionCount() {
> +        if (connectionLimitLatch != null) {
> +            return connectionLimitLatch.getCount();
> +        }
> +        return -1;
> +    }
> +
>     /**
>      * External Executor based thread pool.
>      */
>
> Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
> URL: 
> http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1336516&r1=1336515&r2=1336516&view=diff
> ==============================================================================
> --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
> +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu May 10 07:50:29 2012
> @@ -121,6 +121,11 @@
>         The new default value will never go above 2 regardless of
>         available processors. (fhanik)
>       </update>
> +      <add>
> +        Allow to retrieve the current <code>connectionCount</code>
> +        via getter from the endpoint and as JMX attribute of the ThreadPool
> +        mbean. (rjung)
> +      </add>
>     </changelog>
>   </subsection>
>   <subsection name="Cluster">
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

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

Reply via email to