You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2005/08/26 14:55:24 UTC

svn commit: r240228 - in /geronimo/trunk: applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/ modules/assembly/ modules/assembly/src/plan/ modules/assembly/src/var/config/ modules/connector-builder/src/java/org/apach...

Author: ammulder
Date: Fri Aug 26 05:55:00 2005
New Revision: 240228

URL: http://svn.apache.org/viewcvs?rev=240228&view=rev
Log:
Add manageable attributes
Add a manageable attribute store to track the values for manageable
  attributes
Add a default config file with values for manageable attributes
  (modules/assembly/src/var/config.xml)

Added:
    geronimo/trunk/modules/assembly/src/var/config/config.xml   (with props)
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java   (with props)
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java   (with props)
    geronimo/trunk/modules/system/src/schema/
    geronimo/trunk/modules/system/src/schema/local-attribute.xsd
Modified:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
    geronimo/trunk/modules/assembly/maven.xml
    geronimo/trunk/modules/assembly/project.xml
    geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml
    geronimo/trunk/modules/assembly/src/plan/system-plan.xml
    geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/trunk/modules/derby/src/java/org/apache/geronimo/derby/DerbyNetworkGBean.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGAttributeInfo.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GAttributeInfo.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfo.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java
    geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java
    geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/MockDynamicGBean.java
    geronimo/trunk/modules/system/project.xml
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/ConnectorGBean.java

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java Fri Aug 26 05:55:00 2005
@@ -64,12 +64,12 @@
         GBeanInfoBuilder queueInfoBuilder = new GBeanInfoBuilder(
                 AdminObjectWrapper.class, AdminObjectWrapperGBean.GBEAN_INFO);
         queueInfoBuilder.addAttribute(new DynamicGAttributeInfo("PhysicalName",
-                String.class.getName(), true, true, true));
+                String.class.getName(), true, false, true, true));
         QUEUE_INFO = queueInfoBuilder.getBeanInfo();
         GBeanInfoBuilder topicInfoBuilder = new GBeanInfoBuilder(
                 AdminObjectWrapper.class, AdminObjectWrapperGBean.GBEAN_INFO);
         topicInfoBuilder.addAttribute(new DynamicGAttributeInfo("PhysicalName",
-                String.class.getName(), true, true, true));
+                String.class.getName(), true, false, true, true));
         TOPIC_INFO = topicInfoBuilder.getBeanInfo();
     }
 

Modified: geronimo/trunk/modules/assembly/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/maven.xml?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/maven.xml (original)
+++ geronimo/trunk/modules/assembly/maven.xml Fri Aug 26 05:55:00 2005
@@ -270,6 +270,10 @@
                 template="${planName}"
                 name="${basedir}/target/installer/plan-src/${planName}"/>
         </j:forEach>
+        
+        <velocity:merge basedir="${basedir}/src/var/config"
+                        template="config.xml"
+                        name="${basedir}/target/installer/plan-src/config.xml" />
 
 
         <!-- Second pass for the default build -->
@@ -315,6 +319,10 @@
                 template="${planName}"
                 name="${basedir}/target/plan/${planName}"/>
         </j:forEach>
+
+        <velocity:merge basedir="${basedir}/src/var/config"
+                        template="config.xml"
+                        name="${distDir}/var/config/config.xml" />
 
         <!-- copy the final plans -->
         <ant:mkdir dir="${distDir}/doc"/>

Modified: geronimo/trunk/modules/assembly/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/project.xml?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/project.xml (original)
+++ geronimo/trunk/modules/assembly/project.xml Fri Aug 26 05:55:00 2005
@@ -135,6 +135,8 @@
             <artifactId>geronimo-common</artifactId>
             <version>${pom.currentVersion}</version>
             <properties>
+                <server>true</server>
+                <client>true</client>
                 <lib>true</lib>
                 <deploy>true</deploy>
                 <repository>true</repository>

Modified: geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml Fri Aug 26 05:55:00 2005
@@ -49,6 +49,12 @@
         <reference name="ServerInfo"><name>ServerInfo</name></reference>
     </gbean>
 
+    <!-- User-editable attribute service -->
+    <gbean name="AttributeManager" class="org.apache.geronimo.system.configuration.LocalAttributeManager">
+        <reference name="ServerInfo"><name>ServerInfo</name></reference>
+        <attribute name="configFile">var/config/config.xml</attribute>
+    </gbean>
+
     <!-- Logging service -->
     <gbean name="Logger" class="org.apache.geronimo.system.logging.log4j.Log4jService">
         <attribute name="configFileName">var/log/deployer-log4j.properties</attribute>

Modified: geronimo/trunk/modules/assembly/src/plan/system-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/system-plan.xml?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/system-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/system-plan.xml Fri Aug 26 05:55:00 2005
@@ -57,6 +57,12 @@
         <attribute name="configFile">var/config/config.list</attribute>
     </gbean>
 
+    <!-- User-editable attribute service -->
+    <gbean name="AttributeManager" class="org.apache.geronimo.system.configuration.LocalAttributeManager">
+        <reference name="ServerInfo"><name>ServerInfo</name></reference>
+        <attribute name="configFile">var/config/config.xml</attribute>
+    </gbean>
+
     <!-- Repository -->
     <gbean name="Repository" class="org.apache.geronimo.system.repository.ReadOnlyRepository">
         <attribute name="root">repository/</attribute>

Added: geronimo/trunk/modules/assembly/src/var/config/config.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/var/config/config.xml?rev=240228&view=auto
==============================================================================
--- geronimo/trunk/modules/assembly/src/var/config/config.xml (added)
+++ geronimo/trunk/modules/assembly/src/var/config/config.xml Fri Aug 26 05:55:00 2005
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<attributes>
+  <configuration name="org/apache/geronimo/Server">
+    <gbean name="JettyWebConnector">
+      <attribute name="host">${PlanServerHostname}</attribute>
+      <attribute name="port">${PlanHTTPPort}</attribute>
+      <attribute name="redirectPort">${PlanHTTPSPort}</attribute>
+    </gbean>
+    <gbean name="JettySSLConnector">
+      <attribute name="host">${PlanServerHostname}</attribute>
+      <attribute name="port">${PlanHTTPSPort}</attribute>
+    </gbean>
+    <gbean name="TomcatWebConnector">
+      <attribute name="host">${PlanServerHostname}</attribute>
+      <attribute name="port">${PlanHTTPPort}</attribute>
+      <attribute name="redirectPort">${PlanHTTPSPort}</attribute>
+    </gbean>
+    <gbean name="TomcatAJPConnector">
+      <attribute name="host">${PlanServerHostname}</attribute>
+      <attribute name="port">${PlanAJPPort}</attribute>
+      <attribute name="redirectPort">${PlanHTTPSPort}</attribute>
+    </gbean>
+    <gbean name="TomcatSSLConnector">
+      <attribute name="host">${PlanServerHostname}</attribute>
+      <attribute name="port">${PlanHTTPSPort}</attribute>
+    </gbean>
+    <gbean name="openejb:type=NetworkService,name=EJB">
+      <attribute name="host">${PlanServerHostname}</attribute>
+      <attribute name="port">${PlanOpenEJBPort}</attribute>
+    </gbean>
+  </configuration>
+  <configuration name="org/apache/geronimo/ActiveMQServer">
+    <gbean name="ActiveMQ.tcp.${PlanServerHostname}.${PlanActiveMQPort}">
+      <attribute name="host">${PlanServerHostname}</attribute>
+      <attribute name="port">${PlanActiveMQPort}</attribute>
+    </gbean>
+  </configuration>
+  <configuration name="org/apache/geronimo/SystemDatabase">
+    <gbean name="DerbyNetwork">
+      <attribute name="host">${PlanServerHostname}</attribute>
+      <attribute name="port">${PlanDerbyPort}</attribute>
+    </gbean>
+  </configuration>
+</attributes>

