You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@locus.apache.org on 2000/11/30 10:10:13 UTC

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup CatalinaManager.java CatalinaManagerMBean.java

remm        00/11/30 01:10:12

  Modified:    catalina/src/share/org/apache/catalina/startup
                        CatalinaManager.java CatalinaManagerMBean.java
  Log:
  - JMX wrapper needed an update to adapt to the classloader changes which
    occured since when it was written.
  
  Revision  Changes    Path
  1.2       +16 -46    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaManager.java
  
  Index: CatalinaManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CatalinaManager.java	2000/09/30 22:35:24	1.1
  +++ CatalinaManager.java	2000/11/30 09:10:10	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaManager.java,v 1.1 2000/09/30 22:35:24 remm Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/09/30 22:35:24 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaManager.java,v 1.2 2000/11/30 09:10:10 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/11/30 09:10:10 $
    *
    * ====================================================================
    *
  @@ -72,9 +72,12 @@
   
   /**
    * Implementation of the Catalina JMX MBean as a wrapper of the Catalina class.
  + * To be used, the JAR containing this MBean should contain all the classes 
  + * which are present in bootstrap.jar. The setPath(String path) method should 
  + * be used to set the correct path where the Tomcat distribution is.
    * 
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   
   public final class CatalinaManager
  @@ -97,12 +100,6 @@
       private long sequenceNumber = 0;
       
       
  -    /**
  -     * Catalina wrapper.
  -     */
  -    private CatalinaWrapper catalina = new CatalinaWrapper();
  -    
  -    
       // ---------------------------------------------- MBeanRegistration Methods
       
       
  @@ -156,18 +153,18 @@
       
       
       /**
  -     * Config file path accessor.
  +     * Path accessor.
        */
  -    public String getConfigFile() {
  -        return catalina.getConfigFile();
  +    public String getPath() {
  +        return System.getProperty("catalina.home");
       }
       
       
       /**
        * Config file path mutator.
        */
  -    public void setConfigFile(String configFile) {
  -        catalina.setConfigFile(configFile);
  +    public void setPath(String path) {
  +        System.setProperty("catalina.home", path);
       }
       
       
  @@ -194,7 +191,8 @@
           
           try {
               
  -            catalina.start();
  +            String[] args = { "start" };
  +            Bootstrap.main(args);
               
           } catch (Throwable t) {
               state = STOPPED;
  @@ -235,7 +233,8 @@
           
           try {
               
  -            catalina.stop();
  +            String[] args = { "stop" };
  +            Bootstrap.main(args);
               
           } catch (Throwable t) {
               
  @@ -262,35 +261,6 @@
           
           if (getState() != STOPPED)
               stop();
  -        
  -    }
  -    
  -    
  -    // -------------------------------------------- CatalinaWrapper Inner Class
  -    
  -    
  -    private class CatalinaWrapper extends Catalina {
  -        
  -        
  -        public void start() {
  -            super.start();
  -        }
  -        
  -        
  -        public void stop() {
  -            super.stop();
  -        }
  -        
  -        
  -        public String getConfigFile() {
  -            return configFile;
  -        }
  -        
  -        
  -        public void setConfigFile(String configFile) {
  -            this.configFile = configFile;
  -        }
  -        
           
       }
       
  
  
  
  1.2       +9 -6      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaManagerMBean.java
  
  Index: CatalinaManagerMBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaManagerMBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CatalinaManagerMBean.java	2000/09/30 22:35:24	1.1
  +++ CatalinaManagerMBean.java	2000/11/30 09:10:11	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaManagerMBean.java,v 1.1 2000/09/30 22:35:24 remm Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/09/30 22:35:24 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaManagerMBean.java,v 1.2 2000/11/30 09:10:11 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/11/30 09:10:11 $
    *
    * ====================================================================
    *
  @@ -65,9 +65,12 @@
   
   /**
    * Catalina MBean interface.
  + * To be used, the JAR containing this MBean should contain all the classes 
  + * which are present in bootstrap.jar. The setPath(String path) method should 
  + * be used to set the correct path where the Tomcat distribution is.
    * 
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   
   public interface CatalinaManagerMBean {
  @@ -123,15 +126,15 @@
       
       
       /**
  -     * Config file path accessor.
  +     * Path accessor.
        */
  -    public String getConfigFile();
  +    public String getPath();
       
       
       /**
  -     * Config file path mutator.
  +     * Path mutator.
        */
  -    public void setConfigFile(String configFile);
  +    public void setPath(String Path);
       
       
       /**