The Artima Developer Community
Sponsored Link

Java Answers Forum
Unloading class loader

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
srinivasulu

Posts: 1
Nickname: ulu
Registered: Feb, 2003

Unloading class loader Posted: Feb 23, 2003 11:27 PM
Reply to this message Reply
Advertisement
Hi all,

How can we unload a our custom classloader? This is the code that i have written to use my own classloader to load classes.

Myloader ccl = new Myloader();
// Load the main class through our class loader
Class clas = ccl.loadClass( "mymainclass" );

Class mainArgType[] = { (new String[0]).getClass() };
// Find the standard main method in the class
Method main = clas.getMethod( "main", mainArgType );
Object argsArray[] = { progArgs };
// Call the main method
main.invoke( null, argsArray );

-> Inside the main iam just creating a thread and coming out.

-> Newly created thread waits for a connection from a client socket.

How can i unload the classloader so that i can unload all the classes loaded by my custom classloader.

If i unload my classloader what will happen to all the threads? If they continue to run, which class loader will it use to load the classes?

Thanks,
Srini.

Topic: Prime Numbers Previous Topic   Next Topic Topic: Getting IP address of Local Host

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use