geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r232753 - in /geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat: EngineGBean.java HostGBean.java
Date Mon, 15 Aug 2005 04:24:17 GMT
Author: jgenender
Date: Sun Aug 14 21:24:14 2005
New Revision: 232753

URL: http://svn.apache.org/viewcvs?rev=232753&view=rev
Log:
Validations of the initParams

Modified:
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HostGBean.java

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java?rev=232753&r1=232752&r2=232753&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java Sun
Aug 14 21:24:14 2005
@@ -39,7 +39,10 @@
 public class EngineGBean extends BaseGBean implements GBeanLifecycle, ObjectRetriever {
     
     private static final Log log = LogFactory.getLog(EngineGBean.class);
-   
+
+    private static final String NAME = "name";
+    private static final String DEFAULTHOST = "defaultHost";
+    
     private final Engine engine;
 
     public EngineGBean(String className, 
@@ -51,6 +54,20 @@
         
         if (className == null){
             className = "org.apache.geronimo.tomcat.TomcatEngine";
+        }
+
+        if (initParams == null){
+            throw new IllegalArgumentException("Must have 'name' and 'defaultHost' values
in initParams.");
+        }
+        
+        //Be sure the name has been declared.
+        if (!initParams.containsKey(NAME)){
+            throw new IllegalArgumentException("Must have a 'name' value initParams.");
+        }
+
+        //Be sure the defaulthost has been declared.
+        if (!initParams.containsKey(DEFAULTHOST)){
+            throw new IllegalArgumentException("Must have a 'defaultHost' value initParams.");
         }
         
         engine = (Engine)Class.forName(className).newInstance();

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HostGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HostGBean.java?rev=232753&r1=232752&r2=232753&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HostGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HostGBean.java Sun Aug
14 21:24:14 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.tomcat;
 
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.catalina.Host;
@@ -37,6 +38,8 @@
     private static final Log log = LogFactory.getLog(HostGBean.class);
     
     public static final String J2EE_TYPE = "Host";
+    private static final String WORKDIR = "workDir";
+    private static final String NAME = "name";
     
     private final Host host;
 
@@ -51,6 +54,20 @@
             className = "org.apache.catalina.core.StandardHost";
         }
         
+        if (initParams == null){
+            throw new IllegalArgumentException("Must have a 'name' value in initParams.");
+        }
+        
+        //Be sure the name has been declared.
+        if (!initParams.containsKey(NAME)){
+            throw new IllegalArgumentException("Must have a 'name' value initParams.");
+        }
+        
+        //Be sure we have a default working directory
+        if (!initParams.containsKey(WORKDIR)){
+            initParams.put(WORKDIR, "work");
+        }
+
         //Create the Host object
         host = (Host)Class.forName(className).newInstance();
         



Mime
View raw message