org.jinterop.dcom.common
Interface IJIUnreferenced


public interface IJIUnreferenced

Implement this interface recieve notifications for IJIComObjects when they get GCed. This also means that the interface pointer (represented by IJIComObject in j-Interop) on the COM server side would have 0 reference count and will get Gced itself by COM runtime.


One note of caution, the IJIComObject is uniquely identified across the client-server relationship by it's IPID. The IPID should be used as a key to store a relevant "action" object when unReferenced method of this interface is invoked. If the IJIComObject is stored at a place solely for the purpose of this housekeeping than it will NEVER get Gced as j-Interop end, since the logic of GC is based on a Weak references. And that stored housekeeping reference is a strong one.

comObject.registerUnreferencedHandler(session, new IJIUnreferenced(){
public void unReferenced()
{
//do something here
}
});


Please refer to MSWMI example for more details on how to use this class.

Since:
1.21

Method Summary
 void unReferenced()
          Called when the IJIComObject associated with this interface is Gced by j-Interop.
 

Method Detail

unReferenced

void unReferenced()
Called when the IJIComObject associated with this interface is Gced by j-Interop.