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/startup Bootstrap.java
Date Mon, 02 Dec 2002 21:33:12 GMT
costin      2002/12/02 13:33:12

  Modified:    catalina/src/share/org/apache/catalina/startup
                        Bootstrap.java
  Log:
  Few changes to make Bootstrap useable as an MBean ( via modeler )
  This allows tomcat to be embeded using its own class loader hierarchy
  ( i.e. the embedding app will not need to have tomcat classes in the
  main loader ).
  
  Given that most of the admin operations will be exposed via MBeans
  there is little need for the app to see tomcat internals. However
  some interfaces or classes may be needed. This can be tuned by adding
  classes and libs to the parent loader.
  
  In general all tomcat .jars should work in either parent loader or in
  the server loader.
  
  Revision  Changes    Path
  1.9       +26 -9     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Bootstrap.java
  
  Index: Bootstrap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Bootstrap.java	2 Dec 2002 10:38:11 -0000	1.8
  +++ Bootstrap.java	2 Dec 2002 21:33:12 -0000	1.9
  @@ -1,8 +1,4 @@
   /*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
  @@ -195,8 +191,9 @@
       /**
        * Initialize daemon.
        */
  -    private void init()
  -        throws Exception {
  +    public void init()
  +        throws Exception
  +    {
   
           // Set Catalina path
           setCatalinaHome();
  @@ -290,6 +287,7 @@
        */
       public void start()
           throws Exception {
  +        if( catalinaDaemon==null ) init();
   
           Method method = catalinaDaemon.getClass().getMethod("start", null);
           method.invoke(catalinaDaemon, null);
  @@ -338,6 +336,17 @@
   
       }
   
  +    public boolean getAwait()
  +        throws Exception
  +    {
  +        Class paramTypes[] = new Class[0];
  +        Object paramValues[] = new Object[0];
  +        Method method =
  +            catalinaDaemon.getClass().getMethod("getAwait", paramTypes);
  +        Boolean b=(Boolean)method.invoke(catalinaDaemon, paramValues);
  +        return b.booleanValue();
  +    }
  +
   
       /**
        * Destroy the Catalina Daemon.
  @@ -388,6 +397,14 @@
   
       }
   
  +    public void setCatalinaHome(String s) {
  +        System.setProperty( "catalina.home", s );
  +    }
  +
  +    public void setCatalinaBase(String s) {
  +        System.setProperty( "catalina.base", s );
  +    }
  +
   
       /**
        * Set the <code>catalina.base</code> System property to the current
  @@ -424,7 +441,7 @@
       /**
        * Get the value of the catalina.home environment variable.
        */
  -    protected static String getCatalinaHome() {
  +    public static String getCatalinaHome() {
           return System.getProperty("catalina.home",
                                     System.getProperty("user.dir"));
       }
  @@ -433,7 +450,7 @@
       /**
        * Get the value of the catalina.base environment variable.
        */
  -    protected static String getCatalinaBase() {
  +    public static String getCatalinaBase() {
           return System.getProperty("catalina.base", getCatalinaHome());
       }
   
  
  
  

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


Mime
View raw message