geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r561149 [2/2] - in /geronimo/server/trunk: applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/ applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/ applications...
Date Mon, 30 Jul 2007 22:10:33 GMT
Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyManagerImpl.java?view=diff&rev=561149&r1=561148&r2=561149
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyManagerImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyManagerImpl.java
Mon Jul 30 15:10:32 2007
@@ -23,6 +23,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.Map.Entry;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -83,87 +84,87 @@
     //"host", "port", "minThreads", "maxThreads", "bufferSizeBytes", "acceptQueueSize", "lingerMillis",
"protocol", "redirectPort", "connectUrl", "maxIdleTimeMs"
     static {
         List<ConnectorAttribute> connectorAttributes = new ArrayList<ConnectorAttribute>();
-        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8080, "Port",
Integer.class));
+        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8080, "Port",
Integer.class, true));
         connectorAttributes.add(new ConnectorAttribute<Integer>("maxThreads", 10, "Maximum
number of acceptors", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("bufferSizeBytes",
8096, "Buffer size", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("acceptQueueSize",
10, "acceptQueueSize", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("lingerMillis", 30000,
"lingerMillis", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
+        //connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("redirectPort", 8443,
"redirectPort", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs", 30000,
"maxIdleTimeMs", Integer.class));
+        //connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs",
30000, "maxIdleTimeMs", Integer.class));
         CONNECTOR_ATTRIBUTES.put(HTTP_NIO, connectorAttributes);
 
         connectorAttributes = new ArrayList<ConnectorAttribute>();
