Package org.apache.tomcat.jni
Class Proc
- java.lang.Object
-
- org.apache.tomcat.jni.Proc
-
@Deprecated public class Proc extends java.lang.ObjectDeprecated.The scope of the APR/Native Library will be reduced in Tomcat 10.1.x / Tomcat Native 2.x onwards to only include those components required to provide OpenSSL integration with the NIO and NIO2 connectors.Proc- Author:
- Mladen Turk
-
-
Field Summary
Fields Modifier and Type Field Description static intAPR_CHILD_BLOCKDeprecated.static intAPR_FULL_BLOCKDeprecated.static intAPR_FULL_NONBLOCKDeprecated.static intAPR_JUST_WAITDeprecated.wait forever for the process to completestatic intAPR_KILL_AFTER_TIMEOUTDeprecated.SIGTERM, wait 3 seconds, SIGKILLstatic intAPR_KILL_ALWAYSDeprecated.process is sent SIGKILL on apr_pool_t cleanupstatic intAPR_KILL_NEVERDeprecated.process is never sent any signalsstatic intAPR_KILL_ONLY_ONCEDeprecated.send SIGTERM and then waitstatic intAPR_LIMIT_CPUDeprecated.static intAPR_LIMIT_MEMDeprecated.static intAPR_LIMIT_NOFILEDeprecated.static intAPR_LIMIT_NPROCDeprecated.static intAPR_NO_PIPEDeprecated.static intAPR_NOWAITDeprecated.do not wait -- just see if it has finishedstatic intAPR_OC_REASON_DEATHDeprecated.child has died, caller must call unregister stillstatic intAPR_OC_REASON_LOSTDeprecated.somehow the child exited without us knowing ... buggy os?static intAPR_OC_REASON_RESTARTDeprecated.a restart is occurring, perform any necessary cleanup (including sending a special signal to child)static intAPR_OC_REASON_RUNNINGDeprecated.a health check is occurring, for most maintenance functions this is a no-op.static intAPR_OC_REASON_UNREGISTERDeprecated.unregister has been called, do whatever is necessary (including kill the child)static intAPR_OC_REASON_UNWRITABLEDeprecated.write_fd is unwritablestatic intAPR_PARENT_BLOCKDeprecated.static intAPR_PROC_DETACH_DAEMONIZEDeprecated.Do not detachstatic intAPR_PROC_DETACH_FOREGROUNDDeprecated.static intAPR_PROC_EXITDeprecated.process exited normallystatic intAPR_PROC_SIGNALDeprecated.process exited due to a signalstatic intAPR_PROC_SIGNAL_COREDeprecated.process exited and dumped a core filestatic intAPR_PROGRAMDeprecated.invoke the program directly, no copied envstatic intAPR_PROGRAM_ENVDeprecated.invoke the program, replicating our environmentstatic intAPR_PROGRAM_PATHDeprecated.find program on PATH, use our environmentstatic intAPR_SHELLCMDeprecated.use the shell to invoke the programstatic intAPR_SHELLCMD_ENVDeprecated.use the shell to invoke the program, replicating our environmentstatic intAPR_WAITDeprecated.wait for the specified process to finishstatic intMAX_ARGS_SIZEDeprecated.Detachstatic intMAX_ENV_SIZEDeprecated.
-
Constructor Summary
Constructors Constructor Description Proc()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static longalloc(long cont)Deprecated.Allocate apr_proc_t structure from pool This is not an apr function.static intcreate(long proc, java.lang.String progname, java.lang.String[] args, java.lang.String[] env, long attr, long pool)Deprecated.Create a new process and execute a new program within that process.static intdetach(int daemonize)Deprecated.Detach the process from the controlling terminal.static intfork(long[] proc, long cont)Deprecated.This is currently the only non-portable call in APR.static intkill(long proc, int sig)Deprecated.Terminate a process.static intwait(long proc, int[] exit, int waithow)Deprecated.Wait for a child process to diestatic intwaitAllProcs(long proc, int[] exit, int waithow, long pool)Deprecated.Wait for any current child process to die and return information about that child.
-
-
-
Field Detail
-
APR_SHELLCM
public static final int APR_SHELLCM
Deprecated.use the shell to invoke the program- See Also:
- Constant Field Values
-
APR_PROGRAM
public static final int APR_PROGRAM
Deprecated.invoke the program directly, no copied env- See Also:
- Constant Field Values
-
APR_PROGRAM_ENV
public static final int APR_PROGRAM_ENV
Deprecated.invoke the program, replicating our environment- See Also:
- Constant Field Values
-
APR_PROGRAM_PATH
public static final int APR_PROGRAM_PATH
Deprecated.find program on PATH, use our environment- See Also:
- Constant Field Values
-
APR_SHELLCMD_ENV
public static final int APR_SHELLCMD_ENV
Deprecated.use the shell to invoke the program, replicating our environment- See Also:
- Constant Field Values
-
APR_WAIT
public static final int APR_WAIT
Deprecated.wait for the specified process to finish- See Also:
- Constant Field Values
-
APR_NOWAIT
public static final int APR_NOWAIT
Deprecated.do not wait -- just see if it has finished- See Also:
- Constant Field Values
-
APR_PROC_EXIT
public static final int APR_PROC_EXIT
Deprecated.process exited normally- See Also:
- Constant Field Values
-
APR_PROC_SIGNAL
public static final int APR_PROC_SIGNAL
Deprecated.process exited due to a signal- See Also:
- Constant Field Values
-
APR_PROC_SIGNAL_CORE
public static final int APR_PROC_SIGNAL_CORE
Deprecated.process exited and dumped a core file- See Also:
- Constant Field Values
-
APR_NO_PIPE
public static final int APR_NO_PIPE
Deprecated.- See Also:
- Constant Field Values
-
APR_FULL_BLOCK
public static final int APR_FULL_BLOCK
Deprecated.- See Also:
- Constant Field Values
-
APR_FULL_NONBLOCK
public static final int APR_FULL_NONBLOCK
Deprecated.- See Also:
- Constant Field Values
-
APR_PARENT_BLOCK
public static final int APR_PARENT_BLOCK
Deprecated.- See Also:
- Constant Field Values
-
APR_CHILD_BLOCK
public static final int APR_CHILD_BLOCK
Deprecated.- See Also:
- Constant Field Values
-
APR_LIMIT_CPU
public static final int APR_LIMIT_CPU
Deprecated.- See Also:
- Constant Field Values
-
APR_LIMIT_MEM
public static final int APR_LIMIT_MEM
Deprecated.- See Also:
- Constant Field Values
-
APR_LIMIT_NPROC
public static final int APR_LIMIT_NPROC
Deprecated.- See Also:
- Constant Field Values
-
APR_LIMIT_NOFILE
public static final int APR_LIMIT_NOFILE
Deprecated.- See Also:
- Constant Field Values
-
APR_OC_REASON_DEATH
public static final int APR_OC_REASON_DEATH
Deprecated.child has died, caller must call unregister still- See Also:
- Constant Field Values
-
APR_OC_REASON_UNWRITABLE
public static final int APR_OC_REASON_UNWRITABLE
Deprecated.write_fd is unwritable- See Also:
- Constant Field Values
-
APR_OC_REASON_RESTART
public static final int APR_OC_REASON_RESTART
Deprecated.a restart is occurring, perform any necessary cleanup (including sending a special signal to child)- See Also:
- Constant Field Values
-
APR_OC_REASON_UNREGISTER
public static final int APR_OC_REASON_UNREGISTER
Deprecated.unregister has been called, do whatever is necessary (including kill the child)- See Also:
- Constant Field Values
-
APR_OC_REASON_LOST
public static final int APR_OC_REASON_LOST
Deprecated.somehow the child exited without us knowing ... buggy os?- See Also:
- Constant Field Values
-
APR_OC_REASON_RUNNING
public static final int APR_OC_REASON_RUNNING
Deprecated.a health check is occurring, for most maintenance functions this is a no-op.- See Also:
- Constant Field Values
-
APR_KILL_NEVER
public static final int APR_KILL_NEVER
Deprecated.process is never sent any signals- See Also:
- Constant Field Values
-
APR_KILL_ALWAYS
public static final int APR_KILL_ALWAYS
Deprecated.process is sent SIGKILL on apr_pool_t cleanup- See Also:
- Constant Field Values
-
APR_KILL_AFTER_TIMEOUT
public static final int APR_KILL_AFTER_TIMEOUT
Deprecated.SIGTERM, wait 3 seconds, SIGKILL- See Also:
- Constant Field Values
-
APR_JUST_WAIT
public static final int APR_JUST_WAIT
Deprecated.wait forever for the process to complete- See Also:
- Constant Field Values
-
APR_KILL_ONLY_ONCE
public static final int APR_KILL_ONLY_ONCE
Deprecated.send SIGTERM and then wait- See Also:
- Constant Field Values
-
APR_PROC_DETACH_FOREGROUND
public static final int APR_PROC_DETACH_FOREGROUND
Deprecated.- See Also:
- Constant Field Values
-
APR_PROC_DETACH_DAEMONIZE
public static final int APR_PROC_DETACH_DAEMONIZE
Deprecated.Do not detach- See Also:
- Constant Field Values
-
MAX_ARGS_SIZE
public static final int MAX_ARGS_SIZE
Deprecated.Detach- See Also:
- Constant Field Values
-
MAX_ENV_SIZE
public static final int MAX_ENV_SIZE
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
alloc
public static long alloc(long cont)
Deprecated.Allocate apr_proc_t structure from pool This is not an apr function.- Parameters:
cont- The pool to use.- Returns:
- the pointer
-
fork
public static int fork(long[] proc, long cont)Deprecated.This is currently the only non-portable call in APR. This executes a standard unix fork.- Parameters:
proc- The resulting process handle.cont- The pool to use.- Returns:
- APR_INCHILD for the child, and APR_INPARENT for the parent or an error.
-
create
public static int create(long proc, java.lang.String progname, java.lang.String[] args, java.lang.String[] env, long attr, long pool)Deprecated.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:
proc- The process handleprogname- The program to runargs- The arguments to pass to the new program. The first one should be the program name.env- The new environment table for the new process. This should be a list of NULL-terminated strings. This argument is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and APR_SHELLCMD_ENV types of commands.attr- The procattr we should use to determine how to create the new processpool- The pool to use.- Returns:
- The resulting process handle.
-
wait
public static int wait(long proc, int[] exit, int waithow)Deprecated.Wait for a child process to die- Parameters:
proc- The process handle that corresponds to the desired child processexit- exit[0] The returned exit status of the child, if a child process dies, 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 normally APR_PROC_SIGNAL -- process was killed by a signal APR_PROC_SIGNAL_CORE -- process was killed by a signal, and generated a core dump.waithow- How should we wait. One of:APR_WAIT -- block until the child process dies. APR_NOWAIT -- return immediately regardless of if the child is dead or not.- Returns:
- 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
public static int waitAllProcs(long proc, int[] exit, int waithow, long pool)Deprecated.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's informationexit- exit[0] The returned exit status of the child, if a child process dies, 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 normally APR_PROC_SIGNAL -- process was killed by a signal APR_PROC_SIGNAL_CORE -- process was killed by a signal, and generated a core dump.waithow- How should we wait. One of:APR_WAIT -- block until the child process dies. APR_NOWAIT -- return immediately regardless of if the child is dead or not.pool- Pool to allocate child information out of.- Returns:
- the operation status
-
detach
public static int detach(int daemonize)
Deprecated.Detach the process from the controlling terminal.- Parameters:
daemonize- set to non-zero if the process should daemonize and become a background process, else it will stay in the foreground.- Returns:
- the operation status
-
kill
public static int kill(long proc, int sig)Deprecated.Terminate a process.- Parameters:
proc- The process to terminate.sig- How to kill the process.- Returns:
- the operation status
-
-