Package com.ms.com Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class DispatchProxy

Constructors , Methods

public final class DispatchProxy {
  // Constructors
  public DispatchProxy(Class exposedInterface, Object dispatch);
  public DispatchProxy(Class exposedInterface, Object dispatch, _Guid iid,
        Method dispIDMethods[], int dispIDs[]);
  // Methods
  public Class getExposedInterface();
  public Object getUnderlyingObject();
  public void disconnectAsEventSink();
  protected native void finalize();
}

The DispatchProxy class wraps a dispatchable object with a Java interface.


Constructors


DispatchProxy

public DispatchProxy(Class exposedInterface, Object dispatch);

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. For this constructor, the first call to each method calls IDispatch::GetIDsOfNames to find the DISPID of the method, which is then cached. All IDispatch calls are made on the object's IID_IDispatch identity.

ParameterDescription
exposedInterface The signature of the IDispatch call.
dispatch The object that IDispatch calls.


DispatchProxy

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 supplied list of methods and DISPIDs are used to preassign the DISPIDs for the exposed interface's methods. All unassigned methods call IDispatch::GetIDsOfNames to find the DISPID of the method, which is then cached. All IDispatch calls are made on the supplied interface ID, which defaults to IID_IDispatch.

ParameterDescription
exposedInterface The signature of the IDispatch call.
dispatch The object that IDispatch calls.
iid The supplied interface ID. The IID parameter defaults to IID_IDispatch.
dispIDMethods The list of methods used to preassign the DISPIDs for the exposed interface's methods.
dispIDs The list of DISPIDs used to preassign the DISPIDs for the exposed interface's methods.


Methods


getExposedInterface

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.


getUnderlyingObject

public Object getUnderlyingObject();

Retrieves the underlying object that is called by IDispatch.

Return Value:

Returns the underlying dispatchable object.


disconnectAsEventSink

public void disconnectAsEventSink();

Disconnects this object from the underlying object. All future calls on a method with a non-void return type throw a NullPointerException.

Return Value:

No return value.


finalize

protected native void finalize();

Releases native resources.

Return Value:

No return value.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.