Monday, May 26. 2008ClassLoader : brutal JAR insertion at runtime
I didn't remember where I found this, but I'd like to thank a lot the person who had invented it...
I'd never had figured such a thing by myself, or maybe after long and desperate nights of headache, as a last chance... But the fact is : it works ! And it works fine ! The idea is to insert new URLs in the system classloader, to allow some JARs to be part of it after startup... for me, it's was a manner to expose a kind of pluggable component feature : you just drop a JAR in a specific directory, and without modifying a single line of startup script or whatever, your jar comes to life automaticaly in the app. And now the beast, using a bit of reflective API, reaaaaally messy :
Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Dommage que je fasse plus de Java, c'est gé-nial comme truc. T'aurais pu me le dire avant
Et à propos de "où tu l'as trouvé", suffit de faire une recherche sur Google Source Code: http://www.google.com/codesearch?q=getSystemClassLoader+getDeclaredMethod+sysclass&hl=fr&btnG=Rechercher+du+code
Oui, reste maintenant à savoir qui en a eu l'idée le premier !!!
Mais sinon, c'est vrai que c'est génial ! |
QuicksearchCategoriesSyndicate This BlogBlog Administration |