Jump to content
Excelsior Forums
Sign in to follow this  
baikuo21

Problems about ClassLoader

Recommended Posts

JET implements its own bootstrap class loader that support loading classes compiled into dlls given JETVMPROP = -dll:ClassName1:DllName1 -dll:ClassName2:DllName2

But the classes loaded in this way are bound to the namespace of the bootstrap class loader.

How can I isolate the classes from different dlls?

Does JET provide any API to achieve this purpose?

Such as:

public static MyClassLoader extends ClassLoader
{
 public Class findClass(String className)
 {
   return com.excelsior_usa.jet.LibraryClassLoader.loadClassFromLibrary(this, className, "MyDll");
   // or something else could be invoked from different class loaders in order to give the classes different scopes
 }
}

If no, will it be yes with next release ?

Share this post


Link to post
Share on other sites

I do not think that we will implement such API at all due to compatibility issues: if you use such API your program will not run on another JVM. If you need class isolation, use standard custom classloading. Note however, that when you use custom classloading, the only way to trasnform your program to native binary by JET is using xjava launcher that comes with JET.

The only thing that we will probably implement (but not in the nearest release) the support for some types of custom classloaders. That will help you to transform your classes to DLL that will be loaded by your specific classloader. However this thing in the stage of investigation, since there are many pitfalls in this subject.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×