W32Service (JNA API)

com.sun.jna.platform.win32

## Class W32Service

- java.lang.Object
- - com.sun.jna.platform.win32.W32Service

-     public class W32Service
      extends java.lang.Object

  Win32 Service wrapper
  Author:
    EugineLev

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) Winsvc.SC_HANDLE` | `_handle`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `W32Service(Winsvc.SC_HANDLE handle)` Win32 Service

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close service.
    `void` | `continueService()` Continue service.
    `Winsvc.SC_HANDLE` | `getHandle()` Gets the service handle.
    `void` | `pauseService()` Pause service.
    `Winsvc.SERVICE_STATUS_PROCESS` | `queryStatus()` Retrieves the current status of the specified service based on the specified information level.
    `void` | `startService()`
    `void` | `stopService()` Stop service.
    `void` | `waitForNonPendingState()` Wait for the state to change to something other than a pending state.

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

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

- - ### Field Detail

    - #### _handle

          Winsvc.SC_HANDLE _handle

  - ### Constructor Detail

    - #### W32Service

          public W32Service(Winsvc.SC_HANDLE handle)

      Win32 Service
      Parameters:
        `handle` - A handle to the service. This handle is returned by the CreateService or OpenService function, and it must have the SERVICE_QUERY_STATUS access right.

  - ### Method Detail

    - #### close

          public void close()

      Close service.

    - #### queryStatus

          public Winsvc.SERVICE_STATUS_PROCESS queryStatus()

      Retrieves the current status of the specified service based on the specified information level.
      Returns:
        Service status information

    - #### startService

          public void startService()

    - #### stopService

          public void stopService()

      Stop service.

    - #### continueService

          public void continueService()

      Continue service.

    - #### pauseService

          public void pauseService()

      Pause service.

    - #### waitForNonPendingState

          public void waitForNonPendingState()

      Wait for the state to change to something other than a pending state.

    - #### getHandle

          public Winsvc.SC_HANDLE getHandle()

      Gets the service handle.
      Returns:
        Returns the service handle.

Copyright © 2007-2016 Timothy Wall. All Rights Reserved.