5.6. Onward

Custom class loaders allow you to define your own strategy for locating code and resources. You can make your own rules, as long as you can take a Java class name and turn it into a byte array in the binary class format. With custom class loaders you might load classes from an object database, from source control, or over a custom network protocol.

Protocol handlers split the responsibility of class loading into two distinct tasks. A URLClassLoader instance performs security work, assigning the CodeSource that will be used to associate the class with its runtime permissions. A protocol handler defines a URL protocol for locating resources that you can plug in anywhere the Java platform uses URLs. For many custom class loading tasks, ...

Get Component Development for the Java™ Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.