czwartek, marca 23, 2006

Frustracja....

Walczę nadal z ClassLoader'em. Wszystko wskazuje, że mój paskudny hack nie zadziała ;-)
Zagwozdka związana z tym hackiem wygląda tak, JVM woła z ClassLoader'a metodę loadClass(String,boolean), ale woła ją tylko raz... na to w każdym bądź razie wskazują moje doświadczenia. Nie rozumiem tego do końca ponieważ nawet w JavaDoc'u do loadClass(String,boolean) stoi:

Loads the class with the specified binary name. The default implementation of this method searches for classes in the following order:
1. Invoke findLoadedClass(String) to check if the class has already been loaded.
2. Invoke the loadClass method on the parent class loader. If the parent is null the class loader built-in to the virtual machine is used, instead.
3. Invoke the findClass(String) method to find the class.


Czyli mamy, że najpierw wołana jest metoda findLoadedClass(String), która to metoda zwraca definicje klasy jeżeli była ona już ładowana. Nie wprost, ale jednak sugeruje to, że loadClass(String,boolean) wołane jest za każdym razem gdy JVM żąda załadowania klasy... myślę, że będę musiał przestudiować specyfikacje JVM żeby dowiedzieć się jak to jest dokładniej :-)




Podobne postybeta
Wydało się ;-)
Nieznane ścieżki ClassLoader'a ;-)
Sortujemy JTable gdy się da ;-)
"Log porażek" ;-)
Sztuczki tropiciela błędów, part 2 ;-)

Brak komentarzy:

Prześlij komentarz