Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 27027 invoked from network); 25 Apr 2002 18:17:47 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 25 Apr 2002 18:17:47 -0000 Received: (qmail 24712 invoked by uid 97); 25 Apr 2002 18:17:31 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 24663 invoked by uid 97); 25 Apr 2002 18:17:30 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 24652 invoked by uid 97); 25 Apr 2002 18:17:30 -0000 Date: 25 Apr 2002 18:17:24 -0000 Message-ID: <20020425181724.16434.qmail@icarus.apache.org> From: costin@apache.org To: jakarta-tomcat-connectors-cvs@apache.org Subject: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/apr AprImpl.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N costin 02/04/25 11:17:24 Modified: jk/java/org/apache/jk/apr AprImpl.java Log: Added a couple of methods to expose the jk objects. Instead of duplicating the code to work with the shm and unix channel ( in a jk 'component' and in the jni wrapper/java code ) we just use the same code. This also greatly simplifies the native code - and makes use of the optimizations used in the jni channel ( to avoid expensive string conversions and object creation ). It also minimizes the ammount of jni 'crossings' ( each JNI invocation has a significang performance hit ). In addition the same code can be used for in-process and out-of process, and for ajp14 Revision Changes Path 1.12 +27 -6 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.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- AprImpl.java 18 Apr 2002 22:59:20 -0000 1.11 +++ AprImpl.java 25 Apr 2002 18:17:24 -0000 1.12 @@ -123,16 +123,37 @@ public native long mutexDestroy( long pool, long mutexP ); - // -------------------- java to C -------------------- + // -------------------- Interface to jk components -------------------- + // + + /* Return a jk_env_t, used to keep the execution context ( temp pool, etc ) + */ + public native long getJkEnv(); + + /** Clean the temp pool, put back the env in the pool + */ + public native void releaseJkEnv(long xEnv); + + public native void jkRecycle(long xEnv, long endpointP); + + /** Get a native component + * @return 0 if the component is not found. + */ + public native long getJkHandler(long xEnv, String compName ); + + public native long createJkHandler(long xEnv, String compName ); + + /** Get the id of a method. + * @return -1 if the method is not found. + */ + public native int jkGetId(long xEnv, String ns, String name ); - // Temp - interface will evolve - /** Send the packet to the C side. On return it contains the response * or indication there is no response. Asymetrical because we can't * do things like continuations. */ - public static native int sendPacket(long xEnv, long endpointP, - byte data[], int len); + public static native int jkInvoke(long xEnv, long componentP, long endpointP, + int code, byte data[], int len); // -------------------- Called from C -------------------- @@ -177,7 +198,7 @@ public void init() throws IOException { try { loadNative(); - + initialize(); } catch( Throwable t ) { throw new IOException( t.getMessage() ); -- To unsubscribe, e-mail: For additional commands, e-mail: