tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amy...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans MBeanFactory.java
Date Thu, 08 Jan 2004 05:32:25 GMT
amyroh      2004/01/07 21:32:25

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardHost.java
               catalina/src/share/org/apache/catalina/mbeans
                        MBeanFactory.java
  Log:
  Fix bugzilla 25878 - Add HostConfig after new Host is created via admin and prevent duplicate
errorReportValve creation after restart.
  Patch submitted by pr@webapp.de (Peter Rossbach).
  
  Revision  Changes    Path
  1.27      +20 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- StandardHost.java	21 Oct 2003 00:18:25 -0000	1.26
  +++ StandardHost.java	8 Jan 2004 05:32:25 -0000	1.27
  @@ -176,6 +176,11 @@
           "org.apache.catalina.valves.ErrorReportValve";
   
       /**
  +     * The object name for the errorReportValve.
  +     */
  +    private ObjectName errorReportValveObjectName = null;
  +
  +    /**
        * The descriptive information string for this implementation.
        */
       private static final String info =
  @@ -798,9 +803,20 @@
           if ((errorReportValveClass != null)
               && (!errorReportValveClass.equals(""))) {
               try {
  -                Valve valve = (Valve) Class.forName(errorReportValveClass)
  -                    .newInstance();
  -                addValve(valve);
  +                boolean found = false;
  +                if(errorReportValveObjectName != null) {
  +                    ObjectName[] names = 
  +                        ((StandardPipeline)pipeline).getValveObjectNames();
  +                    for (int i=0; !found && i<names.length; i++)
  +                        if(errorReportValveObjectName.equals(names[i]))
  +                            found = true ;
  +                    }
  +                    if(!found) {          	
  +                        Valve valve = (Valve) Class.forName(errorReportValveClass)
  +                        .newInstance();
  +                        addValve(valve);
  +                        errorReportValveObjectName = ((ValveBase)valve).getObjectName()
;
  +                    }
               } catch (Throwable t) {
                   log.error(sm.getString
                       ("standardHost.invalidErrorReportValveClass", 
  
  
  
  1.21      +9 -4      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java
  
  Index: MBeanFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- MBeanFactory.java	10 Nov 2003 21:08:09 -0000	1.20
  +++ MBeanFactory.java	8 Jan 2004 05:32:25 -0000	1.21
  @@ -98,6 +98,7 @@
   import org.apache.catalina.realm.UserDatabaseRealm;
   import org.apache.catalina.session.StandardManager;
   import org.apache.catalina.startup.ContextConfig;
  +import org.apache.catalina.startup.HostConfig;
   import org.apache.catalina.valves.AccessLogValve;
   import org.apache.catalina.valves.RemoteAddrValve;
   import org.apache.catalina.valves.RemoteHostValve;
  @@ -921,6 +922,10 @@
           host.setUnpackWARs(unpackWARs);
           host.setXmlNamespaceAware(xmlNamespaceAware);
           host.setXmlValidation(xmlValidation);
  +	
  +        // add HostConfig for active reloading
  +        HostConfig hostConfig = new HostConfig();
  +        host.addLifecycleListener(hostConfig);
   
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
  
  
  

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


Mime
View raw message