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: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>