Propchange: geronimo/trunk/modules/assembly/src/var/config/config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Fri Aug 26 05:55:00 2005
@@ -545,7 +545,7 @@
 
             for (Iterator iterator = getters.entrySet().iterator(); iterator.hasNext();) {
                 Map.Entry entry = (Map.Entry) iterator.next();
-                infoBuilder.addAttribute(new DynamicGAttributeInfo((String) entry.getKey(), (String) entry.getValue(), true, true, true));
+                infoBuilder.addAttribute(new DynamicGAttributeInfo((String) entry.getKey(), (String) entry.getValue(), true, false, true, true));
             }
 
             GBeanInfo gbeanInfo = infoBuilder.getBeanInfo();
@@ -602,7 +602,7 @@
 
     private GBeanData setUpDynamicGBean(GBeanInfoBuilder infoBuilder, ConfigPropertyType[] configProperties, ClassLoader cl) throws DeploymentException {
         for (int i = 0; i < configProperties.length; i++) {
-            infoBuilder.addAttribute(new DynamicGAttributeInfo(configProperties[i].getConfigPropertyName().getStringValue().trim(), configProperties[i].getConfigPropertyType().getStringValue().trim(), true, true, true));
+            infoBuilder.addAttribute(new DynamicGAttributeInfo(configProperties[i].getConfigPropertyName().getStringValue().trim(), configProperties[i].getConfigPropertyType().getStringValue().trim(), true, false, true, true));
         }
 
         GBeanInfo gbeanInfo = infoBuilder.getBeanInfo();

Modified: geronimo/trunk/modules/derby/src/java/org/apache/geronimo/derby/DerbyNetworkGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/derby/src/java/org/apache/geronimo/derby/DerbyNetworkGBean.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/derby/src/java/org/apache/geronimo/derby/DerbyNetworkGBean.java (original)
+++ geronimo/trunk/modules/derby/src/java/org/apache/geronimo/derby/DerbyNetworkGBean.java Fri Aug 26 05:55:00 2005
@@ -91,8 +91,8 @@
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("Derby Connector", DerbyNetworkGBean.class);
-        infoFactory.addAttribute("host", String.class, true);
-        infoFactory.addAttribute("port", Integer.TYPE, true);
+        infoFactory.addAttribute("host", String.class, true, true);
+        infoFactory.addAttribute("port", Integer.TYPE, true, true);
         infoFactory.addAttribute("address", InetSocketAddress.class, false);
         infoFactory.addReference("derbySystem", DerbySystem.class, "GBean");
         infoFactory.setConstructor(new String[]{"derbySystem"});

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java Fri Aug 26 05:55:00 2005
@@ -225,16 +225,9 @@
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("Jetty HTTP Connector", JettyConnector.class);
-        infoFactory.addAttribute("defaultScheme", String.class, false);
-        infoFactory.addAttribute("host", String.class, true);
-        infoFactory.addAttribute("port", int.class, true);
-        infoFactory.addAttribute("minThreads", int.class, true);
-        infoFactory.addAttribute("maxThreads", int.class, true);
-        infoFactory.addAttribute("threads", int.class, false);
-        infoFactory.addAttribute("idleThreads", int.class, false);
-        infoFactory.addAttribute("listenAddress", InetSocketAddress.class, false);
         infoFactory.addReference("JettyContainer", JettyContainer.class, NameFactory.GERONIMO_SERVICE);
-        infoFactory.addInterface(JettyWebConnector.class);
+        infoFactory.addInterface(JettyWebConnector.class, new String[]{"host", "port", "minThreads","maxThreads","bufferSizeBytes","acceptQueueSize","lingerMillis","tcpNoDelay","redirectPort",},
+                                                          new String[]{"host", "port", "redirectPort"});
         infoFactory.setConstructor(new String[] {"JettyContainer"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGAttributeInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGAttributeInfo.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGAttributeInfo.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGAttributeInfo.java Fri Aug 26 05:55:00 2005
@@ -23,8 +23,8 @@
  * @version $Rev$ $Date$
  */
 public class DynamicGAttributeInfo extends GAttributeInfo {
-    public DynamicGAttributeInfo(String name, String type, boolean persistent, boolean readable, boolean writable) {
-        super(name, type, persistent, readable, writable, null, null);
+    public DynamicGAttributeInfo(String name, String type, boolean persistent, boolean manageable, boolean readable, boolean writable) {
+        super(name, type, persistent, manageable, readable, writable, null, null);
     }
     
 }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GAttributeInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GAttributeInfo.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GAttributeInfo.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GAttributeInfo.java Fri Aug 26 05:55:00 2005
@@ -41,6 +41,11 @@
     private final boolean persistent;
 
     /**
+     * Is this attribute manageable?
+     */
+    private final boolean manageable;
+
+    /**
      * Is this attribute readable?
      */
     private final boolean readable;
@@ -62,14 +67,15 @@
      */
     private final String setterName;
 
-    public GAttributeInfo(String name, String type, boolean persistent, String getterName, String setterName) {
-        this(name, type, persistent, getterName != null, setterName != null, getterName, setterName);
+    public GAttributeInfo(String name, String type, boolean persistent, boolean manageable, String getterName, String setterName) {
+        this(name, type, persistent, manageable, getterName != null, setterName != null, getterName, setterName);
     }
 
-    public GAttributeInfo(String name, String type, boolean persistent, boolean readable, boolean writable, String getterName, String setterName) {
+    public GAttributeInfo(String name, String type, boolean persistent, boolean manageable, boolean readable, boolean writable, String getterName, String setterName) {
         this.name = name;
         this.type = type;
         this.persistent = persistent;
+        this.manageable = manageable;
         this.readable = readable;
         this.writable = writable;
         this.getterName = getterName;
@@ -88,6 +94,10 @@
         return persistent;
     }
 
+    public boolean isManageable() {
+        return manageable;
+    }
+
     public boolean isReadable() {
         return readable;
     }
@@ -108,6 +118,7 @@
         return "[GAttributeInfo: name=" + name +
                 " type=" + type +
                 " persistent=" + persistent +
+                " manageable=" + manageable +
                 " readable=" + readable +
                 " writable=" + writable +
                 " getterName=" + getterName +

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfo.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfo.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfo.java Fri Aug 26 05:55:00 2005
@@ -156,15 +156,35 @@
         return (GAttributeInfo) attributesByName.get(name);
     }
     
+    /**
+     * Returns a Set where the elements are type GAttributeInfo
+     */
     public Set getAttributes() {
         return attributes;
     }
 
+    /**
+     * Returns a list where the elements are type GAttributeInfo
+     */
     public List getPersistentAttributes() {
         List attrs = new ArrayList();
         for (Iterator i = attributes.iterator(); i.hasNext();) {
             GAttributeInfo info = (GAttributeInfo) i.next();
             if (info.isPersistent()) {
+                attrs.add(info);
+            }
+        }
+        return attrs;
+    }
+
+    /**
+     * Returns a list where the elements are type GAttributeInfo
+     */
+    public List getManageableAttributes() {
+        List attrs = new ArrayList();
+        for (Iterator i = attributes.iterator(); i.hasNext();) {
+            GAttributeInfo info = (GAttributeInfo) i.next();
+            if (info.isManageable()) {
                 attrs.add(info);
             }
         }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java Fri Aug 26 05:55:00 2005
@@ -132,7 +132,11 @@
     //do not use beaninfo Introspector to list the properties.  This method is primarily for interfaces,
     //and it does not process superinterfaces.  It seems to really only work well for classes.
     public void addInterface(Class intf, String[] persistentAttributes) {
+        addInterface(intf, persistentAttributes, new String[0]);
+    }
+    public void addInterface(Class intf, String[] persistentAttributes, String[] manageableAttributes) {
         Set persistentNames = new HashSet(Arrays.asList(persistentAttributes));
+        Set manageableNames = new HashSet(Arrays.asList(manageableAttributes));
         Method[] methods = intf.getMethods();
         for (int i = 0; i < methods.length; i++) {
             Method method = methods[i];
@@ -145,6 +149,7 @@
                             new GAttributeInfo(attributeName,
                                     attributeType,
                                     persistentNames.contains(attributeName),
+                                    manageableNames.contains(attributeName),
                                     method.getName(),
                                     null));
                 } else {
@@ -155,6 +160,7 @@
                             new GAttributeInfo(attributeName,
                                     attributeType,
                                     attribute.isPersistent(),
+                                    attribute.isManageable(),
                                     method.getName(),
                                     attribute.getSetterName()));
                 }
@@ -167,6 +173,7 @@
                             new GAttributeInfo(attributeName,
                                     attributeType,
                                     persistentNames.contains(attributeName),
+                                    manageableNames.contains(attributeName),
                                     null,
                                     method.getName()));
                 } else {
@@ -177,6 +184,7 @@
                             new GAttributeInfo(attributeName,
                                     attributeType,
                                     attribute.isPersistent(),
+                                    attribute.isManageable(),
                                     attribute.getGetterName(),
                                     method.getName()));
                 }
@@ -202,13 +210,21 @@
     }
 
     public void addAttribute(String name, Class type, boolean persistent) {
-        addAttribute(name, type.getName(), persistent);
+        addAttribute(name, type.getName(), persistent, false);
     }
 
     public void addAttribute(String name, String type, boolean persistent) {
+        addAttribute(name, type, persistent, false);
+    }
+
+    public void addAttribute(String name, Class type, boolean persistent, boolean manageable) {
+        addAttribute(name, type.getName(), persistent, manageable);
+    }
+
+    public void addAttribute(String name, String type, boolean persistent, boolean manageable) {
         String getter = searchForGetter(name, type, gbeanType);
         String setter = searchForSetter(name, type, gbeanType);
-        addAttribute(new GAttributeInfo(name, type, persistent, getter, setter));
+        addAttribute(new GAttributeInfo(name, type, persistent, manageable, getter, setter));
     }
 
     public void addAttribute(GAttributeInfo info) {

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java Fri Aug 26 05:55:00 2005
@@ -47,6 +47,8 @@
 
     private final boolean persistent;
 
+    private final boolean manageable;
+
     private Object persistentValue;
 
     /**
@@ -112,12 +114,16 @@
         this.persistent = false;
         initializePersistentValue(value);
 
+        // not manageable
+        this.manageable = false;
+
         // create an attribute info for this gbean
         if (attribute != null) {
             GAttributeInfo attributeInfo = attribute.getAttributeInfo();
             this.attributeInfo = new GAttributeInfo(this.name,
                     this.type.getName(),
                     this.persistent,
+                    this.manageable,
                     this.readable,
                     this.writable,
                     attributeInfo.getGetterName(),
@@ -126,6 +132,7 @@
             this.attributeInfo = new GAttributeInfo(this.name,
                     this.type.getName(),
                     this.persistent,
+                    this.manageable,
                     this.readable,
                     this.writable,
                     null,
@@ -134,14 +141,14 @@
     }
 
     static GBeanAttribute createFrameworkAttribute(GBeanInstance gbeanInstance, String name, Class type, MethodInvoker getInvoker) {
-        return new GBeanAttribute(gbeanInstance, name, type, getInvoker, null, false, null);
+        return new GBeanAttribute(gbeanInstance, name, type, getInvoker, null, false, null, false);
     }
 
-    static GBeanAttribute createFrameworkAttribute(GBeanInstance gbeanInstance, String name, Class type, MethodInvoker getInvoker, MethodInvoker setInvoker, boolean persistent, Object persistentValue) {
-        return new GBeanAttribute(gbeanInstance, name, type, getInvoker, setInvoker, persistent, persistentValue);
+    static GBeanAttribute createFrameworkAttribute(GBeanInstance gbeanInstance, String name, Class type, MethodInvoker getInvoker, MethodInvoker setInvoker, boolean persistent, Object persistentValue, boolean manageable) {
+        return new GBeanAttribute(gbeanInstance, name, type, getInvoker, setInvoker, persistent, persistentValue, manageable);
     }
 
-    private GBeanAttribute(GBeanInstance gbeanInstance, String name, Class type, MethodInvoker getInvoker, MethodInvoker setInvoker, boolean persistent, Object persistentValue) {
+    private GBeanAttribute(GBeanInstance gbeanInstance, String name, Class type, MethodInvoker getInvoker, MethodInvoker setInvoker, boolean persistent, Object persistentValue, boolean manageable) {
         this.special = false;
         this.framework = true;
         this.dynamic = false;
@@ -167,10 +174,14 @@
         this.persistent = persistent;
         initializePersistentValue(persistentValue);
 
+        // manageable
+        this.manageable = manageable;
+
         // create an attribute info for this gbean
         attributeInfo = new GAttributeInfo(this.name,
                 this.type.getName(),
                 this.persistent,
+                this.manageable,
                 this.readable,
                 this.writable,
                 null,
@@ -198,6 +209,7 @@
             throw new InvalidConfigurationException("Could not load attribute class: " + attributeInfo.getType());
         }
         this.persistent = attributeInfo.isPersistent();
+        this.manageable = attributeInfo.isManageable();
 
         readable = attributeInfo.isReadable();
         writable = attributeInfo.isWritable();
@@ -307,6 +319,10 @@
 
     public boolean isPersistent() {
         return persistent;
+    }
+
+    public boolean isManageable() {
+        return manageable;
     }
 
     public boolean isSpecial() {

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java Fri Aug 26 05:55:00 2005
@@ -31,20 +31,14 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.gbean.GAttributeInfo;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.gbean.GConstructorInfo;
-import org.apache.geronimo.gbean.GOperationInfo;
-import org.apache.geronimo.gbean.GOperationSignature;
-import org.apache.geronimo.gbean.GReferenceInfo;
-import org.apache.geronimo.gbean.InvalidConfigurationException;
+import org.apache.geronimo.gbean.*;
 import org.apache.geronimo.kernel.DependencyManager;
 import org.apache.geronimo.kernel.NoSuchAttributeException;
 import org.apache.geronimo.kernel.NoSuchOperationException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ManageableAttributeStore;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.management.EventProvider;
 import org.apache.geronimo.kernel.management.ManagedObject;
 import org.apache.geronimo.kernel.management.NotificationType;
@@ -73,6 +67,12 @@
     private final Kernel kernel;
 
     /**
+     * The ManageableAttributeStore notified of any changes to manageable
+     * attributes.  This is lazy-loaded as manageable attributes are set.
+     */
+    private ManageableAttributeStore manageableStore;
+
+    /**
      * The unique name of this service.
      */
     private final ObjectName objectName;
@@ -304,7 +304,7 @@
                     enabled = ((Boolean)attributeValue).booleanValue();
                 } else {
                     if(entry.getValue() != null) {
-                        setAttribute(attributeName, attributeValue);
+                        setAttribute(attributeName, attributeValue, false);
                     }
                 }
             }
