View Javadoc
1   /*
2    * Copyright 2020-2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.demo;
6   
7   import oshi.util.platform.windows.WmiQueryHandler;
8   
9   /**
10   * Query handler class that avoids COM initialization overhead assuming COM is already initialized by the user.
11   */
12  public class WmiNoComInitQueryHandler extends WmiQueryHandler {
13  
14      /**
15       * Don't initialize COM, despite the method name. Overrides the superclass {@link WmiQueryHandler#initCOM()} method
16       * to bypass COM initialization.
17       */
18      @Override
19      public boolean initCOM() {
20          return false;
21      }
22  }