Overview of COM Attributes for Java Class Files |
![]() Previous |
![]() Virtual Machine |
![]() Next |
Java-callable wrappers (JCWs) for COM objects and proxies may contain Java-implemented methods, but no fields (other than those mapped to the underlying COM object) or any other dynamic state, because there is no way to specify a constructor to be called at marshaling time.
JCWs for COM objects will behave as expected wrt the "==" operator. That is, "==" will yield a true value if and only if the underlying COM objects have the same IUnknown pointer.
The "==" operator will not be maintained for Java-callable data wrappers (data proxies). The cost of maintaining identity for data proxies (many of which will be temporary stack-allocated arguments) is too high and data proxies are already non-Java-like, in that their useful lifetimes are determined externally rather than by garbage collection.