@@ -350,6 +350,11 @@
 
         // tell everyone we are done
         lifecycleBroadcaster.fireUnloadedEvent();
+
+        if(manageableStore != null) {
+            kernel.getProxyManager().destroyProxy(manageableStore);
+            manageableStore = null;
+        }
     }
 
     /**
@@ -654,6 +659,10 @@
      * @throws IndexOutOfBoundsException if the index is invalid
      */
     public void setAttribute(int index, Object value) throws Exception, IndexOutOfBoundsException {
+        setAttribute(index, value, true);
+    }
+
+    private void setAttribute(int index, Object value, boolean manage) throws Exception, IndexOutOfBoundsException {
         GBeanAttribute attribute = attributes[index];
 
         // copy target into local variables from within a synchronized block to gaurentee a consistent read
@@ -669,6 +678,9 @@
         } else {
             attribute.setPersistentValue(value);
         }
+        if(manage && attribute.isManageable()) {
+            updateManageableAttribute(attribute, value);
+        }
     }
 
     /**
@@ -681,6 +693,10 @@
      * @throws NoSuchAttributeException if the attribute name is not found in the map
      */
     public void setAttribute(String attributeName, Object value) throws Exception, NoSuchAttributeException {
+        setAttribute(attributeName, value, true);
+    }
+
+    public void setAttribute(String attributeName, Object value, boolean manage) throws Exception, NoSuchAttributeException {
         GBeanAttribute attribute = getAttributeByName(attributeName);
 
         // copy target into local variables from within a synchronized block to gaurentee a consistent read
@@ -695,6 +711,34 @@
             attribute.setValue(instance, value);
         } else {
             attribute.setPersistentValue(value);
+        }
+        if(manage && attribute.isManageable()) {
+            updateManageableAttribute(attribute, value);
+        }
+    }
+
+    private void updateManageableAttribute(GBeanAttribute attribute, Object value) {
+        if(manageableStore == null) {
+            Set set = kernel.listGBeans(new GBeanQuery(null, ManageableAttributeStore.class.getName()));
+            if(set.size() == 0) {
+                return;
+            }
+            manageableStore = (ManageableAttributeStore) kernel.getProxyManager().createProxy((ObjectName) set.iterator().next(),
+                                                                                              ManageableAttributeStore.class);
+        }
+        String configName = null;
+        Set set = kernel.getDependencyManager().getParents(objectName);
+        for (Iterator iterator = set.iterator(); iterator.hasNext();) {
+            ObjectName name = (ObjectName) iterator.next();
+            if(Configuration.isConfigurationObjectName(name)) {
+                configName = ObjectName.unquote(name.getKeyProperty("name"));
+                break;
+            }
+        }
+        if(configName != null) {
+            manageableStore.setValue(configName, objectName, attribute.getAttributeInfo(), value);
+        } else {
+            log.error("Unable to identify Configuration for GBean "+objectName+".  Manageable attribute "+attribute.getName()+" was not updated in persistent store.");
         }
     }
 

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java Fri Aug 26 05:55:00 2005
@@ -40,11 +40,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.gbean.GAttributeInfo;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.*;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.ObjectInputStreamExt;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
@@ -91,6 +87,10 @@
         return new ObjectName("geronimo.config:name=" + ObjectName.quote(configId.toString()));
     }
 
