Procattr (Apache Tomcat 8.5.57 API Documentation)

org.apache.tomcat.jni

## Class Procattr

- java.lang.Object
- - org.apache.tomcat.jni.Procattr

-     public class Procattr
      extends Object

  Procattr
  Author:
    Mladen Turk

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Procattr()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `addrspaceSet(long attr, int addrspace)` Determine if the child should start in its own address space or using the current one from its parent
    `static int` | `childErrSet(long attr, long err, long parent)` Set the child_err and parent_err values to existing apr_file_t values.
    `static int` | `childInSet(long attr, long in, long parent)` Set the child_in and/or parent_in values to existing apr_file_t values.
    `static int` | `childOutSet(long attr, long out, long parent)` Set the child_out and parent_out values to existing apr_file_t values.
    `static int` | `cmdtypeSet(long attr, int cmd)` Set what type of command the child process will call.
    `static long` | `create(long cont)` Create and initialize a new procattr variable
    `static int` | `detachSet(long attr, int detach)` Determine if the child should start in detached state.
    `static int` | `dirSet(long attr, String dir)` Set which directory the child process should start executing in.
    `static void` | `errfnSet(long attr, long pool, Object o)` Specify an error function to be called in the child process if APR encounters an error in the child prior to running the specified program.
    `static int` | `errorCheckSet(long attr, int chk)` Specify that apr_proc_create() should do whatever it can to report failures to the caller of apr_proc_create(), rather than find out in the child.
    `static int` | `groupSet(long attr, String groupname)` Set the group used for running process
    `static int` | `ioSet(long attr, int in, int out, int err)` Determine if any of stdin, stdout, or stderr should be linked to pipes when starting a child process.
    `static int` | `userSet(long attr, String username, String password)` Set the username used for running process

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Procattr

          public Procattr()

  - ### Method Detail

    - #### create

          public static long create(long cont)
                             throws Error

      Create and initialize a new procattr variable
      Parameters:
        `cont` - The pool to use
      Returns:
        The newly created procattr.
      Throws:
        `Error` - An error occurred

    - #### ioSet

          public static int ioSet(long attr,
                  int in,
                  int out,
                  int err)

      Determine if any of stdin, stdout, or stderr should be linked to pipes when starting a child process.
      Parameters:
        `attr` - The procattr we care about.
        `in` - Should stdin be a pipe back to the parent?
        `out` - Should stdout be a pipe back to the parent?
        `err` - Should stderr be a pipe back to the parent?
      Returns:
        the operation status

    - #### childInSet

          public static int childInSet(long attr,
                       long in,
                       long parent)

      Set the child_in and/or parent_in values to existing apr_file_t values.
      This is NOT a required initializer function. This is useful if you have already opened a pipe (or multiple files) that you wish to use, perhaps persistently across multiple process invocations - such as a log file. You can save some extra function calls by not creating your own pipe since this creates one in the process space for you.
      Parameters:
        `attr` - The procattr we care about.
        `in` - apr_file_t value to use as child_in. Must be a valid file.
        `parent` - apr_file_t value to use as parent_in. Must be a valid file.
      Returns:
        the operation status

    - #### childOutSet

          public static int childOutSet(long attr,
                        long out,
                        long parent)

      Set the child_out and parent_out values to existing apr_file_t values.
      This is NOT a required initializer function. This is useful if you have already opened a pipe (or multiple files) that you wish to use, perhaps persistently across multiple process invocations - such as a log file.
      Parameters:
        `attr` - The procattr we care about.
        `out` - apr_file_t value to use as child_out. Must be a valid file.
        `parent` - apr_file_t value to use as parent_out. Must be a valid file.
      Returns:
        the operation status

    - #### childErrSet

          public static int childErrSet(long attr,
                        long err,
                        long parent)

      Set the child_err and parent_err values to existing apr_file_t values.
      This is NOT a required initializer function. This is useful if you have already opened a pipe (or multiple files) that you wish to use, perhaps persistently across multiple process invocations - such as a log file.
      Parameters:
        `attr` - The procattr we care about.
        `err` - apr_file_t value to use as child_err. Must be a valid file.
        `parent` - apr_file_t value to use as parent_err. Must be a valid file.
      Returns:
        the operation status

    - #### dirSet

          public static int dirSet(long attr,
                   String dir)

      Set which directory the child process should start executing in.
      Parameters:
        `attr` - The procattr we care about.
        `dir` - Which dir to start in. By default, this is the same dir as the parent currently resides in, when the createprocess call is made.
      Returns:
        the operation status

    - #### cmdtypeSet

          public static int cmdtypeSet(long attr,
                       int cmd)

      Set what type of command the child process will call.
      Parameters:
        `attr` - The procattr we care about.
        `cmd` - The type of command. One of:

             APR_SHELLCMD     --  Anything that the shell can handle
             APR_PROGRAM      --  Executable program   (default)
             APR_PROGRAM_ENV  --  Executable program, copy environment
             APR_PROGRAM_PATH --  Executable program on PATH, copy env

      Returns:
        the operation status

    - #### detachSet

          public static int detachSet(long attr,
                      int detach)

      Determine if the child should start in detached state.
      Parameters:
        `attr` - The procattr we care about.
        `detach` - Should the child start in detached state? Default is no.
      Returns:
        the operation status

    - #### errorCheckSet

          public static int errorCheckSet(long attr,
                          int chk)

      Specify that apr_proc_create() should do whatever it can to report failures to the caller of apr_proc_create(), rather than find out in the child.
      Parameters:
        `attr` - The procattr describing the child process to be created.
        `chk` - Flag to indicate whether or not extra work should be done to try to report failures to the caller.
        This flag only affects apr_proc_create() on platforms where fork() is used. This leads to extra overhead in the calling process, but that may help the application handle such errors more gracefully.
      Returns:
        the operation status

    - #### addrspaceSet

          public static int addrspaceSet(long attr,
                         int addrspace)

      Determine if the child should start in its own address space or using the current one from its parent
      Parameters:
        `attr` - The procattr we care about.
        `addrspace` - Should the child start in its own address space? Default is no on NetWare and yes on other platforms.
      Returns:
        the operation status

    - #### errfnSet

          public static void errfnSet(long attr,
                      long pool,
                      Object o)

      Specify an error function to be called in the child process if APR encounters an error in the child prior to running the specified program.
      Parameters:
        `attr` - The procattr describing the child process to be created.
        `pool` - The the pool to use.
        `o` - The Object to call in the child process.
        At the present time, it will only be called from apr_proc_create() on platforms where fork() is used. It will never be called on other platforms, on those platforms apr_proc_create() will return the error in the parent process rather than invoke the callback in the now-forked child process.

    - #### userSet

          public static int userSet(long attr,
                    String username,
                    String password)

      Set the username used for running process
      Parameters:
        `attr` - The procattr we care about.
        `username` - The username used
        `password` - User password if needed. Password is needed on WIN32 or any other platform having APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set.
      Returns:
        the operation status

    - #### groupSet

          public static int groupSet(long attr,
                     String groupname)

      Set the group used for running process
      Parameters:
        `attr` - The procattr we care about.
        `groupname` - The group name used
      Returns:
        the operation status

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.