-        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8443, "Port",
Integer.class));
+        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8443, "Port",
Integer.class, true));
         connectorAttributes.add(new ConnectorAttribute<Integer>("maxThreads", 10, "Maximum
number of acceptors", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("bufferSizeBytes",
8096, "Buffer size", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("acceptQueueSize",
10, "acceptQueueSize", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("lingerMillis", 30000,
"lingerMillis", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
+        //connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("redirectPort", 8443,
"redirectPort", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs", 30000,
"maxIdleTimeMs", Integer.class));
+        //connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs",
30000, "maxIdleTimeMs", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Boolean>("clientAuthRequested",
false, "clientAuthRequested", Boolean.class));
         connectorAttributes.add(new ConnectorAttribute<Boolean>("clientAuthRequired",
false, "clientAuthRequired", Boolean.class));
-        connectorAttributes.add(new ConnectorAttribute<String>("keyStore", "", "keyStore",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<String>("trustStore", "", "trustStore",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<String>("keyAlias", "", "keyAlias",
String.class));
+        connectorAttributes.add(new ConnectorAttribute<String>("keyStore", "", "keyStore",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<String>("trustStore", "", "trustStore",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<String>("keyAlias", "", "keyAlias",
String.class, true));
         connectorAttributes.add(new ConnectorAttribute<String>("secureProtocol", "",
"secureProtocol", String.class));
         CONNECTOR_ATTRIBUTES.put(HTTPS_NIO, connectorAttributes);
 
         connectorAttributes = new ArrayList<ConnectorAttribute>();
-        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8080, "Port",
Integer.class));
+        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8080, "Port",
Integer.class, true));
         connectorAttributes.add(new ConnectorAttribute<Integer>("maxThreads", 10, "Maximum
number of acceptors", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("bufferSizeBytes",
8096, "Buffer size", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("acceptQueueSize",
10, "acceptQueueSize", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("lingerMillis", 30000,
"lingerMillis", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
+        //connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("redirectPort", 8443,
"redirectPort", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs", 30000,
"maxIdleTimeMs", Integer.class));
+        //connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs",
30000, "maxIdleTimeMs", Integer.class));
         CONNECTOR_ATTRIBUTES.put(HTTP_BIO, connectorAttributes);
 
         connectorAttributes = new ArrayList<ConnectorAttribute>();
-        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8443, "Port",
Integer.class));
+        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8443, "Port",
Integer.class, true));
         connectorAttributes.add(new ConnectorAttribute<Integer>("maxThreads", 10, "Maximum
number of acceptors", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("bufferSizeBytes",
8096, "Buffer size", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("acceptQueueSize",
10, "acceptQueueSize", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("lingerMillis", 30000,
"lingerMillis", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
+        //connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("redirectPort", 8443,
"redirectPort", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs", 30000,
"maxIdleTimeMs", Integer.class));
+        //connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs",
30000, "maxIdleTimeMs", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Boolean>("clientAuthRequested",
false, "clientAuthRequested", Boolean.class));
         connectorAttributes.add(new ConnectorAttribute<Boolean>("clientAuthRequired",
false, "clientAuthRequired", Boolean.class));
-        connectorAttributes.add(new ConnectorAttribute<String>("keyStore", "", "keyStore",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<String>("trustStore", "", "trustStore",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<String>("keyAlias", "", "keyAlias",
String.class));
+        connectorAttributes.add(new ConnectorAttribute<String>("keyStore", "", "keyStore",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<String>("trustStore", "", "trustStore",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<String>("keyAlias", "", "keyAlias",
String.class, true));
         connectorAttributes.add(new ConnectorAttribute<String>("secureProtocol", "",
"secureProtocol", String.class));
         CONNECTOR_ATTRIBUTES.put(HTTPS_BIO, connectorAttributes);
 
         connectorAttributes = new ArrayList<ConnectorAttribute>();
-        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8080, "Port",
Integer.class));
+        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8080, "Port",
Integer.class, true));
         connectorAttributes.add(new ConnectorAttribute<Integer>("maxThreads", 10, "Maximum
number of acceptors", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("bufferSizeBytes",
8096, "Buffer size", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("acceptQueueSize",
10, "acceptQueueSize", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("lingerMillis", 30000,
"lingerMillis", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
+        //connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("redirectPort", 8443,
"redirectPort", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs", 30000,
"maxIdleTimeMs", Integer.class));
+        //connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs",
30000, "maxIdleTimeMs", Integer.class));
         CONNECTOR_ATTRIBUTES.put(HTTP_BLOCKING_NIO, connectorAttributes);
 
         connectorAttributes = new ArrayList<ConnectorAttribute>();
-        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8009, "Port",
Integer.class));
+        connectorAttributes.add(new ConnectorAttribute<String>("host", "0.0.0.0", "Host",
String.class, true));
+        connectorAttributes.add(new ConnectorAttribute<Integer>("port", 8009, "Port",
Integer.class, true));
         connectorAttributes.add(new ConnectorAttribute<Integer>("maxThreads", 10, "Maximum
number of acceptors", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("bufferSizeBytes",
8096, "Buffer size", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("acceptQueueSize",
10, "acceptQueueSize", Integer.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("lingerMillis", 30000,
"lingerMillis", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
+        //connectorAttributes.add(new ConnectorAttribute<Boolean>("tcpNoDelay", false,
"tcpNoDelay", Boolean.class));
         connectorAttributes.add(new ConnectorAttribute<Integer>("redirectPort", 8443,
"redirectPort", Integer.class));
-        connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs", 30000,
"maxIdleTimeMs", Integer.class));
+        //connectorAttributes.add(new ConnectorAttribute<Integer>("maxIdleTimeMs",
30000, "maxIdleTimeMs", Integer.class));
         CONNECTOR_ATTRIBUTES.put(AJP_NIO, connectorAttributes);
 
     }
@@ -350,7 +351,10 @@
         GBeanData gbeanData = new GBeanData(name, gbeanInfo);
         gbeanData.setReferencePattern(JettyConnector.CONNECTOR_CONTAINER_REFERENCE, containerName);
         for (ConnectorAttribute connectorAttribute : connectorAttributes) {
-            gbeanData.setAttribute(connectorAttribute.getAttributeName(), connectorAttribute.getStringValue());
+            Object value = connectorAttribute.getValue();
+            if (value != null) {
+                gbeanData.setAttribute(connectorAttribute.getAttributeName(), connectorAttribute.getValue());
+            }
         }
         EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
         if (mgr != null) {
@@ -367,6 +371,37 @@
             return null;
         }
         return name;
