Class WmiQueryExecutorJNA
java.lang.Object
oshi.util.platform.windows.WmiQueryExecutorJNA
- All Implemented Interfaces:
WmiQueryExecutor
Adapts the JNA
WmiQueryHandler to the common WmiQueryExecutor interface.-
Constructor Summary
ConstructorsConstructorDescriptionWmiQueryExecutorJNA(WmiQueryHandler handler) Creates an executor wrapping the given handler. -
Method Summary
Modifier and TypeMethodDescriptionstatic WmiQueryExecutorJNACreates an executor using a new default handler instance.Returns the underlying JNA handler, for COM init/uninit operations.Query WMI for values.Query WMI for values.
-
Constructor Details
-
WmiQueryExecutorJNA
Creates an executor wrapping the given handler.- Parameters:
handler- the JNA WMI query handler
-
-
Method Details
-
createInstance
Creates an executor using a new default handler instance.- Returns:
- a new executor, or
nullif handler creation fails
-
getHandler
Returns the underlying JNA handler, for COM init/uninit operations.- Returns:
- the JNA handler
-
queryWMI
Description copied from interface:WmiQueryExecutorQuery WMI for values. Initializes and uninitializes COM for each query.- Specified by:
queryWMIin interfaceWmiQueryExecutor- Type Parameters:
T- the enum type for the query properties- Parameters:
query- the WMI query- Returns:
- the query results
-
queryWMI
Description copied from interface:WmiQueryExecutorQuery WMI for values.- Specified by:
queryWMIin interfaceWmiQueryExecutor- Type Parameters:
T- the enum type for the query properties- Parameters:
query- the WMI queryinitCom- whether to initialize COM for this query. Iffalse, assumes COM is already initialized.- Returns:
- the query results
-