com.jacob.com

## Class DispatchProxy

- java.lang.Object
- - com.jacob.com.JacobObject
  - - com.jacob.com.DispatchProxy

    public class DispatchProxy
    extends JacobObject

If you need to pass a COM Dispatch object between STA threads, you have to marshall the interface. This class is used as follows: the STA that creates the Dispatch object must construct an instance of this class. Another thread can then call toDispatch() on that instance and get a Dispatch pointer which has been marshalled. WARNING: You can only call toDispatch() once! If you need to call it multiple times (or from multiple threads) you need to construct a separate DispatchProxy instance for each such case!

### Field Summary

Fields
`long` `m_pStream` Comment for `m_pStream`

### Constructor Summary

Constructors
Constructor and Description
`DispatchProxy(Dispatch localDispatch)` Marshals the passed in dispatch into the stream

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `finalize()`
`void` `safeRelease()` Finalizers call this method.
`Dispatch` `toDispatch()`

### Methods inherited from class com.jacob.com.JacobObject

`debug, getBuildDate, getBuildVersion, isDebugEnabled`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### m_pStream

    public long m_pStream

Comment for `m_pStream`

### Constructor Detail

#### DispatchProxy

    public DispatchProxy(Dispatch localDispatch)

Marshals the passed in dispatch into the stream

Parameters:
  `localDispatch` -

### Method Detail

#### toDispatch

    public Dispatch toDispatch()

Returns:
  Dispatch the dispatch retrieved from the stream

#### finalize

    public void finalize()

Overrides:
  `finalize` in class `java.lang.Object`

#### safeRelease

    public void safeRelease()

Description copied from class: `JacobObject`
Finalizers call this method. This method should release any COM data structures in a way that it can be called multiple times. This can happen if someone manually calls this and then a finalizer calls it.

Overrides:
  `safeRelease` in class `JacobObject`