geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r233346 [3/3] - in /geronimo/trunk: applications/console-core/ applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/ applications/console-standard/src/java/org/apache/geronimo/console/infomanage...
Date Thu, 18 Aug 2005 18:09:48 GMT
Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java (original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java Thu Aug 18 11:08:26 2005
@@ -36,6 +36,7 @@
 import org.apache.geronimo.security.realm.GenericSecurityRealm;
 import org.apache.geronimo.security.remoting.jmx.JaasLoginServiceRemotingServer;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 
 
 /**
@@ -78,7 +79,7 @@
         kernel.startGBean(serverStub);
 
         serverInfo = new ObjectName("geronimo.system:role=ServerInfo");
-        gbean = new GBeanData(serverInfo, ServerInfo.GBEAN_INFO);
+        gbean = new GBeanData(serverInfo, BasicServerInfo.GBEAN_INFO);
         gbean.setAttribute("baseDirectory", ".");
         kernel.loadGBean(gbean, ServerInfo.class.getClassLoader());
         kernel.startGBean(serverInfo);

Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java (original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java Thu Aug 18 11:08:26 2005
@@ -52,6 +52,7 @@
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
 import org.apache.geronimo.security.realm.GenericSecurityRealm;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 
 import com.sun.security.auth.login.ConfigFile;
 
@@ -117,7 +118,7 @@
         GBeanData gbean;
 
         serverInfo = new ObjectName("geronimo.system:role=ServerInfo");
-        gbean = new GBeanData(serverInfo, ServerInfo.GBEAN_INFO);
+        gbean = new GBeanData(serverInfo, BasicServerInfo.GBEAN_INFO);
         gbean.setAttribute("baseDirectory", ".");
         kernel.loadGBean(gbean, ServerInfo.class.getClassLoader());
         kernel.startGBean(serverInfo);

Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java (original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java Thu Aug 18 11:08:26 2005
@@ -36,20 +36,17 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.security.IdentificationPrincipal;
 import org.apache.geronimo.security.RealmPrincipal;
 import org.apache.geronimo.security.jaas.JaasLoginService;
-import org.apache.geronimo.security.jaas.JaasLoginServiceMBean;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
 import org.apache.geronimo.security.jaas.GeronimoLoginConfiguration;
-import org.apache.geronimo.security.jaas.JaasLoginCoordinator;
 import org.apache.geronimo.security.jaas.DirectConfigurationEntry;
 import org.apache.geronimo.security.jaas.LoginModuleControlFlag;
 import org.apache.geronimo.security.realm.GenericSecurityRealm;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 
 
 /**
@@ -98,7 +95,7 @@
         // Create all the parts
 
         serverInfo = new ObjectName("geronimo.system:role=ServerInfo");
-        gbean = new GBeanData(serverInfo, ServerInfo.GBEAN_INFO);
+        gbean = new GBeanData(serverInfo, BasicServerInfo.GBEAN_INFO);
         gbean.setAttribute("baseDirectory", ".");
         kernel.loadGBean(gbean, ServerInfo.class.getClassLoader());
         kernel.startGBean(serverInfo);

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java Thu Aug 18 11:08:26 2005
@@ -29,18 +29,18 @@
  *
  * @version $Rev$ $Date$
  */
-public class ServerInfo implements ServerInformation {
+public class BasicServerInfo implements ServerInfo {
     private final String baseDirectory;
     private final File base;
     private final URI baseURI;
 
-    public ServerInfo() {
+    public BasicServerInfo() {
         baseDirectory = null;
         base = null;
         baseURI = null;
     }
 
-    public ServerInfo(String baseDirectory) throws Exception {
+    public BasicServerInfo(String baseDirectory) throws Exception {
         this.baseDirectory = baseDirectory;
 
         // force load of server constants
@@ -127,7 +127,7 @@
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(ServerInfo.class);
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(BasicServerInfo.class);
 
         infoFactory.addAttribute("baseDirectory", String.class, true);
         infoFactory.addAttribute("version", String.class, false);
@@ -139,7 +139,7 @@
         infoFactory.addOperation("resolve", new Class[]{String.class});
         infoFactory.addOperation("resolve", new Class[]{URI.class});
 
-        infoFactory.addInterface(ServerInformation.class);
+        infoFactory.addInterface(ServerInfo.class);
 
         infoFactory.setConstructor(new String[]{"baseDirectory"});
 

Added: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerInfo.java?rev=233346&view=auto
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerInfo.java (added)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerInfo.java Thu Aug 18 11:08:26 2005
@@ -0,0 +1,53 @@
+/**
+ *
+ * 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.serverinfo;
+
+import java.io.File;
+import java.net.URI;
+
+/**
+ * Contains information about the server and functions for resolving
+ * pathnames.
+ *
+ * @version $Rev: 233335 $ $Date: 2005-08-18 12:59:09 -0400 (Thu, 18 Aug 2005) $
+ */
+public interface ServerInfo {
+    public String resolvePath(final String filename);
+
+    /**
+     * Resolves an abstract pathname to a File.
+     *
+     * @param filename a <code>String</code> containing a pathname,
+     * which will be resolved by {@link #resolvePath(String
+            * filename)}.
+     * @return a <code>File</code> value
+     */
+    public File resolve(final String filename);
+
+    public URI resolve(final URI uri);
+
+    public String getBaseDirectory();
+
+    public String getVersion();
+
+    public String getBuildDate();
+
+    public String getBuildTime();
+
+    public String getCopyright();
+}

Modified: geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/serverinfo/ServerInfoTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/serverinfo/ServerInfoTest.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/serverinfo/ServerInfoTest.java (original)
+++ geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/serverinfo/ServerInfoTest.java Thu Aug 18 11:08:26 2005
@@ -31,7 +31,7 @@
 
         String pathArg;
         {
-            si = new ServerInfo();
+            si = new BasicServerInfo();
             pathArg = "/";
             assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
             pathArg = "/x";
@@ -53,7 +53,7 @@
 
         try {
             String basedir = "/";
-            si = new ServerInfo(basedir);
+            si = new BasicServerInfo(basedir);
             pathArg = "Documents and Settings/Administrator/Application Data/geronimo";
             assertEquals(new File(basedir, pathArg).getAbsolutePath(), si.resolvePath(pathArg));
         } catch (Exception e) {
@@ -77,7 +77,7 @@
 				file = File.createTempFile("geronimo", null);
 				// a workaround - ServerInfo sets system-wide property
 				System.setProperty("geronimo.base.dir", file.getName());
-				new ServerInfo(file.getName());
+				new BasicServerInfo(file.getName());
 				fail("ServerInfo should throw exception when given non-directory path");
 			} catch (IOException ioe) {
 				fail(ioe.getMessage());
@@ -87,7 +87,7 @@
 			String basedir = ".";
 			// a workaround - ServerInfo sets system-wide property
 			System.setProperty("geronimo.base.dir", basedir);
-			ServerInfo si = new ServerInfo(basedir);
+			ServerInfo si = new BasicServerInfo(basedir);
 			assertNotNull(System.getProperty("geronimo.base.dir"));
 			assertEquals("base directory is incorrect", basedir, si.getBaseDirectory());
 		} finally {

Modified: geronimo/trunk/modules/tomcat-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/project.xml?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/project.xml (original)
+++ geronimo/trunk/modules/tomcat-builder/project.xml Thu Aug 18 11:08:26 2005
@@ -120,9 +120,15 @@
             <version>${pom.currentVersion}</version>
         </dependency>
 
-       <dependency>
+        <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-j2ee</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-management</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
 

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Thu Aug 18 11:08:26 2005
@@ -76,7 +76,7 @@
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.tomcat.ConnectorGBean;
 import org.apache.geronimo.tomcat.EngineGBean;
 import org.apache.geronimo.tomcat.HostGBean;
@@ -368,7 +368,7 @@
         kernel.startGBean(baseConfigName);
 
         serverInfoName = new ObjectName("geronimo.system:name=ServerInfo");
-        serverInfoGBean = new GBeanData(serverInfoName, ServerInfo.GBEAN_INFO);
+        serverInfoGBean = new GBeanData(serverInfoName, BasicServerInfo.GBEAN_INFO);
         serverInfoGBean.setAttribute("baseDirectory", ".");
         start(serverInfoGBean);
 
@@ -428,13 +428,10 @@
         container.setReferencePattern("EngineGBean", engineName);
         container.setReferencePattern("ServerInfo", serverInfoName);
 
-        initParams.clear();
-        initParams.put("port", "8080");
         connector = new GBeanData(connectorName, ConnectorGBean.GBEAN_INFO);
         connector.setAttribute("name", "HTTP");
-        connector.setAttribute("initParams", initParams);
+        connector.setAttribute("port", new Integer(8080));
         connector.setReferencePattern("TomcatContainer", containerName);
-        connector.setReferencePattern("ServerInfo", serverInfoName);
 
         start(container);
         start(connector);

Modified: geronimo/trunk/modules/tomcat/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/project.xml?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/project.xml (original)
+++ geronimo/trunk/modules/tomcat/project.xml Thu Aug 18 11:08:26 2005
@@ -142,9 +142,14 @@
                 <repository>true</repository>
             </properties>
         </dependency>
-       <dependency>
+        <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-j2ee</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-management</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
         <dependency>

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=233346&r1=233345&r2=233346&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 Thu Aug 18 11:08:26 2005
@@ -18,7 +18,9 @@
 
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
 import java.util.Map;
+import java.util.HashMap;
 
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.connector.Connector;
@@ -28,24 +30,37 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.management.geronimo.WebContainer;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ConnectorGBean extends BaseGBean implements GBeanLifecycle, ObjectRetriever {
+public class ConnectorGBean extends BaseGBean implements GBeanLifecycle, ObjectRetriever, TomcatWebConnector {
 
     private static final Log log = LogFactory.getLog(ConnectorGBean.class);
     
-    private final Connector connector;
+    protected final Connector connector;
     private final TomcatContainer container;
-    private final ServerInfo serverInfo;
     private String name;
-    private int port;
 
-    public ConnectorGBean(String name, String protocol, Map initParams, TomcatContainer container, ServerInfo serverInfo) throws Exception {
+    public ConnectorGBean(String name, String protocol, String host, int port, TomcatContainer container) throws Exception {
         super(); // TODO: make it an attribute
-        
+
+        Map initParams = new HashMap();
+
+        validateProtocol(protocol);
+        initParams.put("address", host);
+        initParams.put("port", Integer.toString(port));
+        initializeParams(protocol, initParams);
+
+        // Convert Geronimo standard values to Tomcat standard values
+        // Only AJP requires an explicit protocol setting
+        if(protocol != null && protocol.equals(WebContainer.PROTOCOL_AJP)) {
+            protocol = "AJP/1.3";
+        } else {
+            protocol = null;
+        }
+
         if (name == null){
             throw new IllegalArgumentException("name cannot be null.");
         }
@@ -54,39 +69,40 @@
             throw new IllegalArgumentException("container cannot be null.");
         }
  
-        if (serverInfo == null){
-            throw new IllegalArgumentException("serverInfo cannot be null.");
-        }
-        
         this.name = name;
         this.container = container;
-        this.serverInfo = serverInfo;
-        
+
         //Create the Connector object
         connector = new Connector(protocol);
 
-        //Resolve the keystore file path if we have this parameter
-        String keystoreFile = (String)initParams.get("keystoreFile");
-        if (keystoreFile != null){
-            initParams.put("keystoreFile", serverInfo.resolvePath(keystoreFile));
-        }
 
         //Set the parameters
         setParameters(connector, initParams);
         
     }
 
-    public InetSocketAddress getAddress() {
-        Object port = connector.getAttribute("port");
-        if(port instanceof String) {
-            port = new Integer((String)port);
-        }
-        Object address = connector.getAttribute("address");
-        if(address instanceof InetAddress) {
-            return new InetSocketAddress((InetAddress)address, ((Number)port).intValue());
-        } else if(address instanceof String) {
-            return new InetSocketAddress((String)address, ((Number)port).intValue());
-        } else throw new IllegalStateException("Unexpected address class "+(address == null ? "null" : address.getClass().getName()));
+    /**
+     * Adds any special parameters before constructing the connector.  Note:
+     * all keys and values must be Strings.
+     *
+     * @param protocol Should be one of the constants from WebContainer.
+     * @param params   The map of parameters that will be used to initialize the connector.
+     */
+    protected void initializeParams(String protocol, Map params) {}
+
+    /**
+     * Ensures that this implementation can handle the requested protocol.
+     * @param protocol
+     */
+    protected void validateProtocol(String protocol) {
+        if(protocol == null) {
+            return;
+        }
+        if(protocol.equals(WebContainer.PROTOCOL_HTTPS)) {
+            throw new IllegalArgumentException("Use a HttpsConnectorGBean for an HTTPS connector");
+        } else if(!protocol.equals(WebContainer.PROTOCOL_HTTP) && !protocol.equals(WebContainer.PROTOCOL_AJP)) {
+            throw new IllegalArgumentException("Unrecognized protocol '"+protocol+"' (use the values of the PROTOCOL_* constants in WebConnector)");
+        }
     }
 
     public String getName() {
@@ -118,18 +134,241 @@
         doStop();
     }
 
+
+    /**
+     * Gets the network protocol that this connector handles.
+     */
+    public String getProtocol() {
+        String protocol = connector.getProtocol();
+        if(protocol.indexOf("AJP") > -1) {
+            return WebContainer.PROTOCOL_AJP;
+        } else if(connector.getScheme().equalsIgnoreCase("http")) {
+            return WebContainer.PROTOCOL_HTTP;
+        } else if(connector.getScheme().equalsIgnoreCase("https")) {
+            return WebContainer.PROTOCOL_HTTPS;
+        }
+        throw new IllegalStateException("Unknown protocol '"+protocol+"' and scheme '"+connector.getScheme()+"'");
+    }
+
+    /**
+     * Gets the network port that this connector listens on.
+     */
+    public int getPort() {
+        return connector.getPort();
+    }
+
+    /**
+     * Sets the network port that this connector listens on.
+     */
+    public void setPort(int port) {
+        connector.setPort(port);
+    }
+
+    /**
+     * Gets the hostname/IP that this connector listens on.
+     */
+    public String getHost() {
+        Object value = connector.getAttribute("address");
+        return value == null ? "0.0.0.0" : value.toString();
+    }
+
+    /**
+     * Sets the hostname/IP that this connector listens on.  This is typically
+     * most useful for machines with multiple network cards, but can be used
+     * to limit a connector to only listen for connections from the local
+     * machine (127.0.0.1).  To listen on all available network interfaces,
+     * specify an address of 0.0.0.0.
+     */
+    public void setHost(String host) throws UnknownHostException {
+        connector.setAttribute("address", host);
+    }
+
+    /**
+     * Every connector must specify a property of type InetSocketAddress
+     * because we use that to identify the network services to print a list
+     * during startup.  However, this can be read-only since the host and port
+     * are set separately using setHost and setPort.
+     */
+    public InetSocketAddress getListenAddress() {
+        return new InetSocketAddress(getHost(), getPort());
+    }
+
+    /**
+     * Gets the size of the buffer used to handle network data for this
+     * connector.
+     */
+    public int getBufferSizeBytes() {
+        Object value = connector.getAttribute("bufferSize");
+        return value == null ? 2048 : Integer.parseInt(value.toString());
+    }
+
+    /**
+     * Gets the size of the buffer used to handle network data for this
+     * connector.
+     */
+    public void setBufferSizeBytes(int bytes) {
+        connector.setAttribute("bufferSize", new Integer(bytes));
+    }
+
+    /**
+     * Gets the maximum number of threads used to service connections from
+     * this connector.
+     */
+    public int getMaxThreads() {
+        Object value = connector.getAttribute("maxThreads");
+        return value == null ? 200 : Integer.parseInt(value.toString());
+    }
+
+    /**
+     * Sets the maximum number of threads used to service connections from
+     * this connector.
+     */
+    public void setMaxThreads(int threads) {
+        connector.setAttribute("maxThreads", new Integer(threads));
+    }
+
+    /**
+     * Gets the maximum number of connections that may be queued while all
+     * threads are busy.  Any requests received while the queue is full will
+     * be rejected.
+     */
+    public int getAcceptQueueSize() {
+        Object value = connector.getAttribute("acceptCount");
+        return value == null ? 10 : Integer.parseInt(value.toString());
+    }
+
+    /**
+     * Sets the maximum number of connections that may be queued while all
+     * threads are busy.  Any requests received while the queue is full will
+     * be rejected.
+     */
+    public void setAcceptQueueSize(int size) {
+        connector.setAttribute("acceptCount", new Integer(size));
+    }
+
+    /**
+     * Gets the amount of time the socket used by this connector will linger
+     * after being closed.  -1 indicates that socket linger is disabled.
+     */
+    public int getLingerMillis() {
+        Object value = connector.getAttribute("connectionLinger");
+        return value == null ? -1 : Integer.parseInt(value.toString());
+    }
+
+    /**
+     * Sets the amount of time the socket used by this connector will linger
+     * after being closed.  Use -1 to disable socket linger.
+     */
+    public void setLingerMillis(int millis) {
+        connector.setAttribute("connectionLinger", new Integer(millis));
+    }
+
+    /**
+     * Gets whether the TCP_NODELAY flag is set for the sockets used by this
+     * connector.  This usually enhances performance, so it should typically
+     * be set.
+     */
+    public boolean isTcpNoDelay() {
+        Object value = connector.getAttribute("tcpNoDelay");
+        return value == null ? true : new Boolean(value.toString()).booleanValue();
+    }
+
+    /**
+     * Sets whether the TCP_NODELAY flag is set for the sockets used by this
+     * connector.  This usually enhances performance, so it should typically
+     * be set.
+     */
+    public void setTcpNoDelay(boolean enable) {
+        connector.setAttribute("tcpNoDelay", new Boolean(enable));
+    }
+
+    /**
+     * Gets the network port to which traffic will be redirected if this
+     * connector handles insecure traffic and the request requires a secure
+     * connection.  Needless to say, this should point to another connector
+     * configured for SSL.
+     */
+    public int getRedirectPort() {
+        Object value = connector.getAttribute("redirectPort");
+        return value == null ? 0 : Integer.parseInt(value.toString());
+    }
+
+    /**
+     * Gets the network port to which traffic will be redirected if this
+     * connector handles insecure traffic and the request requires a secure
+     * connection.  Needless to say, this should point to another connector
+     * configured for SSL.  If no SSL connector is available, any port can
+     * be used as they all fail equally well.  :)
+     */
+    public void setRedirectPort(int port) {
+        connector.setAttribute("redirectPort", new Integer(port));
+    }
+
+    public int getMinSpareThreads() {
+        Object value = connector.getAttribute("minSpareThreads");
+        return value == null ? 4 : Integer.parseInt(value.toString());
+    }
+
+    public void setMinSpareThreads(int threads) {
+        connector.setAttribute("minSpareThreads", new Integer(threads));
+    }
+
+    public int getMaxSpareThreads() {
+        Object value = connector.getAttribute("maxSpareThreads");
+        return value == null ? 50 : Integer.parseInt(value.toString());
+    }
+
+    public void setMaxSpareThreads(int threads) {
+        connector.setAttribute("maxSpareThreads", new Integer(threads));
+    }
+
+    public int getMaxHttpHeaderSizeBytes() {
+        Object value = connector.getAttribute("maxHttpHeaderSize");
+        return value == null ? 4096 : Integer.parseInt(value.toString());
+    }
+
+    public void setMaxHttpHeaderSizeBytes(int bytes) {
+        connector.setAttribute("maxHttpHeaderSize", new Integer(bytes));
+    }
+
+    public boolean isHostLookupEnabled() {
+        Object value = connector.getAttribute("enableLookups");
+        return value == null ? true : new Boolean(value.toString()).booleanValue();
+    }
+
+    public void setHostLookupEnabled(boolean enabled) {
+        connector.setAttribute("enableLookups", new Boolean(enabled));
+    }
+
+    public int getConnectionTimeoutMillis() {
+        Object value = connector.getAttribute("connectionTimeout");
+        return value == null ? 60000 : Integer.parseInt(value.toString());
+    }
+
+    public void setConnectionTimeoutMillis(int millis) {
+        connector.setAttribute("connectionTimeout", new Integer(millis));
+    }
+
+    public boolean isUploadTimeoutEnabled() {
+        Object value = connector.getAttribute("disableUploadTimeout");
+        return value == null ? true : !new Boolean(value.toString()).booleanValue();
+    }
+
+    public void setUploadTimeoutEnabled(boolean enabled) {
+        connector.setAttribute("disableUploadTimeout", new Boolean(!enabled));
+    }
+
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("Tomcat Connector", ConnectorGBean.class);
         infoFactory.addAttribute("name", String.class, true);
         infoFactory.addAttribute("protocol", String.class, true);
-        infoFactory.addAttribute("address", InetSocketAddress.class, false);
-        infoFactory.addAttribute("initParams", Map.class, true);
         infoFactory.addReference("TomcatContainer", TomcatContainer.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addOperation("getInternalObject");
-        infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");
-        infoFactory.setConstructor(new String[] { "name", "protocol", "initParams", "TomcatContainer", "ServerInfo"});
+        infoFactory.addInterface(TomcatWebConnector.class, new String[]{"host","port","bufferSizeBytes","maxThreads","acceptQueueSize","lingerMillis","tcpNoDelay","redirectPort","minSpareThreads","maxSpareThreads","maxHttpHeaderSizeBytes","hostLookupEnabled","connectionTimeoutMillis","uploadTimeoutEnabled"});
+        infoFactory.setConstructor(new String[] { "name", "protocol", "host", "port", "TomcatContainer"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Added: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HttpsConnectorGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HttpsConnectorGBean.java?rev=233346&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HttpsConnectorGBean.java (added)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HttpsConnectorGBean.java Thu Aug 18 11:08:26 2005
@@ -0,0 +1,178 @@
+package org.apache.geronimo.tomcat;
+
+import java.util.Map;
+import org.apache.geronimo.management.geronimo.SecureConnector;
+import org.apache.geronimo.management.geronimo.WebContainer;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+
+/**
+ * A wrapper around a connector for the HTTPS protocol for Tomcat.  The
+ * functionality is not different than the standard ConnectorGBean, but
+ * there's an additional set of HTTPS attributes exposed.
+ *
+ * @version $Revision: 1.0$
+ */
+public class HttpsConnectorGBean extends ConnectorGBean implements SecureConnector {
+    private final ServerInfo serverInfo;
+    private String keystoreFileName;
+
+    public HttpsConnectorGBean(String name, String protocol, String host, int port, TomcatContainer container, ServerInfo serverInfo) throws Exception {
+        super(name, protocol, host, port, container);
+
+        if (serverInfo == null){
+            throw new IllegalArgumentException("serverInfo cannot be null.");
+        }
+
+        this.serverInfo = serverInfo;
+    }
+
+    /**
+     * Adds any special parameters before constructing the connector.
+     *
+     * @param protocol Should be one of the constants from WebContainer.
+     * @param params   The map of parameters that will be used to initialize the connector.
+     */
+    protected void initializeParams(String protocol, Map params) {
+        super.initializeParams(protocol, params);
+        params.put("scheme", "https");
+        params.put("secure", "true");
+    }
+
+    /**
+     * Ensures that this implementation can handle the requested protocol.
+     *
+     * @param protocol
+     */
+    protected void validateProtocol(String protocol) {
+        if(protocol != null && !protocol.equals(WebContainer.PROTOCOL_HTTPS)) {
+            throw new IllegalStateException("HttpsConnectorGBean only supports "+WebContainer.PROTOCOL_HTTPS);
+        }
+    }
+
+    /**
+     * Gets the name of the keystore file that holds the server certificate
+     * (and by default, the trusted CA certificates used for client certificate
+     * authentication).  This is relative to the Geronimo home directory.
+     */
+    public String getKeystoreFileName() {
+        return keystoreFileName; // don't look it up as we need it to be relative
+    }
+
+    /**
+     * Sets the name of the keystore file that holds the server certificate
+     * (and by default, the trusted CA certificates used for client certificate
+     * authentication).  This is relative to the Geronimo home directory.
+     */
+    public void setKeystoreFileName(String name) {
+        keystoreFileName = name;
+        connector.setAttribute("keystoreFile", serverInfo.resolvePath(keystoreFileName));
+    }
+
+    /**
+     * Sets the password used to access the keystore, and by default, used to
+     * access the server private key inside the keystore.  Not all connectors
+     * support configuring different passwords for those two features; if so,
+     * a separate PrivateKeyPassword should be defined in an
+     * implementation-specific connector interface.
+     */
+    public void setKeystorePassword(String password) {
+        connector.setAttribute("keystorePass", password);
+    }
+
+    /**
+     * Gets the format of the entries in the keystore.  The default format for
+     * Java keystores is JKS, though some connector implementations support
+     * PCKS12 (and possibly other formats).
+     */
+    public String getKeystoreType() {
+        return (String)connector.getAttribute("keystoreType");
+    }
+
+    /**
+     * Sets the format of the entries in the keystore.  The default format for
+     * Java keystores is JKS, though some connector implementations support
+     * PCKS12 (and possibly other formats).
+     */
+    public void setKeystoreType(String type) {
+        connector.setAttribute("keystoreType", type);
+    }
+
+    /**
+     * Gets the certificate algorithm used to access the keystore.  This may
+     * be different for different JVM vendors, but should not usually be
+     * changed otherwise.
+     */
+    public String getAlgorithm() {
+        return (String)connector.getAttribute("algorithm");
+    }
+
+    /**
+     * Sets the certificate algorithm used to access the keystore.  This may
+     * be different for different JVM vendors, but should not usually be
+     * changed otherwise.
+     */
+    public void setAlgorithm(String algorithm) {
+        connector.setAttribute("algorithm", algorithm);
+    }
+
+    /**
+     * Gets the protocol used for secure communication.  This should usually
+     * be TLS, though some JVM implementations (particularly some of IBM's)
+     * may not be compatible with popular browsers unless this is changed to
+     * SSL.
+     */
+    public String getSecureProtocol() {
+        return (String)connector.getAttribute("sslProtocol");
+    }
+
+    /**
+     * Gets the protocol used for secure communication.  This should usually
+     * be TLS, though some JVM implementations (particularly some of IBM's)
+     * may not be compatible with popular browsers unless this is changed to
+     * SSL.  Don't change it if you're not having problems.
+     */
+    public void setSecureProtocol(String protocol) {
+        connector.setAttribute("sslProtocol", protocol);
+    }
+
+    /**
+     * Checks whether clients are required to authenticate using client
+     * certificates in order to connect using this connector.  If enabled,
+     * client certificates are validated using the trust store, which defaults
+     * to the same keystore file, keystore type, and keystore password as the
+     * regular keystore.  Some connector implementations may allow you to
+     * configure those 3 values separately to use a different trust store.
+     */
+    public boolean isClientAuthRequired() {
+        Object value = connector.getAttribute("clientAuth");
+        return value == null ? false : new Boolean(value.toString()).booleanValue();
+    }
+
+    /**
+     * Checks whether clients are required to authenticate using client
+     * certificates in order to connect using this connector.  If enabled,
+     * client certificates are validated using the trust store, which defaults
+     * to the same keystore file, keystore type, and keystore password as the
+     * regular keystore.  Some connector implementations may allow you to
+     * configure those 3 values separately to use a different trust store.
+     */
+    public void setClientAuthRequired(boolean clientCert) {
+        connector.setAttribute("clientAuth", new Boolean(clientCert));
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("Tomcat Connector", HttpsConnectorGBean.class, ConnectorGBean.GBEAN_INFO);
+        infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");
+        infoFactory.addInterface(SecureConnector.class, new String[]{"keystoreFileName", "keystorePassword", "keystoreType", "algorithm", "secureProtocol", "clientAuthRequired"});
+        infoFactory.setConstructor(new String[] { "name", "protocol", "host", "port", "TomcatContainer", "ServerInfo"});
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java Thu Aug 18 11:08:26 2005
@@ -18,12 +18,17 @@
 
 import java.io.File;
 import java.io.FileFilter;
-import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
+import java.util.List;
+import java.util.Iterator;
+import java.util.Hashtable;
 
+import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
@@ -35,12 +40,17 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.GBeanQuery;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.management.impl.Util;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.tomcat.realm.TomcatJAASRealm;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.webservices.SoapHandler;
 import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.Kernel;
 
 /**
  * Apache Tomcat GBean
@@ -50,7 +60,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class TomcatContainer implements SoapHandler, GBeanLifecycle {
+public class TomcatContainer implements SoapHandler, GBeanLifecycle, TomcatWebContainer {
 
     private static final Log log = LogFactory.getLog(TomcatContainer.class);
 
@@ -74,6 +84,16 @@
      **/
     private ClassLoader classLoader;
 
+    /**
+     * The kernel that's loaded this GBean.
+     */
+    private Kernel kernel;
+
+    /**
+     * The ObjectName of this GBean.
+     */
+    private ObjectName myName;
+
     private final Map webServices = new HashMap();
 
     // Required as it's referenced by deployed webapps
@@ -84,7 +104,13 @@
     /**
      * GBean constructor (invoked dynamically when the gbean is declared in a plan)
      */
-    public TomcatContainer(ClassLoader classLoader, String catalinaHome, ObjectRetriever engineGBean, ServerInfo serverInfo) {
+    public TomcatContainer(ClassLoader classLoader, String catalinaHome, ObjectRetriever engineGBean, ServerInfo serverInfo, Kernel kernel, String objectName) {
+        this.kernel = kernel;
+        try {
+            myName = ObjectName.getInstance(objectName);
+        } catch (MalformedObjectNameException e) {
+            throw new IllegalArgumentException("Invalid object name "+e);
+        }
 
         if (catalinaHome == null)
             catalinaHome = DEFAULT_CATALINA_HOME;
@@ -327,15 +353,151 @@
         
         return new TomcatClassLoader((URL[])urls.toArray(new URL[0]), null, cl, false);
     }
-    
+
+
+
+    /**
+     * Gets the protocols which this container can configure connectors for.
+     */
+    public String[] getSupportedProtocols() {
+        return new String[]{PROTOCOL_HTTP, PROTOCOL_HTTPS, PROTOCOL_AJP};
+    }
+
+    /**
+     * Gets the ObjectNames of any existing connectors for the specified
+     * protocol.
+     *
+     * @param protocol A protocol as returned by getSupportedProtocols
+     */
+    public String[] getConnectors(String protocol) {
+        GBeanQuery query = new GBeanQuery(null, TomcatWebConnector.class.getName());
+        Set names = kernel.listGBeans(query);
+        List result = new ArrayList();
+        for (Iterator it = names.iterator(); it.hasNext();) {
+            ObjectName name = (ObjectName) it.next();
+            try {
+                if(kernel.getAttribute(name, "protocol").equals(protocol)) {
+                    result.add(name.getCanonicalName());
+                }
+            } catch (Exception e) {
+                log.error("Unable to check the protocol for a connector", e);
+            }
+        }
+        return (String[]) result.toArray(new String[result.size()]);
+    }
+
+    /**
+     * Gets the ObjectNames of any existing connectors.
+     */
+    public String[] getConnectors() {
+        GBeanQuery query = new GBeanQuery(null, TomcatWebConnector.class.getName());
+        Set names = kernel.listGBeans(query);
+        String[] result = new String[names.size()];
+        int i=0;
+        for (Iterator it = names.iterator(); it.hasNext();) {
+            ObjectName name = (ObjectName) it.next();
+            result[i++] = name.getCanonicalName();
+        }
+        return result;
+    }
+
+    /**
+     * Creates a new connector, and returns the ObjectName for it.  Note that
+     * the connector may well require further customization before being fully
+     * functional (e.g. SSL settings for an HTTPS connector).
+     */
+    public String addConnector(String uniqueName, String protocol, String host, int port) {
+        ObjectName name = getConnectorName(protocol, uniqueName);
+        GBeanData connector;
+        if(protocol.equals(PROTOCOL_HTTP)) {
+            connector = new GBeanData(name, ConnectorGBean.GBEAN_INFO);
+        } else if(protocol.equals(PROTOCOL_HTTPS)) {
+            connector = new GBeanData(name, HttpsConnectorGBean.GBEAN_INFO);
+            GBeanQuery query = new GBeanQuery(null, ServerInfo.class.getName());
+            Set set = kernel.listGBeans(query);
+            connector.setReferencePattern("ServerInfo", (ObjectName)set.iterator().next());
+            //todo: default HTTPS settings
+        } else if(protocol.equals(PROTOCOL_AJP)) {
+            connector = new GBeanData(name, ConnectorGBean.GBEAN_INFO);
+        } else {
+            throw new IllegalArgumentException("Invalid protocol '"+protocol+"'");
+        }
+        connector.setAttribute("protocol", protocol);
+        connector.setAttribute("host", host);
+        connector.setAttribute("port", new Integer(port));
+        connector.setAttribute("maxThreads", new Integer(50));
+        connector.setAttribute("acceptCount", new Integer(100));
+        connector.setReferencePattern("TomcatContainer", myName);
+        ObjectName config = Util.getConfiguration(kernel, myName);
+        try {
+            kernel.invoke(config, "addGBean", new Object[]{connector, Boolean.FALSE}, new String[]{GBeanData.class.getName(), boolean.class.getName()});
+        } catch (Exception e) {
+            log.error("Unable to add GBean ", e);
+            return null;
+        }
+        return name.getCanonicalName();
+    }
+
+    private ObjectName getConnectorName(String protocol, String uniqueName) {
+        Hashtable table = new Hashtable();
+        table.put(NameFactory.J2EE_APPLICATION, myName.getKeyProperty(NameFactory.J2EE_APPLICATION));
+        table.put(NameFactory.J2EE_SERVER, myName.getKeyProperty(NameFactory.J2EE_SERVER));
+        table.put(NameFactory.J2EE_MODULE, myName.getKeyProperty(NameFactory.J2EE_MODULE));
+        table.put(NameFactory.J2EE_TYPE, myName.getKeyProperty(NameFactory.J2EE_TYPE));
+        table.put(NameFactory.J2EE_NAME, "TomcatWebConnector-"+protocol+"-"+uniqueName);
+        try {
+            return ObjectName.getInstance(myName.getDomain(), table);
+        } catch (MalformedObjectNameException e) {
+            throw new IllegalStateException("Never should have failed: "+e.getMessage());
+        }
+    }
+
+    /**
+     * Removes a connector.  This shuts it down if necessary, and removes it
+     * from the server environment.  It must be a connector that this container
+     * is responsible for.
+     */
+    public void removeConnector(String objectName) {
+        ObjectName name = null;
+        try {
+            name = ObjectName.getInstance(objectName);
+        } catch (MalformedObjectNameException e) {
+            throw new IllegalArgumentException("Invalid object name '"+objectName+"': "+e.getMessage());
+        }
+        try {
+            GBeanInfo info = kernel.getGBeanInfo(name);
+            boolean found = false;
+            Set intfs = info.getInterfaces();
+            for (Iterator it = intfs.iterator(); it.hasNext();) {
+                String intf = (String) it.next();
+                if(intf.equals(TomcatWebConnector.class.getName())) {
+                    found = true;
+                }
+            }
+            if(!found) {
+                throw new GBeanNotFoundException(name);
+            }
+            ObjectName config = Util.getConfiguration(kernel, name);
+            kernel.invoke(config, "removeGBean", new Object[]{name}, new String[]{ObjectName.class.getName()});
+        } catch (GBeanNotFoundException e) {
+            log.warn("No such GBean '"+objectName+"'"); //todo: what if we want to remove a failed GBean?
+        } catch (Exception e) {
+            log.error(e);
+        }
+    }
+
+
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("Tomcat Web Container", TomcatContainer.class);
 
-        infoFactory.setConstructor(new String[] { "classLoader", "catalinaHome", "EngineGBean", "ServerInfo" });
+        infoFactory.setConstructor(new String[] { "classLoader", "catalinaHome", "EngineGBean", "ServerInfo", "kernel", "objectName" });
 
         infoFactory.addAttribute("classLoader", ClassLoader.class, false);
+        infoFactory.addAttribute("kernel", Kernel.class, false);
+        infoFactory.addAttribute("objectName", String.class, false);
 
         infoFactory.addAttribute("catalinaHome", String.class, true);
 
@@ -350,6 +512,7 @@
         infoFactory.addOperation("removeConnector", new Class[] { Connector.class });
 
         infoFactory.addInterface(SoapHandler.class);
+        infoFactory.addInterface(TomcatWebContainer.class);
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java Thu Aug 18 11:08:26 2005
@@ -37,9 +37,9 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.j2ee.management.J2EEApplication;
-import org.apache.geronimo.j2ee.management.J2EEServer;
-import org.apache.geronimo.j2ee.management.WebModule;
+import org.apache.geronimo.management.J2EEApplication;
+import org.apache.geronimo.management.J2EEServer;
+import org.apache.geronimo.management.WebModule;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;

Added: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebConnector.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebConnector.java?rev=233346&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebConnector.java (added)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebConnector.java Thu Aug 18 11:08:26 2005
@@ -0,0 +1,25 @@
+package org.apache.geronimo.tomcat;
+
+import org.apache.geronimo.management.geronimo.WebConnector;
+
+/**
+ * Tomcat-specific connector properties.  For full documentation on all the
+ * available properties (not all are exposed yet), see
+ * http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html
+ *
+ * @version $Revision: 1.0$
+ */
+public interface TomcatWebConnector extends WebConnector {
+    public int getMinSpareThreads();
+    public void setMinSpareThreads(int threads);
+    public int getMaxSpareThreads();
+    public void setMaxSpareThreads(int threads);
+    public int getMaxHttpHeaderSizeBytes();
+    public void setMaxHttpHeaderSizeBytes(int bytes);
+    public boolean isHostLookupEnabled();
+    public void setHostLookupEnabled(boolean enabled);
+    public int getConnectionTimeoutMillis();
+    public void setConnectionTimeoutMillis(int millis);
+    public boolean isUploadTimeoutEnabled();
+    public void setUploadTimeoutEnabled(boolean enabled);
+}

Added: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebContainer.java?rev=233346&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebContainer.java (added)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebContainer.java Thu Aug 18 11:08:26 2005
@@ -0,0 +1,9 @@
+package org.apache.geronimo.tomcat;
+
+import org.apache.geronimo.management.geronimo.WebContainer;
+
+/**
+ * @version $Revision: 1.0$
+ */
+public interface TomcatWebContainer extends WebContainer {
+}

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java (original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java Thu Aug 18 11:08:26 2005
@@ -50,7 +50,7 @@
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.security.realm.GenericSecurityRealm;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
@@ -324,7 +324,7 @@
 
         //ServerInfo
         serverInfoName = new ObjectName("geronimo.system:role=ServerInfo");
-        serverInfoGBean = new GBeanData(serverInfoName, ServerInfo.GBEAN_INFO);
+        serverInfoGBean = new GBeanData(serverInfoName, BasicServerInfo.GBEAN_INFO);
         serverInfoGBean.setAttribute("baseDirectory", ".");
 
         start(serverInfoGBean);
@@ -370,14 +370,11 @@
         container.setReferencePattern("EngineGBean", engineName);
         container.setReferencePattern("ServerInfo", serverInfoName);
 
-        initParams.clear();
-        initParams.put("port","8080");
-        initParams.put("address","0.0.0.0");
         connector = new GBeanData(connectorName, ConnectorGBean.GBEAN_INFO);
-        connector.setAttribute("initParams", initParams);
+        connector.setAttribute("port", new Integer(8080));
+        connector.setAttribute("host", "localhost");
         connector.setAttribute("name", "HTTP");
         connector.setReferencePattern("TomcatContainer", containerName);
-        connector.setReferencePattern("ServerInfo", serverInfoName);
 
         start(container);
         start(connector);

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java (original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java Thu Aug 18 11:08:26 2005
@@ -47,7 +47,7 @@
 import org.apache.geronimo.security.jaas.JaasLoginService;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
 import org.apache.geronimo.security.realm.GenericSecurityRealm;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.tomcat.app.MockWebServiceContainer;
 import org.apache.geronimo.webservices.WebServiceContainer;
 
@@ -252,7 +252,7 @@
  
        //ServerInfo
        serverInfoName = new ObjectName("geronimo.system:role=ServerInfo");
-       serverInfoGBean = new GBeanData(serverInfoName, ServerInfo.GBEAN_INFO);
+       serverInfoGBean = new GBeanData(serverInfoName, BasicServerInfo.GBEAN_INFO);
        serverInfoGBean.setAttribute("baseDirectory", ".");
        start(serverInfoGBean);
        
@@ -288,14 +288,11 @@
        container.setReferencePattern("ServerInfo", serverInfoName);
        start(container);
 
-       initParams.clear();
-       initParams.put("port","8080");
        connector = new GBeanData(connectorName, ConnectorGBean.GBEAN_INFO);
        connector.setAttribute("name", "HTTP");
-       connector.setAttribute("initParams", initParams);
+       connector.setAttribute("port", new Integer(8080));
        connector.setReferencePattern("TomcatContainer", containerName);
-       connector.setReferencePattern("ServerInfo", serverInfoName);
-       start(connector);       
+       start(connector);
    }
    
    private void tearDownWeb() throws Exception {

Modified: geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java (original)
+++ geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java Thu Aug 18 11:08:26 2005
@@ -25,7 +25,7 @@
 import org.apache.geronimo.transaction.manager.TransactionLog;
 import org.apache.geronimo.transaction.manager.XidFactory;
 import org.apache.geronimo.transaction.manager.XidFactoryImpl;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 
 /**
  *
@@ -62,7 +62,7 @@
                 2, //                "maxLogFiles",
                 2, //                "minBuffers",
                 10,//                "threadsWaitingForceThreshold"});
-                xidFactory, new ServerInfo(new File(basedir, "target").getAbsolutePath())
+                xidFactory, new BasicServerInfo(new File(basedir, "target").getAbsolutePath())
         );
         howlLog.doStart();
         return howlLog;

Modified: geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java?rev=233346&r1=233345&r2=233346&view=diff
==============================================================================
--- geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java (original)
+++ geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java Thu Aug 18 11:08:26 2005
@@ -20,7 +20,7 @@
 import java.io.File;
 
 import org.apache.geronimo.transaction.log.HOWLLog;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 import junit.extensions.TestSetup;
@@ -72,7 +72,7 @@
                 2, //                "minBuffers",
                 10,//                "threadsWaitingForceThreshold"});
                 xidFactory,
-                new ServerInfo(targetDir)
+                new BasicServerInfo(targetDir)
         );
         howlLog.doStart();
         txLog = howlLog;



Mime
View raw message