tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net SSLImplementation.java
Date Sun, 13 Apr 2003 22:25:03 GMT
billbarker    2003/04/13 15:25:02

  Modified:    util/java/org/apache/tomcat/util/net SSLImplementation.java
  Log:
  Refactoring ugly hack (I won't be able to test on Solaris until tomorrow).  The Sun Windows
1.4.x JVM has no problems with this (even before ugly hack).
  
  Restoring PureTLS-first logic.  With JSSE shipping with 1.4.x, this is even more important
than before.
  
  Most importently, adding c-l, so that we may be able to track-down the root-cause of the
problem.
  
  Revision  Changes    Path
  1.4       +16 -12    jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/SSLImplementation.java
  
  Index: SSLImplementation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/SSLImplementation.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SSLImplementation.java	13 Apr 2003 14:27:10 -0000	1.3
  +++ SSLImplementation.java	13 Apr 2003 22:25:02 -0000	1.4
  @@ -69,6 +69,9 @@
      @author EKR
   */
   abstract public class SSLImplementation {
  +    private static org.apache.commons.logging.Log logger =
  +        org.apache.commons.logging.LogFactory.getLog(SSLImplementation.class);
  +
       // The default implementations in our search path
       private static final String PureTLSImplementationClass=
   	"org.apache.tomcat.util.net.puretls.PureTLSImplementation";
  @@ -77,28 +80,20 @@
       
       private static final String[] implementations=
       {
  -        JSSEImplementationClass,
  -        PureTLSImplementationClass
  +        PureTLSImplementationClass,
  +        JSSEImplementationClass
       };
   
       public static SSLImplementation getInstance() throws ClassNotFoundException
       {
   	for(int i=0;i<implementations.length;i++){
  -        // Workaround for the J2SE 1.4.x classloading problem (under Solaris).
  -        // Class.forName(..) fails without creating class using new.
  -        // This is an ugly workaround. 
  -        try{
  -            new org.apache.tomcat.util.net.jsse.JSSEImplementation();
  -        }catch (Exception e){
  -            //e.printStackTrace();
  -        }    
  -
   	    try {
                  SSLImplementation impl=
   		    getInstance(implementations[i]);
   		return impl;
   	    } catch (Exception e) {
  -            //e.printStackTrace();
  +		if(logger.isTraceEnabled()) 
  +		    logger.trace("Error creating " + implementations[i],e);
   	    }
   	}
   
  @@ -112,9 +107,18 @@
   	if(className==null) return getInstance();
   
   	try {
  +	    // Workaround for the J2SE 1.4.x classloading problem (under Solaris).
  +	    // Class.forName(..) fails without creating class using new.
  +	    // This is an ugly workaround. 
  +	    if( JSSEImplementationClass.equals(className) ) {
  +		return new org.apache.tomcat.util.net.jsse.JSSEImplementation();
  +	    }
   	    Class clazz=Class.forName(className);
   	    return (SSLImplementation)clazz.newInstance();
   	} catch (Exception e){
  +	    if(logger.isDebugEnabled())
  +		logger.debug("Error loading SSL Implementation "
  +			     +className, e);
   	    throw new ClassNotFoundException("Error loading SSL Implementation "
   				      +className+ " :" +e.toString());
   	}
  
  
  

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