+    }
+    
+    public ConnectorType getConnectorType(AbstractName connectorName) {
+        ConnectorType connectorType = null; 
+        try {
+            GBeanInfo info = kernel.getGBeanInfo(connectorName);
+            boolean found = false;
+            Set intfs = info.getInterfaces();
+            for (Iterator it = intfs.iterator(); it.hasNext() && !found;) {
+                String intf = (String) it.next();
+                if (intf.equals(JettyWebConnector.class.getName())) {
+                    found = true;
+                }
+            }
+            if (!found) {
+                throw new GBeanNotFoundException(connectorName);
+            }
+            String searchingFor = info.getName();
+            for (Entry<ConnectorType, GBeanInfo> entry : CONNECTOR_GBEAN_INFOS.entrySet()
) {
+                String candidate = entry.getValue().getName();
+                if (candidate.equals(searchingFor)) {
+                    return entry.getKey();
+                }
+            }
+        } catch (GBeanNotFoundException e) {
+            log.warn("No such GBean '" + connectorName + "'");
+        } catch (Exception e) {
+            log.error(e);
+        }
+            
+        return connectorType;
     }
 
     /**

Modified: geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/WebManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/WebManager.java?view=diff&rev=561149&r1=561148&r2=561149
==============================================================================
--- geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/WebManager.java
(original)
+++ geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/WebManager.java
Mon Jul 30 15:10:32 2007
@@ -65,6 +65,8 @@
 
     AbstractName getConnectorConfiguration(ConnectorType connectorType, List<ConnectorAttribute>
connectorAttributes, WebContainer container, String uniqueName);
 
+    ConnectorType getConnectorType(AbstractName connectorName);
+
     public class ConnectorType {
         private final String description;
 
@@ -77,6 +79,33 @@
         public String getDescription() {
             return description;
         }
+
+
+        @Override
+        public int hashCode() {
+            final int PRIME = 31;
+            int result = 1;
+            result = PRIME * result + ((description == null) ? 0 : description.hashCode());
+            return result;
+        }
+
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            final ConnectorType other = (ConnectorType) obj;
+            if (description == null) {
+                if (other.description != null)
+                    return false;
+            } else if (!description.equals(other.description))
+                return false;
+            return true;
+        }
     }
 
     public class ConnectorAttribute<T> {
@@ -85,19 +114,26 @@
         private final Class<T> clazz;
         private T value;
         private final String description;
+        private boolean required;
 
-        public ConnectorAttribute(String attributeName, T value, String description, Class<T>
clazz) {
+        public ConnectorAttribute(String attributeName, T value, String description, Class<T>
clazz, boolean required) {
             this.attributeName = attributeName;
             this.value = value;
             this.description = description;
             this.clazz = clazz;
+            this.required = required;
+        }
+        
+        public ConnectorAttribute(String attributeName, T value, String description, Class<T>
clazz) {
+            this(attributeName, value, description, clazz, false);
         }
 
         public ConnectorAttribute(ConnectorAttribute<T> connectorAttribute) {
             this.attributeName = connectorAttribute.attributeName;
-            this.stringValue = connectorAttribute.stringValue;
+            this.value = connectorAttribute.value;
             this.description = connectorAttribute.description;
             this.clazz = connectorAttribute.clazz;
+            this.required = connectorAttribute.required;
         }
 
         public String getAttributeName() {
@@ -106,6 +142,7 @@
 
         public String getStringValue() {
 //            Class<T> clazz = getClass().getTypeParameters();
+            if (value == null) return null;
             PropertyEditor propertyEditor = PropertyEditors.getEditor(clazz);
             propertyEditor.setValue(value);
             return propertyEditor.getAsText();
@@ -136,5 +173,18 @@
             }
             return copy;
         }
+
+        public Class<T> getAttributeClass() {
+            return clazz;
+        }
+        
+        public boolean isRequired() {
+            return required;
+        }
+
+        public void setRequired(boolean required) {
+            this.required = required;
+        }
+
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java?view=diff&rev=561149&r1=561148&r2=561149
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
Mon Jul 30 15:10:32 2007
@@ -324,4 +324,9 @@
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
+
+    public ConnectorType getConnectorType(AbstractName connectorName) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 }



Mime
View raw message