Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Custome Class Loader

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the advantage of designing Custom Class Loader (Or)
Why Custom Class Loader to be designed?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only reason I've ever had was to set up a classpath from configuration to help load other classes. You could also make them get class files from non-standard places. Any others?
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can allow an end user to pick his own jdbc driver for instance. And if the classes are not found in the library the end user picked, you can tell the end user the library was improper. With existing classloaders, they will just start checking the system classloader for the classes. You may not want the system classloader checked.
 
Marshal
Posts: 27375
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to load a new version of a class when it is available, without having to stop and restart the JVM, a class-loader is essential. (I am not sure what "Custom" means in the original question.)
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'd use them whenever you need classes loaded in a different way than the standard classloader provides. Examples might be classes that are not in the classpath, classes that are encrypted on the disk, classes that are loaded from a database or over the network, or classes that are generated from source code.
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You'd use them whenever you need classes loaded in a different way than the standard classloader provides. Examples might be ... classes that are encrypted on the disk

True, but as this article demonstrates, there is no secure way to do this encryption currently:

http://www.javaworld.com/javaworld/javaqa/2003-05/01-qa-0509-jcrypt.html

Obfuscating class code seems to be more widely adopted.
 
Ulf Dittmer
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting article. But it supposes that unencrypted classes are available, which is the case only if the password has been entered (because otherwise no attempts would be made to unencrypt the classes). A determined attacker would buy a license, get a key, and be able to access the bytecode. For against a casual attacker -who might do this in order to avoid paying license fees- the scheme does add additional security. But as you point out, obfuscation should definitely be used as well.
[ June 11, 2006: Message edited by: Ulf Dittmer ]
 
Bras cause cancer. And tiny ads:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic