dev@glassfish.java.net

Q: Getting hold of all PoolInfo objects for JCA connector connection pools deployed in GF v3?

From: Andreas Loew <Andreas.Loew_at_oracle.com>
Date: Thu, 27 Sep 2012 00:10:05 +0200

Hi Glassfish dev team,

for a custom Glassfish-specific proprietary JCA resource adapter
implementation, I am looking for a way to get access to a list/set of
all connector connection pools deployed into the current GF instance.

In Glassfish versions prior to 3.x, I could simply do:

PoolManagerImpl pm = ConnectorRuntime.getRuntime().getPoolManager();
Set poolNames = pm.getPoolTable().keySet();

and receive a Set of Strings representing the pool names. The method

public Hashtable getPoolTable()

in class PoolManagerImpl was declared public.

I have just stumbled over the fact that I can no longer do this in
Glassfish v3.x... :-(

I am fine with the need to switch from Strings representing the pools to
instances of the PoolInfo class, but it looks like method

private ConcurrentHashMap<PoolInfo, ResourcePool> getPoolTable()

in PoolManagerImpl is now private (not even protected), which is a real
pity. Is there any other way to have some other public method return a
Set of all PoolInfo instances?

The only workaround I am aware of so far consists in providing my code
the Security permissions to call setAccessible(true) on the above method
getPoolTable(), which is really a very ugly way to achieve what I need...

Thanks a million in advance for your help!

Best regards,

Andreas

-- 
Andreas Loew
Senior Java Architect
ACS Principal Service Delivery Engineer
ORACLE Germany