geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiram Chirino <>
Subject New factory attribute for gbean elements.
Date Fri, 29 Oct 2004 16:41:23 GMT
Hi All,

All our current GBeans must provide a static getGBeanInfo() method which 
acts like a factory for GBeanInfo objects.  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.

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" 
        <attribute name="port" type="int">1099</attribute>

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;


View raw message