users@grizzly.java.net

Re: Retrieving Reference to ExecutorService (Worker Thread Pool)

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Wed, 04 Apr 2012 16:39:12 +0200

Hi Brian,

in general the answer is yes, Grizzly uses ExecutorService and it's
possible to retrieve it during runtime.
If you have access to Grizzly Transport - then simply do:

ExecutorService executorService = transport.getWorkerThreadPool();

If you use HttpServer API - then you can retrieve it during runtime via
NetworkListener like:

httpServer.getListener("name").getTransport().getWorkerThreadPool();


Thanks.

WBR,
Alexey.

On 04/04/2012 04:29 PM, bdicasa_at_gmail.com wrote:
> Hello,
>
> I'm looking into using some of Amazon Web Services Asynchronous API's
> which can take in an ExecutorService that executes the events.
>
> I was wondering if grizzly uses an ExecutorService for its Worker
> thread pool, and if it is possible to get a reference to it so I can
> pass it to the Amazon Web Services API.
>
> Thanks,
>
> Brian