The baseclass for all non-exception types that are proxy types for Java types.
For a list of all members of this type, see JuggerNETProxyObject Members.
System.Object
Codemesh.JuggerNET.JuggerNETProxyObject
Codemesh.JuggerNET.JavaPeerValue
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
All proxy objects implement the JavaProxy interface and are IDisposable. The fact that a proxy object is an IDisposable means that you can use instances derived of this type with the using directive.
By default, if you do nothing special, you will have to wait for the .NET garbage collector to run and call the Dispose() method as part of its cleanup process. This delay can cause you trouble under certain circumstances. It means that the .NET side might not call the Dispose() method for a long time because there are not many .NET objects that need to be collected.
On the Java side the picture may look quite different: the few .NET objects that are waiting to be collected might be hanging on to a lot of Java objects and your application might actually run out of Java heap space before the .NET garbage collector sees any reason to run.
This is not too common a scenario, but even without this scenario there are some possible negative consequences. As the Java objects are held on to longer than normal, they might migrate from an easily and efficiently collectable part of the heap into more expensive to collect areas of the heap. This can impact your application's performance.
using( MyProxyType mpt = new MyProxyType() )
{
...
}
This pattern causes the .NET runtime to automatically call the Dispose() method when the scope of the using clause is exited. The Dispose() method takes care of freeing the Java reference so that the corresponding Java object will be eligible for garbage collection right away. Namespace: Codemesh.JuggerNET
Assembly: netrt (in netrt.dll)
JuggerNETProxyObject Members | Codemesh.JuggerNET Namespace