tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml
Date Tue, 11 Jan 2005 20:02:14 GMT
pero        2005/01/11 12:02:14

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardServer.java
               modules/storeconfig/src/share/org/apache/catalina/storeconfig
                        StoreConfigLifecycleListener.java
                        server-registry.xml
               modules/storeconfig/test/src/share/org/apache/catalina/storeconfig
                        ManagerSFTest.java
               webapps/docs changelog.xml
  Log:
  Integrate StoreConfig at StandardServer and fix small StoreConfig bugs
  
  Revision  Changes    Path
  1.40      +32 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardServer.java
  
  Index: StandardServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardServer.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- StandardServer.java	25 Oct 2004 15:28:23 -0000	1.39
  +++ StandardServer.java	11 Jan 2005 20:02:13 -0000	1.40
  @@ -41,6 +41,7 @@
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
   import javax.naming.directory.DirContext;
  +import javax.servlet.http.HttpServletResponse;
   
   import org.apache.catalina.Container;
   import org.apache.catalina.Context;
  @@ -87,6 +88,8 @@
    *
    * @author Craig R. McClanahan
    * @version $Revision$ $Date$
  + * TODO remove useless code
  + * TODO test the new save context backuo saving mode!!
    */
   
   public final class StandardServer
  @@ -675,6 +678,17 @@
        */
       public synchronized void storeConfig() throws Exception {
   
  +        ObjectName sname = null;    
  +        try {
  +           sname = new ObjectName("Catalina:type=StoreConfig");
  +           if(mserver.isRegistered(sname)) {
  +               mserver.invoke(sname, "storeConfig", null, null);            
  +           } else
  +               log.error("StoreConfig mbean not registered" + sname);
  +        } catch (Throwable t) {
  +            log.error(t);
  +        }
  +/*
           // Calculate file objects for the old and new configuration files.
           String configFile = "conf/server.xml"; // FIXME - configurable?
           File configOld = new File(configFile);
  @@ -761,7 +775,7 @@
                                     configOld.getAbsolutePath() + " to " +
                                     configSave.getAbsolutePath());
           }
  -
  +*/
       }
   
   
  @@ -777,7 +791,21 @@
        *  by the persistence mechanism
        */
       public synchronized void storeContext(Context context) throws Exception {
  -
  +        
  +        ObjectName sname = null;    
  +        try {
  +           sname = new ObjectName("Catalina:type=StoreConfig");
  +           if(mserver.isRegistered(sname)) {
  +               mserver.invoke(sname, "store",
  +                   new Object[] {context}, 
  +                   new String [] { "java.lang.String"});
  +           } else
  +               log.error("StoreConfig mbean not registered" + sname);
  +        } catch (Throwable t) {
  +            log.error(t);
  +        }
  + 
  +     /*   
           String configFile = context.getConfigFile();
   
           if (configFile != null) {
  @@ -820,7 +848,7 @@
                   throw (e);
               }
           }
  -
  +*/
       }
   
   
  
  
  
  1.2       +1 -1      jakarta-tomcat-catalina/modules/storeconfig/src/share/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
  
  Index: StoreConfigLifecycleListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/modules/storeconfig/src/share/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StoreConfigLifecycleListener.java	8 Jan 2005 11:14:07 -0000	1.1
  +++ StoreConfigLifecycleListener.java	11 Jan 2005 20:02:13 -0000	1.2
  @@ -84,7 +84,7 @@
           MBeanServer mserver = MBeanUtils.createServer();
           InputStream descriptor = null;
           try {
  -            ObjectName objectName = new ObjectName("Catalina:type=StoreConfig,resource=\""
+loader.getRegistryResource()+ "\"");
  +            ObjectName objectName = new ObjectName("Catalina:type=StoreConfig" );
               if (!mserver.isRegistered(objectName)) {
                   descriptor = this.getClass().getResourceAsStream(
                           "mbeans-descriptors.xml");
  
  
  
  1.2       +4 -4      jakarta-tomcat-catalina/modules/storeconfig/src/share/org/apache/catalina/storeconfig/server-registry.xml
  
  Index: server-registry.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/modules/storeconfig/src/share/org/apache/catalina/storeconfig/server-registry.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- server-registry.xml	8 Jan 2005 11:14:07 -0000	1.1
  +++ server-registry.xml	11 Jan 2005 20:02:13 -0000	1.2
  @@ -95,7 +95,7 @@
   	    tag="Manager"
   		standard="false"
   		default="false" 
  -		tagClass="org.apache.catalina.session.Manager"
  +		tagClass="org.apache.catalina.Manager"
           storeFactoryClass="org.apache.catalina.storeconfig.ManagerSF">
   	    <TransientAttribute>entropy</TransientAttribute>
   	    <TransientAttribute>distributable</TransientAttribute>
  @@ -234,9 +234,9 @@
           <TransientAttribute>cacheTTL</TransientAttribute>
           <TransientAttribute>cached</TransientAttribute>
           <TransientAttribute>caseSensitive</TransientAttribute>
  -        <TransientChild>org.apache.naming.resoures.WARDirContext</TransientChild>
  -        <TransientChild>org.apache.naming.resoures.FileDirContext</TransientChild>
  -        <TransientChild>org.apache.naming.resoures.ProxyDirContext</TransientChild>
  +        <TransientChild>org.apache.naming.resources.WARDirContext</TransientChild>
  +        <TransientChild>org.apache.naming.resources.FileDirContext</TransientChild>
  +        <TransientChild>org.apache.naming.resources.ProxyDirContext</TransientChild>
        </Description>
        <Description
   	    tag="ResourceEnvRef"
  
  
  
  1.2       +8 -5      jakarta-tomcat-catalina/modules/storeconfig/test/src/share/org/apache/catalina/storeconfig/ManagerSFTest.java
  
  Index: ManagerSFTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/modules/storeconfig/test/src/share/org/apache/catalina/storeconfig/ManagerSFTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ManagerSFTest.java	8 Jan 2005 11:14:08 -0000	1.1
  +++ ManagerSFTest.java	11 Jan 2005 20:02:14 -0000	1.2
  @@ -20,10 +20,8 @@
   
   import junit.framework.TestCase;
   
  +import org.apache.catalina.Manager;
   import org.apache.catalina.session.StandardManager;
  -import org.apache.catalina.storeconfig.ManagerSF;
  -import org.apache.catalina.storeconfig.StoreDescription;
  -import org.apache.catalina.storeconfig.StoreRegistry;
   
   /**
    * @author Peter Rossbach
  @@ -52,8 +50,8 @@
           super.setUp();
           registry = new StoreRegistry();
           desc = DescriptorHelper.registerDescriptor(null, registry,
  -                StandardManager.class.getName(), "Manager",
  -                StandardManager.class.getName(),
  +                Manager.class.getName(), "Manager",
  +                Manager.class.getName(),
                   "org.apache.catalina.storeconfig.ManagerSF", false, false);
           desc.addTransientAttribute("entropy");
           desc.addTransientAttribute("distributable");
  @@ -62,6 +60,11 @@
   
       }
   
  +    public void testFindStandardManager() {
  +        StoreDescription managerdesc = registry.findDescription(manager.getClass());
  +        assertEquals(desc,managerdesc);
  +    }
  +    
       public void testManagerNonStandardStore() throws Exception {
           assertTrue(factory.isDefaultManager(manager));
           manager.setMaxActiveSessions(100);
  
  
  
  1.216     +3 -0      jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.215
  retrieving revision 1.216
  diff -u -r1.215 -r1.216
  --- changelog.xml	11 Jan 2005 14:53:26 -0000	1.215
  +++ changelog.xml	11 Jan 2005 20:02:14 -0000	1.216
  @@ -44,6 +44,9 @@
   
     <subsection name="Catalina">
       <changelog>
  +      <update>
  +         First integration at StoreConfig to StandardServer (pero)
  +      </update>
         <fix>
           <bug>32714 </bug>: Don't make the AccessLogValve final (funkman)
         </fix>
  
  
  

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