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

Reply via email to