admin@glassfish.java.net

Re: how can AMX access _at_Configured classes?

From: Byron Nevins <Byron.Nevins_at_Sun.COM>
Date: Fri, 14 Mar 2008 18:31:28 -0700

It looks like the problem is right here:

    public String getTurkeySlaughterDate();
    public void setTurkeySlaughterDate( String d );

You can't have getTurkeySlaughterDate() -- it's a chicken farm!

 

Lloyd L Chambers wrote:
> Jerome et al,
>
> Suppose I define a new module "chicken-farm" that uses configuration
> like this:
>
> // internal interface describing the injected configuration
> @AMXConfigInfo( amxInterface=com.farming.AMXChickenFarmConfig.class )
> @Configured
> public interface ChickenFarm extends ConfigBeanProxy, Injectable {
> @Attribute // why do I have to annotate this anyway?
> public String getEggsToLayPerDay();
> public void setEggsToLayPerDay( String num );
>
> @Attribute // why do I have to annotate this anyway?
> public String getTurkeySlaughterDate();
> public void setTurkeySlaughterDate( String d );
> }
>
> // interface for use by AMX clients
> public interface AMXChickenFarmConfig extends AMXConfig {
> public String getEggsToLayPerDay();
> public void setEggsToLayPerDay( String num );
>
> public String getTurkeySlaughterDate();
> public void setTurkeySlaughterDate( String d );
> }
>
> COMMENTS/QUESTIONS
>
> 1. COMMENT: Notice the undesirable duplication. Perhaps a base
> interface could be used to factor it out, or AMXChickenFarmConfig
> could extend ChickenFarm (But AMX doesn't need or want the
> @Configured, @Element, or @Attribute annotations that HK2 uses, nor do
> AMX clients want them, or want to have dependencies on HK2!). So
> maybe this is just life. Or maybe it is AMX that should be defining
> these annotations, and AMX should be a standalone jar used by HK2.
>
> 2. PROBLEM? Now the ConfigBean for 'ChickenFarm' is registered in the
> Habitat. Soon, AMX comes along and wants to register an MBean
> supporting AMXChickenFarmConfig corresponding to that ConfigBean.
>
> Since the amx-impl module doesn't depend on this new module, won't the
> classloader just throw a ClassNotFoundException for these classes?
>
>
> Lloyd
> ---
> Lloyd L Chambers
> lloyd.chambers_at_sun.com
> Sun Microsystems, Inc
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>

-- 
Byron Nevins Work 408-276-4089, Home 650-359-1290, Cell 650-784-4123 - Sun Microsystems, Inc.