billbarker    01/11/17 22:20:57

  Modified:    src/share/org/apache/tomcat/startup EmbededTomcat.java
  Log:
  Set the URLStreamHandlerFactory to allow webapps to create https URLS.
  
  With this servlets can create a java.net.URL("https:/...") with JSSE/OpenTLS either 
installed not on the system ClassLoader, or missing altogether.
  
  I also added a (very dangerous) shutdown method, to aid developers who want the 
"advanced" features.  It is never called from a normal Tomcat.  It is only for people 
that embed Tomcat in other applications.  I'm agreeing with Remy here that adding an 
API that should have been there all along is not that big of a deal.
  
  Revision  Changes    Path
  1.60      +14 -0     
jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java
  
  Index: EmbededTomcat.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- EmbededTomcat.java        2001/10/13 04:26:54     1.59
  +++ EmbededTomcat.java        2001/11/18 06:20:57     1.60
  @@ -441,6 +441,10 @@
                                         modules.elementAt( i ) );
            }
            contextM.init();
  +         Class shfc = containerCL.loadClass(
  +                         "org.apache.tomcat.util.net.StreamHandlerFactory");
  +                 URL.setURLStreamHandlerFactory(
  +                              (URLStreamHandlerFactory)shfc.newInstance());
        } catch( Throwable ex ) {
            if( ex instanceof InvocationTargetException ) {
                ex=((InvocationTargetException)ex).getTargetException();
  @@ -462,6 +466,16 @@
        contextM.start();
        long time4=System.currentTimeMillis();
        debug("Startup time " + ( time4-time3 ));
  +    }
  +
  +    /** Shutdown contextM - <em>may</em> exit the VM.
  +     *  This method is <b>intrinsically dangerous</b>, so use at your own
  +     *  risk.  It is very possible that the entire VM will shut down after 
  +     *  calling this method. You should only call this method if you need
  +     *  to implement <em>advanced</em> functionality.
  +     */
  +    public void shutdown() throws TomcatException {
  +     contextM.shutdown();
       }
   
       /** Stop contextM - will not exit the VM.
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to