+    public static boolean isConfigurationObjectName(ObjectName name) {
+        return name.getDomain().equals("geronimo.config") && name.getKeyPropertyList().size() == 1 && name.getKeyProperty("name") != null;
+    }
+
     /**
      * The kernel in which this configuration is registered
      */
@@ -124,6 +124,11 @@
      */
     private final ConfigurationStore configurationStore;
 
+    /**
+     * Used to override stored attribute values with values set by the user.
+     */
+    private ManageableAttributeStore manageableStore;
+
     private final List dependencies;
     private final List classPath;
     private final String domain;
@@ -263,6 +268,13 @@
             configurationClassLoader = new ConfigurationClassLoader(id, urls, parent.getConfigurationClassLoader());
         }
 
+        // Look up the manageable store before we try to load the GBeans
+        Set set = kernel.listGBeans(new GBeanQuery(null, ManageableAttributeStore.class.getName()));
+        if(set.size() > 0) {
+            manageableStore = (ManageableAttributeStore) kernel.getProxyManager().createProxy(((ObjectName)set.iterator().next()),
+                                                                                              ManageableAttributeStore.class);
+        }
+
         // DSS: why exactally are we doing this?  I bet there is a reason, but
         // we should state why here.
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
@@ -276,9 +288,7 @@
             Set objectNames = new HashSet();
             for (Iterator i = gbeans.iterator(); i.hasNext();) {
                 GBeanData gbeanData = (GBeanData) i.next();
-                // set configurationBaseUrl attribute on each gbean
-                setGBeanBaseUrl(gbeanData, baseURL);
-                // add the GBean to the kernel
+                // massage the GBeanData and add the GBean to the kernel
                 loadGBean(gbeanData, objectNames);
             }
             this.objectNames = objectNames;
