tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r463969 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardHost.java
Date Sat, 14 Oct 2006 16:14:50 GMT
Author: pero
Date: Sat Oct 14 09:14:48 2006
New Revision: 463969

URL: http://svn.apache.org/viewvc?view=rev&rev=463969
Log:
Make deployer class configureable. 

Modified:
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardHost.java

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardHost.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardHost.java?view=diff&rev=463969&r1=463968&r2=463969
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardHost.java
(original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardHost.java
Sat Oct 14 09:14:48 2006
@@ -92,7 +92,13 @@
     private String configClass =
         "org.apache.catalina.startup.ContextConfig";
 
+    /**
+     * The Java class name of the default host config configuration class (deployer)
+     */
+    private String hostConfigClass =
+        "org.apache.catalina.startup.HostConfig";
 
+        
     /**
      * The Java class name of the default Context implementation class for
      * deployed web applications.
@@ -243,8 +249,32 @@
 
     }
 
+    
+    /**
+     * Return the Java class name of the host configuration class (deployer)
+     */
+    public String getHostConfigClass() {
+
+        return (this.hostConfigClass);
+
+    }
+
 
     /**
+     * Set the Java class name of the host config configuration class (deployer)
+     *
+     * @param hostConfigClass The new host config configuration class (deployer)
+     */
+    public void setHostConfigClass(String hostConfigClass) {
+
+        String oldHostConfigClass = this.hostConfigClass;
+        this.hostConfigClass = hostConfigClass;
+        support.firePropertyChange("hostConfigClass",
+                                   oldHostConfigClass, this.hostConfigClass);
+    }
+
+    
+    /**
      * Return the Java class name of the Context implementation class
      * for new web applications.
      */
@@ -758,7 +788,19 @@
                 ObjectName serviceName=new ObjectName(domain + 
                                         ":type=Engine");
 
-                HostConfig deployer = new HostConfig();
+                HostConfig deployer = null;
+                try {
+                    String hostConfigClassname = getHostConfigClass();
+                    if (hostConfigClassname != null) {
+                        Class clazz = Class.forName(hostConfigClassname);
+                        deployer = (HostConfig) clazz.newInstance();
+                    } else {
+                        deployer = new HostConfig();
+                    }
+                } catch (Exception e) {
+                    log.warn("Error creating HostConfig for host " + name, e);
+                    throw e;
+                }
                 addLifecycleListener(deployer);                
                 if( mserver.isRegistered( serviceName )) {
                     if(log.isDebugEnabled())



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message