tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardEngine.java
Date Sat, 05 Apr 2003 04:00:32 GMT
costin      2003/04/04 20:00:32

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardEngine.java
  Log:
  A bit of a hack for now. When the engine is destroyed it should clean up
  the data that it loaded in registry - otherwise a start would see the
  old data.
  
  The real solution is to stop using the static methods in Registry. The registry
  is just a helper associated with the app. This will also be more secure.
  
  In any case - for next release of modeler the static methods will be deprecated
  and the method that loads explicitely an mbean-descriptor will also be deprecated.
  It is much cleaner to load the descriptors on demand, from the same package.
  
  Revision  Changes    Path
  1.10      +15 -13    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardEngine.java
  
  Index: StandardEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardEngine.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- StandardEngine.java	4 Apr 2003 22:46:17 -0000	1.9
  +++ StandardEngine.java	5 Apr 2003 04:00:32 -0000	1.10
  @@ -65,23 +65,17 @@
   package org.apache.catalina.core;
   
   
  -import java.io.IOException;
  -import javax.servlet.ServletException;
  -import javax.servlet.ServletRequest;
  -import javax.servlet.http.HttpServletResponse;
  -import javax.management.ObjectName;
   import javax.management.MBeanServer;
   import javax.management.MalformedObjectNameException;
  +import javax.management.ObjectName;
   import org.apache.catalina.Container;
   import org.apache.catalina.Context;
   import org.apache.catalina.DefaultContext;
   import org.apache.catalina.Engine;
   import org.apache.catalina.Host;
   import org.apache.catalina.LifecycleException;
  -import org.apache.catalina.Request;
  -import org.apache.catalina.Response;
  -import org.apache.catalina.Service;
   import org.apache.catalina.Realm;
  +import org.apache.catalina.Service;
   import org.apache.catalina.realm.JAASRealm;
   import org.apache.catalina.util.ServerInfo;
   import org.apache.commons.logging.Log;
  @@ -385,6 +379,7 @@
                   domain=getName();
                   log.info( "Register " + domain );
                   oname=new ObjectName(domain + ":type=Engine");
  +                controller=oname;
                   Registry.getRegistry().registerComponent(this, oname, null);
               } catch( Throwable t ) {
                   log.info("Error registering ", t );
  @@ -422,10 +417,16 @@
           
       }
       
  -    public void destroy() {
  +    public void destroy() throws LifecycleException {
           if( ! initialized ) return;
           initialized=false;
           
  +        // if we created it, make sure it's also destroyed
  +        ((StandardService)service).destroy();
  +        // force all metadata to be reloaded.
  +        // That doesn't affect existing beans. We should make it per
  +        // registry - and stop using the static.
  +        Registry.getRegistry().resetMetadata();        
       }
       
       /**
  @@ -505,3 +506,4 @@
       }
   
   }
  +                                                          
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
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