Save This Page
Home » apache-tomcat-6.0.16-src » org.apache.jk » apr » [javadoc | source]
org.apache.jk.apr
public class: AprImpl [javadoc | source]
java.lang.Object
   org.apache.jk.core.JkHandler
      org.apache.jk.apr.AprImpl

All Implemented Interfaces:
    NotificationListener, MBeanRegistration

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.
Field Summary
static  AprImpl aprSingleton     
 String baseDir     
 String aprHome     
 String soExt     
static  boolean ok     
 boolean initialized     
 Hashtable jkHandlers     
 String jniModeSo     
 String nativeSo     
static  boolean jniMode     
Fields inherited from org.apache.jk.core.JkHandler:
OK,  LAST,  ERROR,  properties,  wEnv,  next,  nextName,  name,  id,  HANDLE_RECEIVE_PACKET,  HANDLE_SEND_PACKET,  HANDLE_FLUSH,  HANDLE_THREAD_END,  domain,  oname,  mserver
Constructor:
 public AprImpl() 
Method from org.apache.jk.apr.AprImpl Summary:
addJkHandler,   createJavaContext,   createJkHandler,   getBuffer,   getJkEnv,   getJkHandler,   init,   initialize,   isLoaded,   jkDestroy,   jkGetAttribute,   jkInit,   jkInvoke,   jkRecycle,   jkSetAttribute,   jniInvoke,   jniMode,   loadNative,   loadNative,   releaseJkEnv,   setAprHome,   setBaseDir,   setErr,   setJniModeSo,   setNativeSo,   setOut,   setSoExt,   terminate
Methods from org.apache.jk.core.JkHandler:
addHandlerCallback,   createMsgContext,   createMsgContext,   destroy,   getDomain,   getId,   getName,   getNext,   getObjectName,   getProperty,   handleNotification,   init,   invoke,   pause,   postDeregister,   postRegister,   preDeregister,   preRegister,   resume,   setId,   setName,   setNext,   setNext,   setProperty,   setWorkerEnv
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jk.apr.AprImpl Detail:
 public  void addJkHandler(String type,
    JkHandler cb) 
    Add a Handler for jni callbacks.
 public static Object createJavaContext(String type,
    long cContext) 
 public native long createJkHandler(long xEnv,
    String compName)
 public static byte[] getBuffer(Object ctx,
    int id) 
    Return a buffer associated with the ctx.
 public native long getJkEnv()
 public native long getJkHandler(long xEnv,
    String compName)
    Get a native component
 public  void init() throws IOException 
 public native int initialize()
    Initialize APR
 public boolean isLoaded() 
 public native int jkDestroy(long xEnv,
    long componentP)
 public native String jkGetAttribute(long xEnv,
    long componentP,
    String name)
 public native int jkInit(long xEnv,
    long componentP)
 public static native 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 native  void jkRecycle(long xEnv,
    long endpointP)
    Recycle an endpoint after use.
 public native 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() throws Throwable 
    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 native  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 native int terminate()