@@ -456,12 +466,28 @@
     private ObjectName loadGBean(GBeanData beanData, Set objectNames) throws GBeanAlreadyExistsException {
         ObjectName name = beanData.getName();
         setGBeanBaseUrl(beanData, baseURL);
+        setManageableAttributes(beanData);
         log.trace("Registering GBean " + name);
         kernel.loadGBean(beanData, configurationClassLoader);
         objectNames.add(name);
         // todo change this to a dependency on the gbeanData itself as soon as we add that feature
         kernel.getDependencyManager().addDependency(name, this.objectName);
         return name;
+    }
+
+    private void setManageableAttributes(GBeanData data) {
+        if(manageableStore == null) {
+            log.debug("Configuration cannot load manageable attributes; no manageable store present");
+            return;
+        }
+        List list = data.getGBeanInfo().getManageableAttributes();
+        for (int i = 0; i < list.size(); i++) {
+            GAttributeInfo info = (GAttributeInfo) list.get(i);
+            Object value = manageableStore.getValue(id.toString(), data.getName(), info);
+            if(value != null) {
+                data.setAttribute(info.getName(), value);
+            }
+        }
     }
 
     /**

Added: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java?rev=240228&view=auto
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java (added)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java Fri Aug 26 05:55:00 2005
@@ -0,0 +1,74 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.kernel.config;
+
+import org.apache.geronimo.gbean.GAttributeInfo;
+
+import javax.management.ObjectName;
+import java.io.IOException;
+
+/**
+ * Able to retrieve the values of certain "manageable" attributes from a
+ * repository that is more accessible to an end user (compared to the
+ * serialized data in the ConfigStore).
+ *
+ * @version $Rev: 169154 $ $Date: 2005-05-08 15:35:23 -0400 (Sun, 08 May 2005) $
+ */
+public interface ManageableAttributeStore {
+    /**
+     * Gets a stored value (if any) for a particular attribute.  The attribute
+     * is identified by the configuration name, GBean ObjectName, and attribute
+     * information.  Note: it is not possible to store a meaningful value of
+     * "null"; that would be treated the same as if no value was stored.
+     *
+     * @param configurationName The name of the configuration holding the GBean
+     *                          in question
+     * @param gbean The ObjectName of the GBean in question
+     * @param attribute The attribute in question
+     *
+     * @return An object of the correct type to populate into the attribute in
+     *         question, or null if this store has no value saved for the
+     *         specified attribute.
+     */
+    public Object getValue(String configurationName, ObjectName gbean, GAttributeInfo attribute);
+
+    /**
+     * Sets the stored value for a particular attribute.  The attribute is
+     * identified by the configuration name, GBean ObjectName, and attribute
+     * information.  Note: it is not possible to store a meaningful value of
+     * "null"; that would be treated the same as if no value was stored.
+     *
+     * Generally, whenever the value for a manageable attribute is changed,
+     * this method should be called so that value isn't reversed the next time
+     * the GBean is started.
+     *
+     * @param configurationName The name of the configuration holding the GBean
+     *                          in question
+     * @param gbean The ObjectName of the GBean in question
+     * @param attribute The attribute in question
+     * @param value The value to save, or null if no value should be saved
+     */
+    public void setValue(String configurationName, ObjectName gbean, GAttributeInfo attribute, Object value);
+
+    /**
+     * Saves the current values to persistent storage.  This should be called
+     * when the server is shut down or more often, to make sure that any
+     * changes will be reflected the next time the server starts and the
+     * store is consulted.
+     */
+    public void save() throws IOException;
+}

Propchange: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java (original)
+++ geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java Fri Aug 26 05:55:00 2005
@@ -100,11 +100,11 @@
 
     final static String nonPersistentAttrName = "nonPersistentAttribute";
 
-    final static GAttributeInfo nonPersistentAttrInfo = new GAttributeInfo(nonPersistentAttrName, String.class.getName(), false, "getFoo", "setFoo");
+    final static GAttributeInfo nonPersistentAttrInfo = new GAttributeInfo(nonPersistentAttrName, String.class.getName(), false, false, "getFoo", "setFoo");
 
     final static String persistentAttrName = "persistentAttribute";
 
-    final static GAttributeInfo persistentAttrInfo = new GAttributeInfo(persistentAttrName, String.class.getName(), true, "getFoo", "setFoo");
+    final static GAttributeInfo persistentAttrInfo = new GAttributeInfo(persistentAttrName, String.class.getName(), true, false, "getFoo", "setFoo");
 
     final static GOperationInfo opInfo = new GOperationInfo("operation");
 

Modified: geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java (original)
+++ geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java Fri Aug 26 05:55:00 2005
@@ -73,13 +73,13 @@
         assertTrue(attribute.isReadable());
         assertFalse(attribute.isWritable());
         assertFalse(attribute.isPersistent());
-        attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, null, setInvoker, false, null);
+        attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, null, setInvoker, false, null, false);
         assertEquals(String.class, attribute.getType());
         assertEquals(attributeName, attribute.getName());
         assertFalse(attribute.isReadable());
         assertTrue(attribute.isWritable());
         assertFalse(attribute.isPersistent());
-        attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, getInvoker, setInvoker, false, null);
+        attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, getInvoker, setInvoker, false, null, false);
         assertEquals(String.class, attribute.getType());
         assertEquals(attributeName, attribute.getName());
         assertTrue(attribute.isReadable());
