admin@glassfish.java.net

Re: how can amx-impl load an interface from a module?

From: Sahoo <Sahoo_at_Sun.COM>
Date: Fri, 27 Jun 2008 02:55:21 +0530

Lloyd L Chambers wrote:
> Jerome and/or Sahoo,
>
> AMX currently supports the creation of config MBeans for @Configured
> interfaces like this:
>
> @AMXConfigInfo(
> amxInterfaceName="com.sun.appserv.management.config.HTTPListenerConfig",
> ...)
> @Configured
> public interface HttpListener extends ConfigBeanProxy, Injectable,
> PropertyBag {...}
>
> The @AMConfigInfo specifies that the formal interface for an MBean
> representing the @Configured HttpListener is to be found as
> com.sun.appserv.management.config.HTTPListenerConfig.
>
> So at runtime, the amx-impl module would need to be able to load the
> interface 'com.sun.appserv.management.config.HTTPListenerConfig'. Yet
> it cannot have any explicit dependency on the module,
Can you use Habitat API to locate the class? Is HTTPListenerConfig a
@Service?

Thanks,
Sahoo
> nor can it even know in advance how many module(s) might exist.
>
> ===> Essentially it needs Class.forName() functionality. What is the
> right way to load the interface class? Is it even possible?
>
> Lloyd
> ---
> Lloyd L Chambers
> lloyd.chambers_at_sun.com
> Sun Microsystems, Inc
>
>
>