admin@glassfish.java.net

Fwd: ConfigSupport.createAndSet on List<>?

From: Lloyd Chambers <lloyd.chambers_at_mac.com>
Date: Thu, 27 Mar 2008 09:42:18 -0700

"Is creating/deleting a jdbc connection pool supported using AMX? "

No all resources are still a problem with no clear solution yet; the
<resources> element is generic at the ConfigBean level, so AMX has no
way to find out what can be created. Jerome and I hope to come up
with a solution soon.

Lloyd

On Mar 24, 2008, at 8:33 PM, Lloyd L Chambers wrote:

> Jerome,
>
> To create some types of items I can call
> ConfigSupport.createAndSet(...). These are items that are contained
> directly in another element.
>
> But what if it's a Resource or similar item contained within a
> "wrapper" element such as <resources> or <applications>, etc?
> Effectively I have to get the Resources ConfigBean, figure out that
> it can create a Resource, and then try to create the type I want.
>
> Can I do this and expect it to work?
>
> final ConfigBean resourcesConfigBean = ...;
> ConfigSupport.createAndSet( resourcesConfigBean,
> JdbcConnectionPool.class, attrs);
>
> The Resources interfaces makes a *generic* list, which is a bit
> "interesting", it means that I cannot deduce the right kind of item
> to create; somehow I need to find all interfaces extending
> "Resource" and find the right one based on the j2eeType in its
> annotation. I don't know how to do that.
>
> public interface Resources extends ConfigBeanProxy, Injectable {
> public List<Resource> getResources();
> }
>
>
> This is a bit of a hassle...
ouch, yep this is not pretty.

let me think about it but I don't think I have a miracle solution.

jerome

>
>
> ---
> Lloyd L Chambers
> lloyd.chambers_at_sun.com
> Sun Microsystems, Inc
>
>
>


---
Lloyd L Chambers
lloyd.chambers_at_sun.com
Sun Microsystems, Inc