org.apache.jk.apr
Class AprImpl
public
class
AprImpl
extends JkHandler
Implements the interface with the APR library. This is for internal-use
only. The goal is to use 'natural' mappings for user code - for example
java.net.Socket for unix-domain sockets, etc.
Method Summary |
void | addJkHandler(String type, JkHandler cb) Add a Handler for jni callbacks. |
static Object | createJavaContext(String type, long cContext) |
long | createJkHandler(long xEnv, String compName) |
static byte[] | getBuffer(Object ctx, int id) Return a buffer associated with the ctx. |
long | getJkEnv() |
long | getJkHandler(long xEnv, String compName) Get a native component |
void | init() |
int | initialize() Initialize APR |
boolean | isLoaded() |
int | jkDestroy(long xEnv, long componentP) |
String | jkGetAttribute(long xEnv, long componentP, String name) |
int | jkInit(long xEnv, long componentP) |
static int | jkInvoke(long xEnv, long componentP, long endpointP, int code, byte[] data, int off, int len, int raw) Send the packet to the C side. |
void | jkRecycle(long xEnv, long endpointP) Recycle an endpoint after use. |
int | jkSetAttribute(long xEnv, long componentP, String name, String val) |
static int | jniInvoke(long jContext, Object ctx) |
static void | jniMode() |
void | loadNative() This method of loading the libs doesn't require setting
LD_LIBRARY_PATH. |
void | loadNative(String libPath) |
void | releaseJkEnv(long xEnv) Clean the temp pool, put back the env in the pool |
void | setAprHome(String s) |
void | setBaseDir(String s) Native libraries are located based on base dir.
|
static void | setErr(String filename) Sets the System.err stream |
void | setJniModeSo(String jniModeSo) Name of the so used in inprocess mode |
void | setNativeSo(String nativeSo) name of the so used by java. |
static void | setOut(String filename) Sets the System.out stream |
void | setSoExt(String s) |
int | terminate() |
public AprImpl()
public void addJkHandler(String type,
JkHandler cb)
Add a Handler for jni callbacks.
public static Object createJavaContext(String type, long cContext)
public long createJkHandler(long xEnv, String compName)
public static byte[] getBuffer(Object ctx, int id)
Return a buffer associated with the ctx.
public long getJkEnv()
public long getJkHandler(long xEnv, String compName)
Get a native component
Returns: 0 if the component is not found.
public void init()
public int initialize()
Initialize APR
public boolean isLoaded()
public int jkDestroy(long xEnv, long componentP)
public String jkGetAttribute(long xEnv, long componentP, String name)
public int jkInit(long xEnv, long componentP)
public static int jkInvoke(long xEnv, long componentP, long endpointP, int code, byte[] data, int off, int len, int raw)
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 void jkRecycle(long xEnv, long endpointP)
Recycle an endpoint after use.
public int jkSetAttribute(long xEnv, long componentP, String name, String val)
public static int jniInvoke(long jContext, Object ctx)
public static void jniMode()
public void loadNative()
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.
The burden is on our code to deal with platform specific
extensions and to keep the paths consistent - not easy, but
worth it if it avoids one extra step for the user.
Of course, this can change to System.load() and putting the
libs in LD_LIBRARY_PATH.
public void loadNative(String libPath)
public void releaseJkEnv(long xEnv)
Clean the temp pool, put back the env in the pool
public void setAprHome(String s)
public void setBaseDir(String s)
Native libraries are located based on base dir.
XXX Add platform, version, etc
public static void setErr(String filename)
Sets the System.err stream
public void setJniModeSo(String jniModeSo)
Name of the so used in inprocess mode
public void setNativeSo(String nativeSo)
name of the so used by java. If not set we'll loadLibrary("jkjni" ),
if set we load( nativeSo )
public static void setOut(String filename)
Sets the System.out stream
public void setSoExt(String s)
public int terminate()
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.