Class DispatchProxy
public final class DispatchProxy
{
// Constructors
public DispatchProxy(Class exposedInterface, Object dispatch);
public DispatchProxy(Class exposedInterface, Object dispatch,
_Guid iid, Method dispIDMethods[], int dispIDs[]);
public DispatchProxy(Class exposedInterface, Object dispatch,
_Guid iid, Method dispIDMethods[], int dispIDs[], boolean
filterNonDispatchErrors);
// Methods
public void disconnectAsEventSink();
protected native void finalize();
public Class getExposedInterface();
public Object getUnderlyingObject();
}
This class wraps a dispatchable object with a Java interface.
public DispatchProxy(Class exposedInterface, Object dispatch);
Allocates a new DispatchProxy object.
Parameter | Description |
exposedInterface
| The signature of the IDispatch call.
|
dispatch
| The object that IDispatch calls.
|
Remarks:
Calls against the object on the exposed interface are translated to IDispatch::Invoke calls on the supplied dispatchable object. For this constructor, the first call to each method calls IDispatch::GetIDsOfNames to find the DISPID of the method, which is then cached. The IDispatch calls are made on the object's IID_IDispatch identity.
public DispatchProxy(Class exposedInterface, Object dispatch, _Guid iid,
Method dispIDMethods[], int dispIDs[]);
Allocates a new DispatchProxy object. All calls against this object on the exposed interface are translated to IDispatch::Invoke calls on the supplied dispatchable object.
The lists of methods and DISPIDs supplied by the dispIDMethods and DispIDs parameters are used to pre-assign the DISPIDs to the methods in the exposed interface. Unassigned methods call IDispatch::GetIDsOfNames to find the DISPID of the method, which is then cached. IDispatch calls are made on the supplied interface identifier, which defaults to IID_IDispatch.
Parameter | Description |
exposedInterface
| The signature of the IDispatch call.
|
dispatch
| The object that IDispatch calls.
|
iid
| The supplied interface identifier, which defaults to IID_IDispatch.
|
dispIDMethods
| The list of methods used to pre-assign the DISPIDs to the methods of the exposed interface.
|
dispIDs
| The list of DISPIDs used to pre-assign the DISPIDs to the methods of the exposed interface.
|
public DispatchProxy(Class exposedInterface, Object dispatch, _Guid iid,
Method dispIDMethods[], int dispIDs[],
boolean filterNonDispatchErrors);
Allocates a new DispatchProxy object. All calls against this object on the exposed interface are translated to IDispatch::Invoke calls on the supplied dispatchable object.
The lists of methods and DISPIDs supplied by the dispIDMethods and dispIDs parameters are used to pre-assign the DISPIDs to the methods in the exposed interface. Unassigned methods call IDispatch::GetIDsOfNames to find the DISPID of the method, which is then cached. IDispatch calls are made on the supplied interface identifier, which defaults to IID_IDispatch.
Parameter | Description |
exposedInterface
| The signature of the IDispatch call.
|
dispatch
| The object that IDispatch calls.
|
iid
| The dispatch interface identifier, which defaults to IID_IDispatch if null is passed.
|
dispIDMethods
| The list of methods used to pre-assign the DISPIDs to the methods of the exposed interface.
|
dispIDs
| The list of DISPIDs used to pre-assign the DISPIDs to the methods of the exposed interface.
|
filterNonDispatchErrors
| Indicates whether an error HRESULT besides DISP_E_EXCEPTION should generate Java exceptions when calling IDispatch.
|
public void disconnectAsEventSink();
Disconnects the current object from the underlying object. (The underlying object is the object that was originally passed to the DispatchProxy constructor via the dispatch parameter.)
Return Value:
No return value.
protected native void finalize();
Releases native resources associated with the current object.
Return Value:
No return value.
public Class getExposedInterface();
Retrieves the Java interface that is used as the template for IDispatch calls.
Return Value:
Returns the Java interface that is used as the template for IDispatch calls.
public Object getUnderlyingObject();
Retrieves the underlying dispatch object that is called by IDispatch. This object was passed to the DispatchProxy constructor via the dispatch parameter.
Return Value:
Returns the underlying dispatchable object.