public class Factory extends Object
Modifier and Type | Field and Description |
---|---|
(package private) ComThread |
comThread |
(package private) WeakHashMap<ProxyObject,Integer> |
registeredObjects |
Constructor and Description |
---|
Factory()
Creates a utility COM Factory and a ComThread on which all COM calls are executed.
|
Factory(ComThread comThread) |
Modifier and Type | Method and Description |
---|---|
<T> T |
createObject(Class<T> comInterface)
Creates a new COM object (CoCreateInstance) for the given progId and
returns a ProxyObject for the given interface.
|
<T> T |
createProxy(Class<T> comInterface,
IDispatch dispatch)
Creates a ProxyObject for the given interface and IDispatch pointer.
|
(package private) <T> T |
createProxy(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(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) |
ComThread comThread
WeakHashMap<ProxyObject,Integer> registeredObjects
public Factory()
public Factory(ComThread comThread)
protected void finalize() throws Throwable
public ComThread getComThread()
public IRunningObjectTable getRunningObjectTable()
public <T> T createProxy(Class<T> comInterface, IDispatch dispatch)
<T> T createProxy(Class<T> comInterface, long unknownId, IDispatch dispatch)
comInterface
- unknownId
- dispatch
- public <T> T createObject(Class<T> comInterface)
public <T> T fetchObject(Class<T> comInterface)
public void register(ProxyObject proxyObject)
public void unregister(ProxyObject proxyObject, int d)
public void disposeAll()