@@ -105,7 +105,7 @@
         }
 
         try {
-            GAttributeInfo invalidAttributeInfo = new GAttributeInfo(attributeName, String.class.getName(), false, null, null);
+            GAttributeInfo invalidAttributeInfo = new GAttributeInfo(attributeName, String.class.getName(), false, false, null, null);
 
             new GBeanAttribute(gbeanInstance, invalidAttributeInfo, false);
             fail("InvalidConfigurationException expected");
@@ -113,14 +113,14 @@
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo(attributeName, String.class.getName(), false, true, false, null, null);
+            final GAttributeInfo attributeInfo = new GAttributeInfo(attributeName, String.class.getName(), false, false, true, false, null, null);
             GBeanAttribute attribute = new GBeanAttribute(gbeanInstance, attributeInfo, false);
             assertTrue(attribute.isReadable());
             assertFalse(attribute.isWritable());
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo(persistentPrimitiveAttributeName, int.class.getName(), false, false, true, null, null);
+            final GAttributeInfo attributeInfo = new GAttributeInfo(persistentPrimitiveAttributeName, int.class.getName(), false, false, false, true, null, null);
             GBeanAttribute attribute = new GBeanAttribute(gbeanInstance, attributeInfo, false);
             assertFalse(attribute.isReadable());
             assertTrue(attribute.isWritable());
@@ -140,13 +140,13 @@
             // the attribute name and getter name are different, yet both
             // exist.
             // getYetAnotherFinalInt doesn't exist
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, "getFinalInt", null);
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, "getFinalInt", null);
             GBeanAttribute attribute = new GBeanAttribute(gbeanInstance, attributeInfo, false);
             assertNotNull(attribute);
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, null, "setCharAsYetAnotherFinalInt");
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setCharAsYetAnotherFinalInt");
             try {
                 new GBeanAttribute(gbeanInstance, attributeInfo, false);
                 fail("Expected InvalidConfigurationException due to invalid setter parameter type");
@@ -155,7 +155,7 @@
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, null, "setBooleanAsYetAnotherFinalInt");
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setBooleanAsYetAnotherFinalInt");
             try {
                 new GBeanAttribute(gbeanInstance, attributeInfo, false);
                 fail("Expected InvalidConfigurationException due to invalid setter parameter type");
@@ -164,7 +164,7 @@
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, null, "setByteAsYetAnotherFinalInt");
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setByteAsYetAnotherFinalInt");
             try {
                 new GBeanAttribute(gbeanInstance, attributeInfo, false);
                 fail("Expected InvalidConfigurationException due to invalid setter parameter type");
@@ -173,7 +173,7 @@
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, null, "setShortAsYetAnotherFinalInt");
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setShortAsYetAnotherFinalInt");
             try {
                 new GBeanAttribute(gbeanInstance, attributeInfo, false);
                 fail("Expected InvalidConfigurationException due to invalid setter parameter type");
@@ -182,7 +182,7 @@
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, null, "setLongAsYetAnotherFinalInt");
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setLongAsYetAnotherFinalInt");
             try {
                 new GBeanAttribute(gbeanInstance, attributeInfo, false);
                 fail("Expected InvalidConfigurationException due to invalid setter parameter type");
@@ -191,7 +191,7 @@
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, null, "setFloatAsYetAnotherFinalInt");
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setFloatAsYetAnotherFinalInt");
             try {
                 new GBeanAttribute(gbeanInstance, attributeInfo, false);
                 fail("Expected InvalidConfigurationException due to invalid setter parameter type");
@@ -200,7 +200,7 @@
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, null, "setDoubleAsYetAnotherFinalInt");
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setDoubleAsYetAnotherFinalInt");
             try {
                 new GBeanAttribute(gbeanInstance, attributeInfo, false);
                 fail("Expected InvalidConfigurationException due to invalid setter parameter type");
@@ -209,7 +209,7 @@
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, "getVoidGetterOfFinalInt", null);
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, "getVoidGetterOfFinalInt", null);
             try {
                 new GBeanAttribute(gbeanInstance, attributeInfo, false);
                 fail("Getter method not found on target; InvalidConfigurationException expected");
@@ -218,7 +218,7 @@
         }
 
         {
-            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, null, "setThatDoesntExist");
+            final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setThatDoesntExist");
             try {
                 new GBeanAttribute(gbeanInstance, attributeInfo, false);
                 fail("Setter method not found on target; InvalidConfigurationException expected");
@@ -230,7 +230,7 @@
     public final void testGetValue() throws Exception {
         {
             // attribute that isn't readable and persistent
-            final GBeanAttribute attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, null, setInvoker, false, null);
+            final GBeanAttribute attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, null, setInvoker, false, null, false);
             try {
                 attribute.getValue(gbeanInstance);
                 fail("Only persistent attributes can be accessed while offline; exception expected");
@@ -239,7 +239,7 @@
         }
 
         {
-            final GBeanAttribute attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, null, setInvoker, false, null);
+            final GBeanAttribute attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, null, setInvoker, false, null, false);
 
             try {
                 gbeanInstance.start();
@@ -257,7 +257,7 @@
 
         // 1. (offline) attribute that isn't readable and persistent
         {
-            final GBeanAttribute attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, null, setInvoker, false, null);
+            final GBeanAttribute attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, null, setInvoker, false, null, false);
             try {
                 attribute.setValue(gbeanInstance, null);
                 fail("Only persistent attributes can be modified while offline; exception expected");
@@ -331,7 +331,8 @@
                     null,
                     setInvoker,
                     false,
-                    null);
+                    null,
+                    false);
 
             try {
                 gbeanInstance.start();
@@ -371,8 +372,8 @@
                 throw new UnsupportedOperationException("Throws exception to rise test coverage");
             }
         };
-        attributeInfo = new GAttributeInfo(attributeName, String.class.getName(), false, "getName", "setName");
-        persistentPrimitiveAttributeInfo = new GAttributeInfo(persistentPrimitiveAttributeName, int.class.getName(), true, "getMutableInt", "setMutableInt");
+        attributeInfo = new GAttributeInfo(attributeName, String.class.getName(), false, false, "getName", "setName");
+        persistentPrimitiveAttributeInfo = new GAttributeInfo(persistentPrimitiveAttributeName, int.class.getName(), true, false, "getMutableInt", "setMutableInt");
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/MockDynamicGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/MockDynamicGBean.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/MockDynamicGBean.java (original)
+++ geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/MockDynamicGBean.java Fri Aug 26 05:55:00 2005
@@ -60,7 +60,7 @@
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("MockDynamicGBean", MockDynamicGBean.class);
-        infoFactory.addAttribute(new DynamicGAttributeInfo("mutableInt", Integer.class.getName(), false, true, true));
+        infoFactory.addAttribute(new DynamicGAttributeInfo("mutableInt", Integer.class.getName(), false, false, true, true));
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 }

Modified: geronimo/trunk/modules/system/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/project.xml?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/system/project.xml (original)
+++ geronimo/trunk/modules/system/project.xml Fri Aug 26 05:55:00 2005
@@ -43,6 +43,12 @@
     <dependencies>
         <dependency>
             <groupId>geronimo</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
             <artifactId>geronimo-kernel</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>

