You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Dain Sundstrom <da...@iq80.com> on 2005/12/02 02:12:55 UTC

Declare new GBean in config.xml

I just committed support to declare new GBeans in the config.xml  
file.  This facility is called by the console back end so new GBean  
added via the console now show up in the config.xml file.  The  
following snippit was created by adding a new http connector in the  
console:

   <configuration name="geronimo/jetty/1.0-SNAPSHOT/car">
     <gbean name="JettyWebConnector">
       <attribute name="host">0.0.0.0</attribute>
       <attribute name="port">8081</attribute>
       <attribute name="redirectPort">8443</attribute>
     </gbean>
     <gbean name="JettySSLConnector">
       <attribute name="host">0.0.0.0</attribute>
       <attribute name="port">8443</attribute>
     </gbean>
     <gbean  
name="geronimo.server:J2EEApplication=null,J2EEModule=geronimo/jetty/ 
1.0-SNAPSHOT/ 
car,J2EEServer=geronimo,j2eeType=GBean,name=JettyWebConnector-HTTP- 
cheese" gbeanInfo="org.apache.geronimo.jetty.connector.HTTPConnector">
       <attribute name="maxThreads">50</attribute>
       <attribute name="host">0.0.0.0</attribute>
       <attribute name="minThreads">10</attribute>
       <attribute name="port">8082</attribute>
       <reference name="JettyContainer">
           <pattern><gbean- 
name>geronimo.server:J2EEApplication=null,J2EEModule=geronimo/jetty/ 
1.0-SNAPSHOT/ 
car,J2EEServer=geronimo,j2eeType=GBean,name=JettyWebContainer</gbean- 
name></pattern>
       </reference>
     </gbean>
   </configuration>


The reference the new items are the gbeanInfo attribute on the gbean  
element, and the nested reference element in gbean.  The gbeanInfo  
attribute declares the class from which the gbean info can be  
retrieved.  The reference element declares the object name patterns  
for the GBean reference.  The XML for a reference is a bit ugly, but  
is a subset of the -plan.xml reference element.  The config.xml file  
only supports the shown reference format, but could be expanded to  
support the other formats that -plan.xml files support.

Also the reference override can be used on any GBean not just new  
GBeans, but I don't suggest people mess with references.

I have a few more changes to make in this area but it is fully  
functional right now, so please give it a test drive :)

-dain

Re: Declare new GBean in config.xml

Posted by Bruce Snyder <br...@gmail.com>.
On 12/1/05, Dain Sundstrom <da...@iq80.com> wrote:
> I just committed support to declare new GBeans in the config.xml
> file.  This facility is called by the console back end so new GBean
> added via the console now show up in the config.xml file.  The
> following snippit was created by adding a new http connector in the
> console:
>
>    <configuration name="geronimo/jetty/1.0-SNAPSHOT/car">
>      <gbean name="JettyWebConnector">
>        <attribute name="host">0.0.0.0</attribute>
>        <attribute name="port">8081</attribute>
>        <attribute name="redirectPort">8443</attribute>
>      </gbean>
>      <gbean name="JettySSLConnector">
>        <attribute name="host">0.0.0.0</attribute>
>        <attribute name="port">8443</attribute>
>      </gbean>
>      <gbean
> name="geronimo.server:J2EEApplication=null,J2EEModule=geronimo/jetty/
> 1.0-SNAPSHOT/
> car,J2EEServer=geronimo,j2eeType=GBean,name=JettyWebConnector-HTTP-
> cheese" gbeanInfo="org.apache.geronimo.jetty.connector.HTTPConnector">
>        <attribute name="maxThreads">50</attribute>
>        <attribute name="host">0.0.0.0</attribute>
>        <attribute name="minThreads">10</attribute>
>        <attribute name="port">8082</attribute>
>        <reference name="JettyContainer">
>            <pattern><gbean-
> name>geronimo.server:J2EEApplication=null,J2EEModule=geronimo/jetty/
> 1.0-SNAPSHOT/
> car,J2EEServer=geronimo,j2eeType=GBean,name=JettyWebContainer</gbean-
> name></pattern>
>        </reference>
>      </gbean>
>    </configuration>
>
>
> The reference the new items are the gbeanInfo attribute on the gbean
> element, and the nested reference element in gbean.  The gbeanInfo
> attribute declares the class from which the gbean info can be
> retrieved.  The reference element declares the object name patterns
> for the GBean reference.  The XML for a reference is a bit ugly, but
> is a subset of the -plan.xml reference element.  The config.xml file
> only supports the shown reference format, but could be expanded to
> support the other formats that -plan.xml files support.
>
> Also the reference override can be used on any GBean not just new
> GBeans, but I don't suggest people mess with references.
>
> I have a few more changes to make in this area but it is fully
> functional right now, so please give it a test drive :)

Very nice! I like it Dain. However, you are correct - the reference
element is rather verbose. Maybe we can find a way to shorten it.

Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

The Castor Project
http://www.castor.org/

Apache Geronimo
http://geronimo.apache.org/