Factory (JNA API)

com.sun.jna.platform.win32.COM.util

## Class Factory

- java.lang.Object
- - com.sun.jna.platform.win32.COM.util.Factory

-     public class Factory
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) ComThread` | `comThread`
    `(package private) java.util.WeakHashMap<ProxyObject,java.lang.Integer>` | `registeredObjects`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Factory()` Creates a utility COM Factory and a ComThread on which all COM calls are executed.
    `Factory(ComThread comThread)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `createObject(java.lang.Class<T> comInterface)` Creates a new COM object (CoCreateInstance) for the given progId and returns a ProxyObject for the given interface.
    `<T> T` | `createProxy(java.lang.Class<T> comInterface, IDispatch dispatch)` Creates a ProxyObject for the given interface and IDispatch pointer.
    `(package private) <T> T` | `createProxy(java.lang.Class<T> comInterface, long unknownId, IDispatch dispatch)` only for use when creating ProxyObjects from Callbacks
    `(package private) Guid.GUID` | `discoverClsId(ComObject annotation)`
    `void` | `disposeAll()`
    `<T> T` | `fetchObject(java.lang.Class<T> comInterface)` Gets and existing COM object (GetActiveObject) for the given progId and returns a ProxyObject for the given interface.
    `protected void` | `finalize()`
    `ComThread` | `getComThread()`
    `IRunningObjectTable` | `getRunningObjectTable()` CoInitialize must be called be fore this method.
    `void` | `register(ProxyObject proxyObject)`
    `void` | `unregister(ProxyObject proxyObject, int d)`

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

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

- - ### Field Detail

    - #### comThread

          ComThread comThread

    - #### registeredObjects

          java.util.WeakHashMap<ProxyObject,java.lang.Integer> registeredObjects

  - ### Constructor Detail

    - #### Factory

          public Factory()

      Creates a utility COM Factory and a ComThread on which all COM calls are executed. NOTE: Remember to call factory.getComThread().terminate() at some appropriate point.

    - #### Factory

          public Factory(ComThread comThread)

  - ### Method Detail

    - #### finalize

          protected void finalize()
                           throws java.lang.Throwable

      Overrides:
        `finalize` in class `java.lang.Object`
      Throws:
        `java.lang.Throwable`

    - #### getComThread

          public ComThread getComThread()

    - #### getRunningObjectTable

          public IRunningObjectTable getRunningObjectTable()

      CoInitialize must be called be fore this method. Either explicitly or implicitly via other methods.
      Returns:
        running object table

    - #### createProxy

          public <T> T createProxy(java.lang.Class<T> comInterface,
                          IDispatch dispatch)

      Creates a ProxyObject for the given interface and IDispatch pointer.

    - #### createProxy

          <T> T createProxy(java.lang.Class<T> comInterface,
                          long unknownId,
                          IDispatch dispatch)

      only for use when creating ProxyObjects from Callbacks
      Parameters:
        `comInterface` -
        `unknownId` -
        `dispatch` -
      Returns:
        proxy object

    - #### createObject

          public <T> T createObject(java.lang.Class<T> comInterface)

      Creates a new COM object (CoCreateInstance) for the given progId and returns a ProxyObject for the given interface.

    - #### fetchObject

          public <T> T fetchObject(java.lang.Class<T> comInterface)

      Gets and existing COM object (GetActiveObject) for the given progId and returns a ProxyObject for the given interface.

    - #### discoverClsId

          Guid.GUID discoverClsId(ComObject annotation)

    - #### register

          public void register(ProxyObject proxyObject)

    - #### unregister

          public void unregister(ProxyObject proxyObject,
                        int d)

    - #### disposeAll

          public void disposeAll()

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