Added: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?rev=240228&view=auto
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java (added)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java Fri Aug 26 05:55:00 2005
@@ -0,0 +1,381 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.system.configuration;
+
+import org.apache.geronimo.kernel.config.ManageableAttributeStore;
+import org.apache.geronimo.gbean.GAttributeInfo;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.common.propertyeditor.PropertyEditors;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+
+import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.*;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Iterator;
+import java.beans.PropertyEditor;
+
+/**
+ * Stores managed attributes in an XML file on the local filesystem.
+ *
+ * @version $Rev: 106387 $ $Date: 2004-11-23 22:16:54 -0800 (Tue, 23 Nov 2004) $
+ */
+public class LocalAttributeManager implements ManageableAttributeStore, GBeanLifecycle {
+    private final static Log log = LogFactory.getLog(LocalAttributeManager.class);
+    private final static String BACKUP_EXTENSION=".bak";
+    private final static String TEMP_EXTENSION=".working";
+    private final static int SAVE_BUFFER_MS=5000;
+
+    private ServerInfo serverInfo;
+    private String configFile;
+    private File attributeFile;
+    private File backupFile;
+    private File tempFile;
+    private final Map configurations = new LinkedHashMap();
+    private UpdateThread updater;
+
+    public LocalAttributeManager(ServerInfo serverInfo, String configFile) {
+        this.serverInfo = serverInfo;
+        this.configFile = configFile;
+    }
+
+    public Object getValue(String configurationName, ObjectName gbean, GAttributeInfo attribute) {
+        log.info("Checking value for "+configurationName+"/"+gbean+"/"+attribute.getName());
+        Map config = (Map) configurations.get(configurationName);
+        if(config == null) {
+            return null; // nothing specified for this configuration
+        }
+        Map atts = (Map) config.get(gbean);
+        if(atts == null) {
+            atts = (Map)config.get(gbean.getKeyProperty("name"));
+        }
+        if(atts == null) {
+            return null; // nothing specified for this GBean
+        }
+        String value = (String) atts.get(attribute.getName());
+        if(value == null) {
+            return null; // nothing specified for this attribute
+        }
+        try {
+            PropertyEditor editor = PropertyEditors.findEditor(attribute.getType(), getClass().getClassLoader());
+            if (editor == null) {
+                log.error("Unable to parse attribute of type "+attribute.getType()+"; no editor found");
+                return null;
+            }
+            editor.setAsText(value);
+            return editor.getValue();
+        } catch (ClassNotFoundException e) {
+            //todo: use the Configuration's ClassLoader to load the attribute, if this ever becomes an issue
+            log.error("Unable to load attribute type "+attribute.getType());
+            return null;
+        }
+    }
+
+    public synchronized void setValue(String configurationName, ObjectName gbean, GAttributeInfo attribute, Object value) {
+        Map config = (Map) configurations.get(configurationName);
+        if(config == null) {
+            config = new HashMap();
+            configurations.put(configurationName, config);
+        }
+        Map atts = (Map) config.get(gbean);
+        if(atts == null) {
+            atts = (Map) config.get(gbean.getKeyProperty("name"));
+            if(atts == null) {
+                atts = new HashMap();
+                config.put(gbean, atts);
+            }
+        }
+        try {
+            String string = null;
+            if(value != null) {
+                PropertyEditor editor = PropertyEditors.findEditor(attribute.getType(), getClass().getClassLoader());
+                if (editor == null) {
+                    log.error("Unable to format attribute of type "+attribute.getType()+"; no editor found");
+                    return;
+                }
+                editor.setValue(value);
+                string = editor.getAsText();
+            }
+            if(string == null) {
+                atts.remove(attribute.getName());
+            } else {
+                atts.put(attribute.getName(), string);
+            }
+            updater.attributeChanged();
+        } catch (ClassNotFoundException e) {
+            //todo: use the Configuration's ClassLoader to load the attribute, if this ever becomes an issue
+            log.error("Unable to store attribute type "+attribute.getType());
+        }
+    }
+
+    public void load() throws IOException {
+        ensureParentDirectory();
+        if(!attributeFile.exists()) {
+            return;
+        }
+        configurations.clear();
+        Map results = new LinkedHashMap();
+        InputSource in = new InputSource(new FileInputStream(attributeFile));
+        DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
+        try {
+            Document doc = dfactory.newDocumentBuilder().parse(in);
+            Element root = doc.getDocumentElement();
+            NodeList configs = root.getElementsByTagName("configuration");
+            for(int c=0; c<configs.getLength(); c++) {
+                Element config = (Element)configs.item(c);
+                String configName = config.getAttribute("name");
+                Map configMap = new LinkedHashMap();
+                results.put(configName, configMap);
+                NodeList gbeans = config.getElementsByTagName("gbean");
+                for(int g=0; g<gbeans.getLength(); g++) {
+                    Element gbean = (Element)gbeans.item(g);
+                    String gbeanName = gbean.getAttribute("name");
+                    Map gbeanMap = new LinkedHashMap();
+                    if(gbeanName.indexOf(':') > -1) {
+                        ObjectName name = ObjectName.getInstance(gbeanName);
+                        configMap.put(name, gbeanMap);
+                    } else {
+                        configMap.put(gbeanName, gbeanMap);
+                    }
+                    NodeList attributes = gbean.getElementsByTagName("attribute");
+                    for(int a=0; a<attributes.getLength(); a++) {
+                        Element attribute = (Element)attributes.item(a);
+                        String attName = attribute.getAttribute("name");
+                        String value = "";
+                        NodeList text = attribute.getChildNodes();
+                        for(int t=0; t<text.getLength(); t++) {
+                            Node n = text.item(t);
+                            if(n.getNodeType() == Node.TEXT_NODE) {
+                                value += n.getNodeValue();
+                            }
+                        }
+                        gbeanMap.put(attName, value.trim());
+                    }
+                }
+            }
+            configurations.putAll(results);
+        } catch (SAXException e) {
+            log.error("Unable to read saved manageable attributes", e);
+        } catch (ParserConfigurationException e) {
+            log.error("Unable to read saved manageable attributes", e);
+        } catch (MalformedObjectNameException e) {
+            log.error("Unable to read saved manageable attributes", e);
+        }
+    }
+
+    public synchronized void save() throws IOException {
+        ensureParentDirectory();
+        if(!tempFile.exists() && !tempFile.createNewFile()) {
+            throw new IOException("Unable to create manageable attribute working file for save "+tempFile.getAbsolutePath());
+        }
+        if(!tempFile.canWrite()) {
+            throw new IOException("Unable to write to manageable attribute working file for save "+tempFile.getAbsolutePath());
+        }
+        PrintWriter out = new PrintWriter(new FileWriter(tempFile), true);
+        out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+        out.println();
+        out.println("<attributes xmlns=\"http://geronimo.apache.org/xml/ns/attributes\">");
+        for (Iterator it = configurations.entrySet().iterator(); it.hasNext();) {
+            Map.Entry entry = (Map.Entry) it.next();
+            out.println("  <configuration name=\""+entry.getKey()+"\">");
+            Map map = (Map) entry.getValue();
+            for (Iterator gb = map.entrySet().iterator(); gb.hasNext();) {
+                Map.Entry gbean = (Map.Entry) gb.next();
+                String gbeanName = gbean.getKey() instanceof String ? (String)gbean.getKey() : ((ObjectName)gbean.getKey()).getCanonicalName();
+                out.println("    <gbean name=\""+gbeanName+"\">");
+                Map atts = (Map)gbean.getValue();
+                for (Iterator att = atts.entrySet().iterator(); att.hasNext();) {
+                    Map.Entry attribute = (Map.Entry) att.next();
+                    out.print("      <attribute name=\""+attribute.getKey()+"\">");
+                    out.print((String)attribute.getValue());
+                    out.println("</attribute>");
+                }
+                out.println("    </gbean>");
+            }
+            out.println("  </configuration>");
+        }
+        out.println("</attributes>");
+        out.close();
+        if(backupFile.exists()) {
+            if(!backupFile.delete()) {
+                throw new IOException("Unable to delete old backup file in order to back up current manageable attribute working file for save");
+            }
+        }
+        if(attributeFile.exists()) {
+            if(!attributeFile.renameTo(backupFile)) {
+                throw new IOException("Unable to rename "+attributeFile.getAbsolutePath()+" to "+backupFile.getAbsolutePath()+" in order to back up manageable attribute save file");
+            }
+        }
+        if(!tempFile.renameTo(attributeFile)) {
+            throw new IOException("EXTREMELY CRITICAL!  Unable to move manageable attributes working file to proper file name!  Configuration will revert to defaults unless this is manually corrected!  (could not rename "+tempFile.getAbsolutePath()+" to "+attributeFile.getAbsolutePath()+")");
+        }
+    }
+
+    public void doStart() throws Exception {
+        load();
+        updater = new UpdateThread();
+        updater.start();
+        log.info("Started LocalAttributeManager with data on "+configurations.size()+" configurations");
+    }
+
+    public void doStop() throws Exception {
+        if(updater != null) {
+            updater.shutdown();
+            if(updater.isPending()) {
+                save();
+            }
+            updater = null;
+        }
+        log.info("Stopped LocalAttributeManager with data on "+configurations.size()+" configurations");
+        configurations.clear();
+    }
+
+    public void doFail() {
+        if(updater != null) {
+            updater.shutdown();
+            updater = null;
+        }
+        configurations.clear();
+    }
+
+    private void ensureParentDirectory() throws IOException {
+        if(attributeFile == null) {
+            attributeFile = serverInfo.resolve(configFile);
+            tempFile = new File(attributeFile.getAbsolutePath()+TEMP_EXTENSION);
+            backupFile = new File(attributeFile.getAbsolutePath()+BACKUP_EXTENSION);
+        }
+        File parent = attributeFile.getParentFile();
+        if (!parent.isDirectory()) {
+            if (!parent.mkdirs()) {
+                throw new IOException("Unable to create directory for list:" + parent);
+            }
+        }
+        if(!parent.canRead() || !parent.canWrite()) {
+            throw new IOException("Unable to write manageable attribute files to directory "+parent.getAbsolutePath());
+        }
+    }
+
+
+    /**
+     * A thread that's notified on every attribute update.  5 seconds after
+     * being notified, it will save the changes to a file.
+     */
+    // todo: This code is not pleasing -- it uses lots of synchronization and still doesn't guarantee a timely shutdown.
+    private class UpdateThread extends Thread {
+        private boolean done = false;
+        private boolean pending = false;
+
+        public UpdateThread() {
+            super("Manageable-Attribute-Saver");
+            setDaemon(true);
+        }
+
+        public synchronized void setDone() {
+            this.done = true;
+        }
+
+        public synchronized boolean isDone() {
+            return done;
+        }
+
+        public void run() {
+            while(!isDone()) {
+                // Wait until at least one change has been made
+                synchronized(LocalAttributeManager.this) {
+                    if(!pending) {
+                        try {
+                            LocalAttributeManager.this.wait();
+                            pending = true;
+                        } catch (InterruptedException e) {}
+                    }
+                    if(done) {
+                        return;
+                    }
+                }
+
+                // Pause for effect (and to catch a flurry of changes)
+                // Don't synchronize this as it holds monitors while sleeping
+                try {
+                    sleep(SAVE_BUFFER_MS);
+                } catch (InterruptedException e) {}
+
+                // Save
+                synchronized (LocalAttributeManager.this) {
+                    if(!isDone()) {
+                        try {
+                            save();
+                        } catch (IOException e) {
+                            log.error("Error saving attributes", e);
+                        }
+                        pending = false;
+                    }
+                }
+            }
+        }
+
+        public boolean isPending() {
+            synchronized (LocalAttributeManager.this) {
+                return pending;
+            }
+        }
+
+        public void attributeChanged() {
+            synchronized (LocalAttributeManager.this) {
+                pending = true;
+                LocalAttributeManager.this.notify();
+            }
+        }
+
+        public void shutdown() {
+            setDone();
+            synchronized (LocalAttributeManager.this) {
+                LocalAttributeManager.this.notify();
+            }
+        }
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(LocalAttributeManager.class, "AttributeStore");//does not use jsr-77 naming
+        infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");
+        infoFactory.addAttribute("configFile", String.class, true);
+        infoFactory.addInterface(ManageableAttributeStore.class);
+
+        infoFactory.setConstructor(new String[]{"ServerInfo","configFile"});
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Propchange: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/trunk/modules/system/src/schema/local-attribute.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/schema/local-attribute.xsd?rev=240228&view=auto
==============================================================================
--- geronimo/trunk/modules/system/src/schema/local-attribute.xsd (added)
+++ geronimo/trunk/modules/system/src/schema/local-attribute.xsd Fri Aug 26 05:55:00 2005
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2004-2005 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<xsd:schema
+    targetNamespace="http://geronimo.apache.org/xml/ns/attributes"
+    xmlns:atts="http://geronimo.apache.org/xml/ns/attributes"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    version="1.0">
+
+    <xsd:annotation>
+        <xsd:documentation>
+            <![CDATA[
+            The definition of the XML format for storing manageable attribute values.
+            Should look like this:
+
+            <attributes>
+              <configuration name="org/apache/geronimo/Server">
+                <gbean name="SomeJettyConnector">
+                  <attribute name="host">0.0.0.0</attribute>
+                  <attribute name="port">8080</attribute>
+                </gbean>
+              </configuration>
+            </attributes>
+            ]]>
+        </xsd:documentation>
+    </xsd:annotation>
+
+    <!--
+ temporary (I hope) individual elements while xmlbeans group handling is straightened out
+ -->
+
+    <xsd:element name="attributes" type="atts:attributesType"/>
+
+    <xsd:complexType name="attributesType">
+        <xsd:sequence>
+            <xsd:element name="configuration" type="atts:configurationType" minOccurs="0" maxOccurs="unlimited" />
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="configurationType">
+        <xsd:sequence>
+            <xsd:element name="gbean" type="atts:gbeanType" minOccurs="0" maxOccurs="unlimited" />
+        </xsd:sequence>
+        <xsd:attribute name="name" type="xs:string" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="gbeanType">
+        <xsd:annotation>
+            <xsd:documentation>
+                <![CDATA[
+                  Note that the name attribute for a gbean element may hold
+                  either the full GBeanName, or only the value for the
+                  "name=" portion of the GBeanName.  If there are multiple
+                  GBeans in the configuration with manageable attributes and
+                  the same "name=" portion of the GBeanName, then all must be
+                  listed and all must be listed with a full GBeanName.
+                ]]>
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="attribute" type="atts:attributeType" minOccurs="0" maxOccurs="unlimited" />
+        </xsd:sequence>
+        <xsd:attribute name="name" type="xs:string" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="attributeType">
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:string">
+                <xsd:attribute name="name" use="required"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+</xsd:schema>
\ No newline at end of file

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/ConnectorGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/ConnectorGBean.java?rev=240228&r1=240227&r2=240228&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/ConnectorGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/ConnectorGBean.java Fri Aug 26 05:55:00 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.geronimo.tomcat;
 
-import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 import java.util.Map;
@@ -378,7 +377,8 @@
         infoFactory.addAttribute("protocol", String.class, true);
         infoFactory.addReference("TomcatContainer", TomcatContainer.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addOperation("getInternalObject");
-        infoFactory.addInterface(TomcatWebConnector.class, new String[]{"host","port","bufferSizeBytes","maxThreads","acceptQueueSize","lingerMillis","tcpNoDelay","redirectPort","minSpareThreads","maxSpareThreads","maxHttpHeaderSizeBytes","hostLookupEnabled","connectionTimeoutMillis","uploadTimeoutEnabled"});
+        infoFactory.addInterface(TomcatWebConnector.class, new String[]{"host","port","bufferSizeBytes","maxThreads","acceptQueueSize","lingerMillis","tcpNoDelay","redirectPort","minSpareThreads","maxSpareThreads","maxHttpHeaderSizeBytes","hostLookupEnabled","connectionTimeoutMillis","uploadTimeoutEnabled"},
+                                                           new String[]{"host","port","redirectPort"});
         infoFactory.setConstructor(new String[] { "name", "protocol", "host", "port", "TomcatContainer"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }