public class ProxyObject extends Object implements InvocationHandler, IDispatch, IRawDispatchHandle, IConnectionPoint
The caller of the methods is responsible for correct initialization of the COM runtime and appropriate thread-handling - depending on the choosen handling model.
Constructor and Description |
---|
ProxyObject(Class<?> theInterface,
IDispatch rawDispatch,
ObjectFactory factory) |
Modifier and Type | Method and Description |
---|---|
IComEventCallbackCookie |
advise(Class<?> comEventCallbackInterface,
IComEventCallbackListener comEventCallbackListener)
Set up the comEventCallbackListener to receive callback events from the target COM object
|
void |
dispose() |
boolean |
equals(Object arg) |
protected void |
finalize() |
<T> T |
getProperty(Class<T> returnType,
OaIdl.DISPID dispID,
Object... args) |
<T> T |
getProperty(Class<T> returnType,
String name,
Object... args) |
IDispatch |
getRawDispatch() |
int |
hashCode() |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
<T> T |
invokeMethod(Class<T> returnType,
OaIdl.DISPID dispID,
Object... args) |
<T> T |
invokeMethod(Class<T> returnType,
String name,
Object... args) |
protected WinNT.HRESULT |
oleMethod(int nType,
Variant.VARIANT.ByReference pvResult,
IDispatch pDisp,
OaIdl.DISPID dispId) |
protected WinNT.HRESULT |
oleMethod(int nType,
Variant.VARIANT.ByReference pvResult,
IDispatch pDisp,
OaIdl.DISPID dispId,
Variant.VARIANT pArg) |
protected WinNT.HRESULT |
oleMethod(int nType,
Variant.VARIANT.ByReference pvResult,
IDispatch pDisp,
OaIdl.DISPID dispId,
Variant.VARIANT[] pArgs) |
protected WinNT.HRESULT |
oleMethod(int nType,
Variant.VARIANT.ByReference pvResult,
IDispatch pDisp,
String name) |
protected WinNT.HRESULT |
oleMethod(int nType,
Variant.VARIANT.ByReference pvResult,
IDispatch pDisp,
String name,
Variant.VARIANT pArg) |
protected WinNT.HRESULT |
oleMethod(int nType,
Variant.VARIANT.ByReference pvResult,
IDispatch pDisp,
String name,
Variant.VARIANT[] pArgs) |
<T> T |
queryInterface(Class<T> comInterface)
Returns a proxy object for the given interface.
|
protected OaIdl.DISPID |
resolveDispId(IDispatch pDisp,
String name) |
<T> void |
setProperty(OaIdl.DISPID dispId,
T value) |
<T> void |
setProperty(String name,
T value) |
String |
toString() |
void |
unadvise(Class<?> comEventCallbackInterface,
IComEventCallbackCookie cookie)
Stop listening for callback events
|
public ProxyObject(Class<?> theInterface, IDispatch rawDispatch, ObjectFactory factory)
protected void finalize() throws Throwable
public void dispose()
public IDispatch getRawDispatch()
getRawDispatch
in interface IRawDispatchHandle
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
public IComEventCallbackCookie advise(Class<?> comEventCallbackInterface, IComEventCallbackListener comEventCallbackListener)
IConnectionPoint
advise
in interface IConnectionPoint
comEventCallbackInterface
- - the COM interface that the listener will receive events fromcomEventCallbackListener
- - and object that will receive the callback eventspublic void unadvise(Class<?> comEventCallbackInterface, IComEventCallbackCookie cookie)
IConnectionPoint
unadvise
in interface IConnectionPoint
comEventCallbackInterface
- - the interface that is being listened tocookie
- - the cookie that was returned when advise was calledpublic <T> void setProperty(String name, T value)
setProperty
in interface IDispatch
public <T> void setProperty(OaIdl.DISPID dispId, T value)
setProperty
in interface IDispatch
public <T> T getProperty(Class<T> returnType, String name, Object... args)
getProperty
in interface IDispatch
public <T> T getProperty(Class<T> returnType, OaIdl.DISPID dispID, Object... args)
getProperty
in interface IDispatch
public <T> T invokeMethod(Class<T> returnType, String name, Object... args)
invokeMethod
in interface IDispatch
public <T> T invokeMethod(Class<T> returnType, OaIdl.DISPID dispID, Object... args)
invokeMethod
in interface IDispatch
public <T> T queryInterface(Class<T> comInterface) throws COMException
IUnknown
queryInterface
in interface IUnknown
COMException
protected WinNT.HRESULT oleMethod(int nType, Variant.VARIANT.ByReference pvResult, IDispatch pDisp, String name, Variant.VARIANT pArg) throws COMException
COMException
protected WinNT.HRESULT oleMethod(int nType, Variant.VARIANT.ByReference pvResult, IDispatch pDisp, OaIdl.DISPID dispId, Variant.VARIANT pArg) throws COMException
COMException
protected WinNT.HRESULT oleMethod(int nType, Variant.VARIANT.ByReference pvResult, IDispatch pDisp, String name) throws COMException
COMException
protected WinNT.HRESULT oleMethod(int nType, Variant.VARIANT.ByReference pvResult, IDispatch pDisp, OaIdl.DISPID dispId) throws COMException
COMException
protected OaIdl.DISPID resolveDispId(IDispatch pDisp, String name)
protected WinNT.HRESULT oleMethod(int nType, Variant.VARIANT.ByReference pvResult, IDispatch pDisp, String name, Variant.VARIANT[] pArgs) throws COMException
COMException
protected WinNT.HRESULT oleMethod(int nType, Variant.VARIANT.ByReference pvResult, IDispatch pDisp, OaIdl.DISPID dispId, Variant.VARIANT[] pArgs) throws COMException
COMException