You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pe...@apache.org on 2004/12/01 12:07:16 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java mbeans-descriptors.xml

pero        2004/12/01 03:07:16

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardContext.java mbeans-descriptors.xml
  Log:
  Add some log.isXXXEnabled
  
  Revision  Changes    Path
  1.157     +35 -19    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.156
  retrieving revision 1.157
  diff -u -r1.156 -r1.157
  --- StandardContext.java	26 Oct 2004 23:43:44 -0000	1.156
  +++ StandardContext.java	1 Dec 2004 11:07:16 -0000	1.157
  @@ -1306,7 +1306,8 @@
           String loginPage = config.getLoginPage();
           if ((loginPage != null) && !loginPage.startsWith("/")) {
               if (isServlet22()) {
  -                log.debug(sm.getString("standardContext.loginConfig.loginWarning",
  +                if(log.isDebugEnabled())
  +                    log.debug(sm.getString("standardContext.loginConfig.loginWarning",
                                    loginPage));
                   config.setLoginPage("/" + loginPage);
               } else {
  @@ -1318,7 +1319,8 @@
           String errorPage = config.getErrorPage();
           if ((errorPage != null) && !errorPage.startsWith("/")) {
               if (isServlet22()) {
  -                log.debug(sm.getString("standardContext.loginConfig.errorWarning",
  +                if(log.isDebugEnabled())
  +                    log.debug(sm.getString("standardContext.loginConfig.errorWarning",
                                    errorPage));
                   config.setErrorPage("/" + errorPage);
               } else {
  @@ -1869,7 +1871,8 @@
           String jspFile = wrapper.getJspFile();
           if ((jspFile != null) && !jspFile.startsWith("/")) {
               if (isServlet22()) {
  -                log.debug(sm.getString("standardContext.wrapper.warning", 
  +                if(log.isDebugEnabled())
  +                    log.debug(sm.getString("standardContext.wrapper.warning", 
                                          jspFile));
                   wrapper.setJspFile("/" + jspFile);
               } else {
  @@ -1939,7 +1942,8 @@
           String location = errorPage.getLocation();
           if ((location != null) && !location.startsWith("/")) {
               if (isServlet22()) {
  -                log.debug(sm.getString("standardContext.errorPage.warning",
  +                if(log.isDebugEnabled())
  +                    log.debug(sm.getString("standardContext.errorPage.warning",
                                    location));
                   errorPage.setLocation("/" + location);
               } else {
  @@ -2064,7 +2068,8 @@
           if( findChild(servletName) != null) {
               addServletMapping(pattern, servletName, true);
           } else {
  -            log.debug("Skiping " + pattern + " , no servlet " + servletName);
  +            if(log.isDebugEnabled())
  +                log.debug("Skiping " + pattern + " , no servlet " + servletName);
           }
       }
   
  @@ -2899,7 +2904,8 @@
           //      if (!reloadable)
           //          throw new IllegalStateException
           //              (sm.getString("standardContext.notReloadable"));
  -        log.info(sm.getString("standardContext.reloadingStarted"));
  +        if(log.isInfoEnabled())
  +            log.info(sm.getString("standardContext.reloadingStarted"));
   
           // Stop accepting requests temporarily
           setPaused(true);
  @@ -3837,7 +3843,8 @@
       public synchronized void start() throws LifecycleException {
           //if (lazy ) return;
           if (started) {
  -            log.info(sm.getString("containerBase.alreadyStarted", logName()));
  +            if(log.isInfoEnabled())
  +                log.info(sm.getString("containerBase.alreadyStarted", logName()));
               return;
           }
           if( !initialized ) { 
  @@ -3847,8 +3854,8 @@
                   throw new LifecycleException("Error initializaing ", ex);
               }
           }
  -
  -        log.debug("Starting " + ("".equals(getName()) ? "ROOT" : getName()));
  +        if(log.isDebugEnabled())
  +            log.debug("Starting " + ("".equals(getName()) ? "ROOT" : getName()));
   
           // Set JMX object name for proper pipeline registration
           preRegisterJMX();
  @@ -3902,7 +3909,8 @@
                       );            
                   }
               } catch( Throwable t ) {
  -                log.debug("No realm for this host " + realmName);
  +                if(log.isDebugEnabled())
  +                    log.debug("No realm for this host " + realmName);
               }
           }
           
  @@ -4169,7 +4177,8 @@
               oos.close();
               fos.close();
           } catch( Throwable t ) {
  -            log.info("Error saving context.ser ", t);
  +            if(log.isInfoEnabled())
  +                log.info("Error saving context.ser ", t);
           }
       }
   
  @@ -4364,7 +4373,8 @@
           startupTime = 0;
           startTime = 0;
           tldScanTime = 0;
  -        log.debug("resetContext " + oname + " " + mserver);
  +        if(log.isDebugEnabled())
  +            log.debug("resetContext " + oname + " " + mserver);
       }
   
       /**
  @@ -4404,7 +4414,8 @@
               return (urlPattern);
           if (!isServlet22())
               return (urlPattern);
  -        log.debug(sm.getString("standardContext.urlPattern.patternWarning",
  +        if(log.isDebugEnabled())
  +            log.debug(sm.getString("standardContext.urlPattern.patternWarning",
                            urlPattern));
           return ("/" + urlPattern);
   
  @@ -4917,7 +4928,8 @@
                   controller = oname;
               }
           } catch(Exception ex) {
  -            log.info("Error registering ctx with jmx " + this + " " +
  +            if(log.isInfoEnabled())
  +                log.info("Error registering ctx with jmx " + this + " " +
                        oname + " " + ex.toString(), ex );
           }
       }
  @@ -4947,7 +4959,8 @@
                   ((StandardWrapper)children[i]).registerJMX( this );
               }
           } catch (Exception ex) {
  -            log.info("Error registering wrapper with jmx " + this + " " +
  +            if(log.isInfoEnabled())
  +                log.info("Error registering wrapper with jmx " + this + " " +
                       oname + " " + ex.toString(), ex );
           }
       }
  @@ -4990,7 +5003,8 @@
               ObjectName parentName=getParentName();
               
               if( ! mserver.isRegistered(parentName)) {
  -                log.debug("No host, creating one " + parentName);
  +                if(log.isDebugEnabled())
  +                    log.debug("No host, creating one " + parentName);
                   StandardHost host=new StandardHost();
                   host.setName(hostName);
                   host.setAutoDeploy(false);
  @@ -5001,7 +5015,8 @@
               ContextConfig config = new ContextConfig();
               this.addLifecycleListener(config);
   
  -            log.debug( "AddChild " + parentName + " " + this);
  +            if(log.isDebugEnabled())
  +                 log.debug( "AddChild " + parentName + " " + this);
               try {
                   mserver.invoke(parentName, "addChild", new Object[] { this },
                                  new String[] {"org.apache.catalina.Container"});
  @@ -5047,7 +5062,8 @@
                   this.setName(path);
               }
           } else {
  -            log.debug("Setting path " +  path );
  +            if(log.isDebugEnabled())
  +                log.debug("Setting path " +  path );
               this.setName( path );
           }
           // XXX The service and domain should be the same.
  
  
  
  1.41      +3 -3      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/mbeans-descriptors.xml
  
  Index: mbeans-descriptors.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/mbeans-descriptors.xml,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- mbeans-descriptors.xml	5 Nov 2004 18:19:56 -0000	1.40
  +++ mbeans-descriptors.xml	1 Dec 2004 11:07:16 -0000	1.41
  @@ -252,19 +252,19 @@
       </operation>
       
       <operation   name="start"
  -               description="Start the contex"
  +               description="Start the context"
                  impact="ACTION"
                  returnType="void">
       </operation>
       
       <operation name="stop"
  -               description="Stop the contex"
  +               description="Stop the context"
                  impact="ACTION"
                  returnType="void">
       </operation>
       
       <operation name="destroy"
  -               description="Destroy the contex"
  +               description="Destroy the context"
                  impact="ACTION"
                  returnType="void">
       </operation>
  
  
  

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