costin      02/04/18 10:42:26

  Modified:    jk/java/org/apache/jk/apr AprImpl.java
  Log:
  Removed the startup hack.
  
  Added a property to check if apr is loaded.
  
  Revision  Changes    Path
  1.10      +6 -75     jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java
  
  Index: AprImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AprImpl.java      18 Apr 2002 00:14:34 -0000      1.9
  +++ AprImpl.java      18 Apr 2002 17:42:26 -0000      1.10
  @@ -155,11 +155,15 @@
               
               initialize();
           } catch( Throwable t ) {
  -            log.error("Native code not initialized, disabling UnixSocket and JNI 
channels: " + t.toString());
  -            return;
  +            throw new IOException( t.getMessage() );
           }
  +        ok=true;
       }
   
  +    public boolean isLoaded() {
  +        return ok;
  +    }
  +    
       /** This method of loading the libs doesn't require setting
        *   LD_LIBRARY_PATH. Assuming a 'right' binary distribution,
        *   or a correct build all files will be in their right place.
  @@ -206,77 +210,4 @@
               ex.printStackTrace();
           }
       }
  -
  -    // Hack for Catalina who hungs the calling thread.
  -    public static void main( String args[] ) {
  -        System.err.println("Main");
  -        try {
  -            // Find the class
  -            Class c=null;
  -            int i=0;
  -
  -            for( i=0; i<args.length; i++ ) {
  -                String classN=args[i];
  -                if( "-".equals( classN ) ) {
  -                    // end of options.
  -                    break;
  -                }
  -                if( c!=null ) continue;
  -                try {
  -                    System.err.println("Try " + classN);
  -                    c=Class.forName( classN );
  -                } catch( ClassNotFoundException ex  ) {
  -                    continue;
  -                }
  -            }
  -
  -            i++;
  -            if( c==null ) {
  -                System.err.println("No class found ");
  -                return;
  -            }
  -            
  -            if( args.length >= i ) {
  -                String newArgs[]=new String[ args.length - i  ];
  -                System.out.println("Replacing args: " + i + " " + args.length);
  -                for( int j=0; j<newArgs.length; j++ ) {
  -                    newArgs[j]=args[i+j];
  -                    System.out.println("ARG: " + newArgs[j]);
  -                }
  -                args=newArgs;
  -            } else {
  -                System.out.println("No extra args: " + i + " " + args.length);
  -                args=new String[0];
  -            }
  -                
  -                System.err.println("Starting");
  -                Thread startThread=new Thread( new TomcatStartThread(c, args));
  -                startThread.start();
  -        } catch (Throwable t ) {
  -            t.printStackTrace(System.err);
  -        }
  -    }
  -
  -    static class TomcatStartThread implements Runnable {
  -        Class c;
  -        String args[];
  -        TomcatStartThread( Class c, String args[] ) {
  -            this.c=c;
  -            this.args=args;
  -        }
  -        
  -        public void run() {
  -            try {
  -                Class argClass=args.getClass();
  -                Method m=c.getMethod( "main", new Class[] {argClass} );
  -                m.invoke( c, new Object[] { args } );
  -            } catch( Throwable t ) {
  -                t.printStackTrace(System.err);
  -            }
  -        }
  -    }
  -    
  -    private static org.apache.commons.logging.Log log=
  -        org.apache.commons.logging.LogFactory.getLog( AprImpl.class );
  -
   }
  
  
  

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

Reply via email to