| java.lang.Object org.apache.tomcat.jni.Proc
Proc | public class Proc (Code) | | Proc
author: Mladen Turk version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $ |
Method Summary | |
native public static long | alloc(long cont) Allocate apr_proc_t stucture from pool
This is not an apr function. | native public static int | create(long proc, String progname, String[] args, String[] env, long attr, long pool) Create a new process and execute a new program within that process.
This function returns without waiting for the new process to terminate;
use apr_proc_wait for that.
Parameters: progname - The program to run Parameters: args - The arguments to pass to the new program. | native public static int | detach(int daemonize) Detach the process from the controlling terminal. | native public static int | fork(long[] proc, long cont) This is currently the only non-portable call in APR. | native public static int | kill(long proc, int sig) Terminate a process. | native public static int | wait(long proc, int[] exit, int waithow) Wait for a child process to die
Parameters: proc - The process handle that corresponds to the desired child process Parameters: exit - exit[0] The returned exit status of the child, if a child processdies, or the signal that caused the child to die.On platforms that don't support obtaining this information,the status parameter will be returned as APR_ENOTIMPL.exit[1] Why the child died, the bitwise or of:APR_PROC_EXIT -- process terminated normallyAPR_PROC_SIGNAL -- process was killed by a signalAPR_PROC_SIGNAL_CORE -- process was killed by a signal, andgenerated a core dump. Parameters: waithow - How should we wait. | native public static int | waitAllProcs(long proc, int[] exit, int waithow, long pool) Wait for any current child process to die and return information
about that child.
Parameters: proc - Pointer to NULL on entry, will be filled out with child'sinformation Parameters: exit - exit[0] The returned exit status of the child, if a child processdies, or the signal that caused the child to die.On platforms that don't support obtaining this information,the status parameter will be returned as APR_ENOTIMPL.exit[1] Why the child died, the bitwise or of:APR_PROC_EXIT -- process terminated normallyAPR_PROC_SIGNAL -- process was killed by a signalAPR_PROC_SIGNAL_CORE -- process was killed by a signal, andgenerated a core dump. Parameters: waithow - How should we wait. |
APR_CHILD_BLOCK | final public static int APR_CHILD_BLOCK(Code) | | |
APR_FULL_BLOCK | final public static int APR_FULL_BLOCK(Code) | | |
APR_FULL_NONBLOCK | final public static int APR_FULL_NONBLOCK(Code) | | |
APR_JUST_WAIT | final public static int APR_JUST_WAIT(Code) | | wait forever for the process to complete
|
APR_KILL_AFTER_TIMEOUT | final public static int APR_KILL_AFTER_TIMEOUT(Code) | | SIGTERM, wait 3 seconds, SIGKILL
|
APR_KILL_ALWAYS | final public static int APR_KILL_ALWAYS(Code) | | process is sent SIGKILL on apr_pool_t cleanup
|
APR_KILL_NEVER | final public static int APR_KILL_NEVER(Code) | | process is never sent any signals
|
APR_KILL_ONLY_ONCE | final public static int APR_KILL_ONLY_ONCE(Code) | | send SIGTERM and then wait
|
APR_LIMIT_CPU | final public static int APR_LIMIT_CPU(Code) | | |
APR_LIMIT_MEM | final public static int APR_LIMIT_MEM(Code) | | |
APR_LIMIT_NOFILE | final public static int APR_LIMIT_NOFILE(Code) | | |
APR_LIMIT_NPROC | final public static int APR_LIMIT_NPROC(Code) | | |
APR_NOWAIT | final public static int APR_NOWAIT(Code) | | wait for the specified process to finish
|
APR_NO_PIPE | final public static int APR_NO_PIPE(Code) | | process exited and dumped a core file
|
APR_OC_REASON_DEATH | final public static int APR_OC_REASON_DEATH(Code) | | child has died, caller must call unregister still
|
APR_OC_REASON_LOST | final public static int APR_OC_REASON_LOST(Code) | | somehow the child exited without us knowing ... buggy os?
|
APR_OC_REASON_RESTART | final public static int APR_OC_REASON_RESTART(Code) | | a restart is occuring, perform any necessary cleanup (including
sending a special signal to child)
|
APR_OC_REASON_RUNNING | final public static int APR_OC_REASON_RUNNING(Code) | | a health check is occuring, for most maintainence functions
this is a no-op.
|
APR_OC_REASON_UNREGISTER | final public static int APR_OC_REASON_UNREGISTER(Code) | | unregister has been called, do whatever is necessary (including
kill the child)
|
APR_OC_REASON_UNWRITABLE | final public static int APR_OC_REASON_UNWRITABLE(Code) | | write_fd is unwritable
|
APR_PARENT_BLOCK | final public static int APR_PARENT_BLOCK(Code) | | |
APR_PROC_DETACH_DAEMONIZE | final public static int APR_PROC_DETACH_DAEMONIZE(Code) | | Do not detach
|
APR_PROC_DETACH_FOREGROUND | final public static int APR_PROC_DETACH_FOREGROUND(Code) | | |
APR_PROC_EXIT | final public static int APR_PROC_EXIT(Code) | | do not wait -- just see if it has finished
|
APR_PROC_SIGNAL | final public static int APR_PROC_SIGNAL(Code) | | process exited normally
|
APR_PROC_SIGNAL_CORE | final public static int APR_PROC_SIGNAL_CORE(Code) | | process exited due to a signal
|
APR_PROGRAM | final public static int APR_PROGRAM(Code) | | use the shell to invoke the program
|
APR_PROGRAM_ENV | final public static int APR_PROGRAM_ENV(Code) | | invoke the program directly, no copied env
|
APR_PROGRAM_PATH | final public static int APR_PROGRAM_PATH(Code) | | invoke the program, replicating our environment
|
APR_SHELLCM | final public static int APR_SHELLCM(Code) | | |
APR_SHELLCMD_ENV | final public static int APR_SHELLCMD_ENV(Code) | | find program on PATH, use our environment
|
APR_WAIT | final public static int APR_WAIT(Code) | | use the shell to invoke the program,
replicating our environment
|
MAX_ARGS_SIZE | final public static int MAX_ARGS_SIZE(Code) | | Detach
|
MAX_ENV_SIZE | final public static int MAX_ENV_SIZE(Code) | | |
alloc | native public static long alloc(long cont)(Code) | | Allocate apr_proc_t stucture from pool
This is not an apr function.
Parameters: cont - The pool to use. |
create | native public static int create(long proc, String progname, String[] args, String[] env, long attr, long pool)(Code) | | Create a new process and execute a new program within that process.
This function returns without waiting for the new process to terminate;
use apr_proc_wait for that.
Parameters: progname - The program to run Parameters: args - The arguments to pass to the new program. The firstone should be the program name. Parameters: env - The new environment table for the new process. Thisshould be a list of NULL-terminated strings. This argumentis ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, andAPR_SHELLCMD_ENV types of commands. Parameters: attr - The procattr we should use to determine how to create the newprocess Parameters: pool - The pool to use. The resulting process handle. |
detach | native public static int detach(int daemonize)(Code) | | Detach the process from the controlling terminal.
Parameters: daemonize - set to non-zero if the process should daemonizeand become a background process, else it willstay in the foreground. |
fork | native public static int fork(long[] proc, long cont)(Code) | | This is currently the only non-portable call in APR. This executes
a standard unix fork.
Parameters: proc - The resulting process handle. Parameters: cont - The pool to use. APR_INCHILD for the child, and APR_INPARENT for the parentor an error. |
kill | native public static int kill(long proc, int sig)(Code) | | Terminate a process.
Parameters: proc - The process to terminate. Parameters: sig - How to kill the process. |
wait | native public static int wait(long proc, int[] exit, int waithow)(Code) | | Wait for a child process to die
Parameters: proc - The process handle that corresponds to the desired child process Parameters: exit - exit[0] The returned exit status of the child, if a child processdies, or the signal that caused the child to die.On platforms that don't support obtaining this information,the status parameter will be returned as APR_ENOTIMPL.exit[1] Why the child died, the bitwise or of:APR_PROC_EXIT -- process terminated normallyAPR_PROC_SIGNAL -- process was killed by a signalAPR_PROC_SIGNAL_CORE -- process was killed by a signal, andgenerated a core dump. Parameters: waithow - How should we wait. One of:APR_WAIT -- block until the child process dies.APR_NOWAIT -- return immediately regardless of if thechild is dead or not. The childs status is in the return code to this process. It is one of:APR_CHILD_DONE -- child is no longer running.APR_CHILD_NOTDONE -- child is still running. |
waitAllProcs | native public static int waitAllProcs(long proc, int[] exit, int waithow, long pool)(Code) | | Wait for any current child process to die and return information
about that child.
Parameters: proc - Pointer to NULL on entry, will be filled out with child'sinformation Parameters: exit - exit[0] The returned exit status of the child, if a child processdies, or the signal that caused the child to die.On platforms that don't support obtaining this information,the status parameter will be returned as APR_ENOTIMPL.exit[1] Why the child died, the bitwise or of:APR_PROC_EXIT -- process terminated normallyAPR_PROC_SIGNAL -- process was killed by a signalAPR_PROC_SIGNAL_CORE -- process was killed by a signal, andgenerated a core dump. Parameters: waithow - How should we wait. One of:APR_WAIT -- block until the child process dies.APR_NOWAIT -- return immediately regardless of if thechild is dead or not. Parameters: pool - Pool to allocate child information out of. |
|
|