users@jersey.java.net

[Jersey] Thread Monitoring In Jersey with SimpleFramework

From: Steve Curtis <stevo.curtis_at_googlemail.com>
Date: Thu, 17 Sep 2015 18:38:24 +0100

Hi all,

I'm using the Jersey framework in my application, backed by SimpleFramework
(http://www.simpleframework.org/). This is the Maven dependency I'm using
to include both:





* <dependency> <groupId>org.glassfish.jersey.containers</groupId>
   <artifactId>jersey-container-simple-http</artifactId>
<version>2.21</version> </dependency>*

The code I'm using to set up the listener is quite straightforward as well:











* public void listenAsynchronously() throws IOException { try
{ Container container = new
SimpleContainerProvider().createContainer(Container.class, new
ApplicationHandler(config));
registerLastBeforeHandler(container); socketConnection = new
SocketConnection(new ContainerServer(this, threadCount));
InetSocketAddress socketAddress = (InetSocketAddress)
socketConnection.connect(new InetSocketAddress(port)); this.port
= socketAddress.getPort(); } catch (BindException e) {
throw new RuntimeException(e); } }*

What I'm interested in finding out is what is the best way to monitor the
server thread pool usage given that both Jersey and Simple hide the thread
pools and don't make them available through their apis.

Thanks in advance,

Steve