Class VirtualMachine.ForOpenJ9.Dispatcher.ForJnaWindowsEnvironment

    • Constructor Detail

      • ForJnaWindowsEnvironment

        public ForJnaWindowsEnvironment()
        Creates a new connector for a Windows environment using JNA.
    • Method Detail

      • getTemporaryFolder

        public java.lang.String getTemporaryFolder​(java.lang.String processId)
        Returns this machine's temporary folder.
        Specified by:
        getTemporaryFolder in interface VirtualMachine.ForOpenJ9.Dispatcher
        Parameters:
        processId - The target process's id.
        Returns:
        The temporary folder.
      • 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.
      • chownFileToUser

        public void chownFileToUser​(java.io.File file,
                                    long userId)
        Changes the ownership of a file. Can be called only if this process is owned by root.
        Specified by:
        chownFileToUser in interface VirtualMachine.ForOpenJ9.Dispatcher
        Parameters:
        file - The path of the file to change ownership of.
        userId - The user that should own the file.
      • openSemaphore

        private VirtualMachine.ForOpenJ9.Dispatcher.ForJnaWindowsEnvironment.AttachmentHandle openSemaphore​(java.io.File directory,
                                                                                                            java.lang.String name,
                                                                                                            boolean global)
        Opens a semaphore for signaling another process that an attachment is performed.
        Parameters:
        directory - The control directory.
        name - The semaphore's name.
        global - true if the semaphore is in the global namespace.
        Returns:
        A handle for signaling an attachment to the target process.