users@glassfish.java.net

How can you associate a thread pool with an embedded resource adapter?

From: <glassfish_at_javadesktop.org>
Date: Wed, 24 Sep 2008 15:39:04 PDT

I have created a thread pool with the command:
[i]
create-threadpool --maxthreadpoolsize 100 --minthreadpoolsize 0 --idletimeout 2 --workqueues 1 xyzzy
[/i]

My application is packaged as 'csem.ear" and it's name is "csem". Embedded within is "csem-pmra.rar" which is a resource adapter and its name is "csem-pmra".

I have tried to associate the above thread pool with this resource adapter by using the following command:

[i]
create-resource-adapter-config --threadpools xyzzy csem#csem-pmra
[/i]

Both commands work okay but I don't think the "xyzzy" thread pool is associated with the "csem-pmra" resource adapter. This resource adapter uses the WorkManager and WorkItem API calls to perform work on each message that it processes.

If I use the command:

[i]
monitor --type threadpool server
[/i]

I get back the message:

[i]
There are more than one monitoring elements.
Please consider using the filter option.
The following are available elements to monitor:
    orb.threadpool.thread-pool-1
    orb.threadpool.xyzzy
[/i]

Note that the thread pool seems to be associated with "orb"?

Also if I monitor this thread pool with the command:

[i]
monitor --type threadpool --filter orb.threadpool.xyzzy server
[/i]

I get:

[i]
                           ThreadPool Monitoring: orb.threadpool.xyzzy
AvgTimeInQueue AvgWorkCompTime CurrNumOfThreads
low hi cur low hi cur min max low hi cur avl busy add
0 0 0 0 0 0 0 9223372036854775807 0 0 0 0 0 0
0 0 0 0 0 0 0 9223372036854775807 0 0 0 0 0 0
0 0 0 0 0 0 0 9223372036854775807 0 0 0 0 0 0
0 0 0 0 0 0 0 9223372036854775807 0 0 0 0 0 0
0 0 0 0 0 0 0 9223372036854775807 0 0 0 0 0 0
[/i]

So it appears that this thread pool is not being utilized.

So is this a bug or am I doing something wrong?
[Message sent by forum member 'bbergquist' (bbergquist)]

http://forums.java.net/jive/thread.jspa?messageID=301396