geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianny Damour <>
Subject Re: Heads-up - GBeanInfo via annotations
Date Mon, 31 Mar 2008 12:37:19 GMT

Sorry for starting another thread (I deleted the initial thread and  
had to start another one).

> From: Jason Dillon <>
> Looks cool. Only question I have is why the "G" prefix on  
> annotations other than GBean?

I will drop the "G" prefix on annotations other than GBean; it is  
indeed better.

> From: David Jencks <>
> I have a couple of suggestions and questions.....
> 1. I think we should try harder to separate the identification of a  
> constructor parameter as attribute or reference from identifying  
> its name.  So, I think we should use the java6 and xbean  
> @ParameterName annotations for names and something else for  
> references if necessary.

It seems to me that xbean only defines a @ParameterNames annotation,  
which I think is quite efficient only when the number of parameters  
is small. The need of a @ParameterName annotation, targeting a  
parameter and not a constructor or method, really emerges when the  
number of parameters increases.

If you want, I can add a @ParameterName annotation to xbean-reflect  
instead of adding it to geronimo-kernel.

> 2. I'm pretty sure identifying something as an attribute isn't  
> necessary.

I partially agree: out-of-the-box attributes are added based on the  
getters and setters of the GBean class. These attributes are defined  
as non-persistent and non-manageable. It should be possible to turn  
them persistent and manageable via an annotation. This is the purpose  
of @Attribute which looks like this:

@Retention(value = RUNTIME)
@Target(value = {METHOD})
public @interface Attribute {
     boolean manageable() default true;

It now appears to me that @Attribute is poorly chosen and that  
@Persistent may be more appropriate.

> 3. I think we should think long and hard if we really need to  
> identify references specifically.  Can we get by with deciding how  
> to treat them based on what is in the plan?

Based on the GBeanData passed in to GBeanInstance, we can tell if an  
attribute should be set to a GBeanReference or a simple value. What  
does not seem possible is a way to derive the j2eeType of the target  
of a GBeanReference as there is no reliable way of retrieving the  
GBeanInfo of a class. Without such a reliable mechanism, I am not  
sure how to remove the explicit configuration of references having a  
specific j2eeType.

> 4. Can the GBean annotation be optional?  I hope so :-) (e.g.  
> default j2eeType=GBean, default name = class name)

It is now optional :)

> While you are looking at this..... I think we may want to move  
> towards considering the basic unit of geronimo assembly as the  
> module/plugin rather than the gbean.  This may have repercussions  
> on some things the admin console can do that add or remove gbeans  
> from a module, but I've always looked at those actions rather  
> sceptically.  Doing both changes at once may be too big a jump but  
> IMO if you see a way to progress more quickly by moving towards  
> this additional goal I'd support it.

Could you please explain a little bit more as I do not understand  
what you have in mind?

Thanks for the feedback!

View raw message