The Factory abstracts the necessity to handle COM threading by introducing a dispatching thread, that is correctly COM initialized and is used to handle all outgoing calls.
Note
Remember to call factory.getComThread().terminate() at some appropriate point, when the factory is not used anymore
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | appendStacktrace(Exception caughtException, Throwable toBeThrown)
Append the stack trace available via caughtException to the stack trace of toBeThrown. |
| pack-priv IDispatchCallback | createDispatchCallback(Class<?> comEventCallbackInterface, IComEventCallbackListener comEventCallbackListener)
Overrides com. |
| public <T> T | createObject(final Class<T> comInterface)
Overrides com. |
| public <T> T | createProxy(Class<T> comInterface, IDispatch dispatch)
Overrides com. |
| pack-priv Guid. | discoverClsId(final ComObject annotation)
Overrides com. |
| public <T> T | fetchObject(final Class<T> comInterface)
Overrides com. |
| public ComThread | |
| public IRunningObjectTable | getRunningObjectTable()
Overrides com. |
| private <T> T |
| comThread | back to summary |
|---|---|
| private ComThread comThread | |
| Factory | back to summary |
|---|---|
| public Factory() | |
| Factory | back to summary |
|---|---|
| public Factory(ComThread comThread) | |
| appendStacktrace | back to summary |
|---|---|
| private static void appendStacktrace(Exception caughtException, Throwable toBeThrown) Append the stack trace available via caughtException to the stack trace of toBeThrown. The combined stack trace is reassigned to toBeThrown | |
| createDispatchCallback | back to summary |
|---|---|
| pack-priv IDispatchCallback createDispatchCallback(Class<?> comEventCallbackInterface, IComEventCallbackListener comEventCallbackListener) Overrides com.
| |
| createObject | back to summary |
|---|---|
| public <T> T createObject(final Class<T> comInterface) Overrides com. Doc from com. Creates a new COM object (CoCreateInstance) for the given progId and returns a ProxyObject for the given interface.
| |
| createProxy | back to summary |
|---|---|
| public <T> T createProxy(Class<T> comInterface, IDispatch dispatch) Overrides com. Doc from com. Creates a ProxyObject for the given interface and IDispatch pointer.
| |
| discoverClsId | back to summary |
|---|---|
| pack-priv Guid. Overrides com.
| |
| fetchObject | back to summary |
|---|---|
| public <T> T fetchObject(final Class<T> comInterface) throws COMException Overrides com. Doc from com. Gets and existing COM object (GetActiveObject) for the given progId and returns a ProxyObject for the given interface.
| |
| getComThread | back to summary |
|---|---|
| public ComThread getComThread() | |
| getRunningObjectTable | back to summary |
|---|---|
| public IRunningObjectTable getRunningObjectTable() Overrides com. Doc from com. CoInitialize must be called be fore this method. Either explicitly or implicitly via other methods.
| |
| runInComThread | back to summary |
|---|---|
| private <T> T runInComThread(Callable<T> callable) | |
| Access | Constructor and Description |
|---|---|
| public | CallbackProxy2(ObjectFactory factory, Class<?> comEventCallbackInterface, IComEventCallbackListener comEventCallbackListener)
|
| Modifier and Type | Method and Description |
|---|---|
| public WinNT. | Invoke(OaIdl.
Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifier. dispIdMember,Reserved for future use. Must be IID_NULL. riid,The locale context in which to interpret arguments. The lcid is used by the GetIDsOfNames function, and is also
passed to Invoke to allow the object to interpret its arguments specific to a locale.
lcid,Applications that do not support multiple national languages can ignore this parameter. For more information, refer to Supporting Multiple National Languages and Exposing ActiveX Objects. Flags describing the context of the Invoke call.
DISPATCH_METHOD
The member is invoked as a method. If a property has the same name, both this and the DISPATCH_PROPERTYGET flag can be set.
DISPATCH_PROPERTYGET
The member is retrieved as a property or data member.
DISPATCH_PROPERTYPUT
The member is changed as a property or data member.
DISPATCH_PROPERTYPUTREF
The member is changed by a reference assignment, rather than a value assignment. This flag is valid only when the property accepts a reference to an object. wFlags,Pointer to a DISPPARAMS structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays. pDispParams,Pointer to the location where the result is to be stored, or NULL if the caller expects no result. This argument is ignored if DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF is specified. pVarResult,Pointer to a structure that contains exception information. This structure should be filled in if DISP_E_EXCEPTION is returned. Can be NULL. pExcepInfo,The index within rgvarg of the first argument that has an error. Arguments are stored in pDispParams->rgvarg in reverse order,
so the first argument is the one with the highest index in the array. This parameter is returned only when the resulting return
value is DISP_E_TYPEMISMATCH or DISP_E_PARAMNOTFOUND. This argument can be set to null. For details, see Returning Errors. puArgErr)Overrides com. Implements com. |
| CallbackProxy2 | back to summary |
|---|---|
| public CallbackProxy2(ObjectFactory factory, Class<?> comEventCallbackInterface, IComEventCallbackListener comEventCallbackListener) | |
| Invoke | back to summary |
|---|---|
| public WinNT. Overrides com. Implements com. Doc from com. Provides access to properties and methods exposed by an object. The dispatch function DispInvoke provides a standard implementation of Invoke.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | invoke(final Object
the proxy instance that the method was invoked on proxy, final Method the method, final Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. |
| delegate | back to summary |
|---|---|
| private final Object delegate | |
| ProxyObject2 | back to summary |
|---|---|
| public ProxyObject2(Object delegate) | |
| invoke | back to summary |
|---|---|
| public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |