| java.lang.Object org.apache.tomcat.jni.Pool
Pool | public class Pool (Code) | | Pool
author: Mladen Turk version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $ |
Method Summary | |
native public static ByteBuffer | alloc(long p, int size) | native public static ByteBuffer | calloc(long p, int size) | native public static void | cleanupForExec() | native public static void | cleanupKill(long pool, long data) | native public static long | cleanupRegister(long pool, Object o) | native public static void | clear(long pool) Clear all memory in the pool and run all the cleanups. | native public static long | create(long parent) Create a new pool.
Parameters: parent - The parent pool. | native public static Object | dataGet(long pool, String key) Return the data associated with the current pool. | native public static int | dataSet(long pool, String key, Object data) Set the data associated with the current pool
Parameters: data - The user data associated with the pool. Parameters: key - The key to use for association Parameters: pool - The current pool Warning :The data to be attached to the pool should have a life spanat least as long as the pool it is being attached to.Object attached to the pool will be globaly referenceduntill the pool is cleared or dataSet is called with the null data. | native public static void | destroy(long pool) Destroy the pool. | native public static boolean | isAncestor(long a, long b) | native public static void | noteSubprocess(long a, long proc, int how) Register a process to be killed when a pool dies. | native public static long | parentGet(long pool) Get the parent pool of the specified pool.
Parameters: pool - The pool for retrieving the parent pool. |
alloc | native public static ByteBuffer alloc(long p, int size)(Code) | | Allocate a block of memory from a pool
Parameters: p - The pool to allocate from Parameters: size - The amount of memory to allocate The ByteBuffer with allocated memory |
calloc | native public static ByteBuffer calloc(long p, int size)(Code) | | Allocate a block of memory from a pool and set all of the memory to 0
Parameters: p - The pool to allocate from Parameters: size - The amount of memory to allocate The ByteBuffer with allocated memory |
cleanupForExec | native public static void cleanupForExec()(Code) | | Run all of the child_cleanups, so that any unnecessary files are
closed because we are about to exec a new program
|
cleanupKill | native public static void cleanupKill(long pool, long data)(Code) | | Remove a previously registered cleanup function
Parameters: pool - The pool remove the cleanup from Parameters: data - The cleanup handler to remove from cleanup |
cleanupRegister | native public static long cleanupRegister(long pool, Object o)(Code) | | Register a function to be called when a pool is cleared or destroyed
Parameters: pool - The pool register the cleanup with Parameters: o - The object to call when the pool is clearedor destroyed The cleanup handler. |
clear | native public static void clear(long pool)(Code) | | Clear all memory in the pool and run all the cleanups. This also destroys all
subpools.
Parameters: pool - The pool to clearThis does not actually free the memory, it just allows the poolto re-use this memory for the next allocation. |
create | native public static long create(long parent)(Code) | | Create a new pool.
Parameters: parent - The parent pool. If this is 0, the new pool is a rootpool. If it is non-zero, the new pool will inherit allof its parent pool's attributes, except the apr_pool_t willbe a sub-pool. The pool we have just created. |
dataGet | native public static Object dataGet(long pool, String key)(Code) | | Return the data associated with the current pool.
Parameters: key - The key for the data to retrieve Parameters: pool - The current pool. |
dataSet | native public static int dataSet(long pool, String key, Object data)(Code) | | Set the data associated with the current pool
Parameters: data - The user data associated with the pool. Parameters: key - The key to use for association Parameters: pool - The current pool Warning :The data to be attached to the pool should have a life spanat least as long as the pool it is being attached to.Object attached to the pool will be globaly referenceduntill the pool is cleared or dataSet is called with the null data. APR Status code. |
destroy | native public static void destroy(long pool)(Code) | | Destroy the pool. This takes similar action as apr_pool_clear() and then
frees all the memory.
This will actually free the memory
Parameters: pool - The pool to destroy |
isAncestor | native public static boolean isAncestor(long a, long b)(Code) | | Determine if pool a is an ancestor of pool b
Parameters: a - The pool to search Parameters: b - The pool to search for True if a is an ancestor of b, NULL is considered an ancestorof all pools. |
noteSubprocess | native public static void noteSubprocess(long a, long proc, int how)(Code) | | Register a process to be killed when a pool dies.
Parameters: a - The pool to use to define the processes lifetime Parameters: proc - The process to register Parameters: how - How to kill the process, one of:APR_KILL_NEVER -- process is never sent any signalsAPR_KILL_ALWAYS -- process is sent SIGKILL on apr_pool_t cleanupAPR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILLAPR_JUST_WAIT -- wait forever for the process to completeAPR_KILL_ONLY_ONCE -- send SIGTERM and then wait |
parentGet | native public static long parentGet(long pool)(Code) | | Get the parent pool of the specified pool.
Parameters: pool - The pool for retrieving the parent pool. The parent of the given pool. |
|
|