Class VirtualMachine.ForOpenJ9.Dispatcher.ForJnaPosixEnvironment

    • Field Detail

      • attempts

        private final int attempts
        The maximum amount of attempts for checking the result of a foreign process.
      • pause

        private final long pause
        The pause between two checks for another process to return.
      • timeUnit

        private final java.util.concurrent.TimeUnit timeUnit
        The time unit of the pause time.
    • Constructor Detail

      • ForJnaPosixEnvironment

        public ForJnaPosixEnvironment​(int attempts,
                                      long pause,
                                      java.util.concurrent.TimeUnit timeUnit)
        Creates a new connector for a POSIX enviornment using JNA.
        Parameters:
        attempts - The maximum amount of attempts for checking the result of a foreign process.
        pause - The pause between two checks for another process to return.
        timeUnit - The time unit of the pause time.
    • Method Detail

      • isExistingProcess

        public boolean isExistingProcess​(int processId)
        Returns true if the supplied process id is a running process.
        Specified by:
        isExistingProcess in interface VirtualMachine.ForOpenJ9.Dispatcher
        Parameters:
        processId - The process id to evaluate.
        Returns:
        true if the supplied process id is currently running.
      • getOwnerIdOf

        public int getOwnerIdOf​(java.io.File file)
        Returns the user id of the owner of the supplied file.
        Specified by:
        getOwnerIdOf in interface VirtualMachine.ForOpenJ9.Dispatcher
        Parameters:
        file - The file for which to locate the owner.
        Returns:
        The owner id of the supplied file.
      • setPermissions

        public void setPermissions​(java.io.File file,
                                   int permissions)
        Sets permissions for the supplied file.
        Specified by:
        setPermissions in interface VirtualMachine.ForOpenJ9.Dispatcher
        Parameters:
        file - The file for which to set the permissions.
        permissions - The permission bits to set.
      • incrementSemaphore

        public void incrementSemaphore​(java.io.File directory,
                                       java.lang.String name,
                                       boolean global,
                                       int count)
        Increments a semaphore.
        Specified by:
        incrementSemaphore in interface VirtualMachine.ForOpenJ9.Dispatcher
        Parameters:
        directory - The sempahore's control directory.
        name - The semaphore's name.
        global - true if the semaphore is in the global namespace (only applicable on Windows).
        count - The amount of increments.
      • decrementSemaphore

        public void decrementSemaphore​(java.io.File directory,
                                       java.lang.String name,
                                       boolean global,
                                       int count)
        Decrements a semaphore.
        Specified by:
        decrementSemaphore in interface VirtualMachine.ForOpenJ9.Dispatcher
        Parameters:
        directory - The sempahore's control directory.
        name - The semaphore's name.
        global - true if the semaphore is in the global namespace (only applicable on Windows).
        count - The amount of decrements.
      • notifySemaphore

        private void notifySemaphore​(java.io.File directory,
                                     java.lang.String name,
                                     int count,
                                     short operation,
                                     short flags,
                                     boolean acceptUnavailable)
        Notifies a POSIX semaphore.
        Parameters:
        directory - The semaphore's directory.
        name - The semaphore's name.
        count - The amount of notifications to send.
        operation - The operation to apply.
        flags - The flags to set.
        acceptUnavailable - true if a EAGAIN code should be accepted.