Kstat2.Kstat2Handle (JNA API)
Description: declaration: package: com.sun.jna.platform.unix.solaris, interface: Kstat2, class: Kstat2Handle

Package com.sun.jna.platform.unix.solaris

# Class Kstat2.Kstat2Handle

java.lang.Object
com.sun.jna.PointerType
com.sun.jna.platform.unix.solaris.Kstat2.Kstat2Handle

All Implemented Interfaces:
  `NativeMapped`

Enclosing interface:
  Kstat2

public static class Kstat2.Kstat2Handle extends PointerType
Opaque kstat handle.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Kstat2Handle()`
  Instantiates and opens a new Kstat2Handle with no filtering.
  `Kstat2Handle(Kstat2.Kstat2MatcherList matchers)`
  Instantiates and opens a new Kstat2Handle filtered with the provided matcher.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `close()`
  Convenience method for `Kstat2.kstat2_close(PointerByReference)`.
  `Kstat2.Kstat2Map`
  `lookupMap(String uri)`
  Convenience method for `Kstat2.kstat2_lookup_map(Kstat2Handle, String, PointerByReference)` that obtains a reference to a kstat2 map given the URI of the map.
  `int`
  `update()`
  Convenience method for `Kstat2.kstat2_update(Kstat2Handle)` that synchronises the user's view with that of the kernel.

  ### Methods inherited from class com.sun.jna.PointerType

  `equals, fromNative, getPointer, hashCode, nativeType, setPointer, toNative, toString`

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

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Kstat2Handle

    public Kstat2Handle()
    Instantiates and opens a new Kstat2Handle with no filtering. All of the system's kstats will be available. Convenience method for `Kstat2.kstat2_open(PointerByReference, Kstat2MatcherList)` with a null matcher list.

  - ### Kstat2Handle

    public Kstat2Handle(Kstat2.Kstat2MatcherList matchers)
    Instantiates and opens a new Kstat2Handle filtered with the provided matcher. Convenience method for `Kstat2.kstat2_open(PointerByReference, Kstat2MatcherList)`.
    Parameters:
      `matchers` - Only kstats that match one or more of the provided matchers will be available. If a NULL or empty matcher list is provided, all of the system's kstats will be available. Restricting the number of kstats available will improve performance and reduce the memory footprint.

- ## Method Details

  - ### update

    public int update()
    Convenience method for `Kstat2.kstat2_update(Kstat2Handle)` that synchronises the user's view with that of the kernel. The kernel may at any point add or remove kstats, causing the user's view of the available kstats to become out of date.
    Returns:
      Upon successful completion, returns a int value of `Kstat2.KSTAT2_S_OK`. If an error occurs a value other than KSTAT2_S_OK is returned.

  - ### lookupMap

    public Kstat2.Kstat2Map lookupMap(String uri)
    Convenience method for `Kstat2.kstat2_lookup_map(Kstat2Handle, String, PointerByReference)` that obtains a reference to a kstat2 map given the URI of the map.
    Parameters:
      `uri` - The URI of the map to return.
    Returns:
      A reference to the map.

  - ### close

    public int close()
    Convenience method for `Kstat2.kstat2_close(PointerByReference)`. After use, the kstat handle should be closed to reclaim the handles and memory that it allocated on open.
    Returns:
      Upon successful completion, returns a int value of `Kstat2.KSTAT2_S_OK`. If an error occurs a value other than KSTAT2_S_OK is returned.