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-connectors/jk/java/org/apache/jk/apr AprImpl.java
Date Wed, 22 May 2002 23:50:03 GMT
costin      02/05/22 16:50:03

  Modified:    jk/java/org/apache/jk/apr AprImpl.java
  Log:
  Remove the hardcoded path, make it configurable. Still have to test it.
  
  Revision  Changes    Path
  1.15      +29 -3     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AprImpl.java	9 May 2002 00:12:00 -0000	1.14
  +++ AprImpl.java	22 May 2002 23:50:02 -0000	1.15
  @@ -21,6 +21,12 @@
       // Handlers for native callbacks
       Hashtable jkHandlers=new Hashtable();
   
  +    // Name of the so used in inprocess mode 
  +    String jniModeSo;
  +    // name of the so used by java. If not set we'll loadLibrary("jkjni" ),
  +    // if set we load( nativeSo )
  +    String nativeSo;
  +    
       public AprImpl() {
           aprSingleton=this;
       }
  @@ -49,6 +55,19 @@
           jkHandlers.put( type, cb );
       }
       
  +    /** Name of the so used in inprocess mode
  +     */
  +    public void setJniModeSo(String jniModeSo ) {
  +        this.jniModeSo=jniModeSo;
  +    }
  +
  +    /** name of the so used by java. If not set we'll loadLibrary("jkjni" ),
  +        if set we load( nativeSo )
  +    */
  +    public void setNativeSo( String nativeSo ) {
  +        this.nativeSo=nativeSo;
  +    }
  +
       // -------------------- Apr generic utils --------------------
       /** Initialize APR
        */
  @@ -190,10 +209,12 @@
       }
   
       static boolean jniMode=false;
  +
       
       public static void jniMode() {
           jniMode=true;
       }
  +
       
       /** This method of loading the libs doesn't require setting
        *   LD_LIBRARY_PATH. Assuming a 'right' binary distribution,
  @@ -217,8 +238,8 @@
                  VMs.
               */
               try {
  -                System.out.println("Loading mod_jk.so");
  -                System.load( "/opt/apache2/modules/mod_jk2.so" );
  +                System.out.println("Loading " + jniModeSo);
  +                System.load( jniModeSo );
               } catch( Throwable ex ) {
                   // ignore
                   ex.printStackTrace();
  @@ -246,7 +267,12 @@
                 }
               */
           try {
  -            System.loadLibrary( "jkjni" );
  +            if( nativeSo == null ) {
  +                // This will load libjkjni.so or jkjni.dll in LD_LIBRARY_PATH
  +                System.loadLibrary( "jkjni" );
  +            } else {
  +                System.load( nativeSo );
  +            }
           } catch( Throwable ex ) {
               ok=false;
               throw ex;
  
  
  

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