geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <dsundst...@gluecode.com>
Subject Re: New factory attribute for gbean elements.
Date Fri, 29 Oct 2004 16:52:18 GMT
On Oct 29, 2004, at 9:41 AM, Hiram Chirino wrote:

> Hi All,
>
> All our current GBeans must provide a static getGBeanInfo() method 
> which acts like a factory for GBeanInfo objects.

This is not a requirement, but just what everyone does.

> I would like to propose that we relax this requirement of a GBean by 
> allowing an separate factory class to create the GBeanInfo object for 
> the GBean.  The net effect of this is that:
> - It would allow you to implement GBean objects with zero dependencies 
> on Geronimo. - You could implement a smart factory that only uses 
> reflection to on pojos to generate the GBeanInfo object.
> - You could implement a factory that uses an XML config file to 
> generate the GBeanInfo factory.

+1

> The deployment plans would have to support an optional factory 
> attribute for gbeans.  So you could have a gbean configuration that 
> looks something like:
>
>    <gbean name="Geronimo.server:role=RMIRegistry" 
> class="org.apache.Geronimo.system.rmi.RMIRegistryService" 
> factory="org.apache.Geronimo.gbean.PojoGBeanInfoFactory">
>        <attribute name="port" type="int">1099</attribute>
>    </gbean>

+1 (except of the lame Pojo name :)

> We would also need to define an interface that the Factory object 
> implement.  Idealy, the name of that interface would have been 
> org.apache.Geronimo.gbean.GBeanInfoFactory, but that is currently 
> being used by a class the behaves more like a Builder.  So I propose 
> that we rename the current org.apache.Geronimo.gbean.GBeanInfoFactory 
> to org.apache.Geronimo.gbean.GBeanInfoBuilder so that we can define 
> the following interface class:
>
> public interface GBeanInfoFactory {
>    public GBeanInfo getGBeanInfo(String className, ClassLoader 
> classLoader) throws InvalidConfigurationException;
> }

I don't think the string must be a class name... could be a file name 
or uri or whatever....

-dain


Mime
View raw message