Understanding the Java ClassLoader
#1

Understanding the Java ClassLoader

[attachment=18378]

Section 1. Tutorial tips Should I take this tutorial?

The Java ClassLoader is a crucial, but often overlooked, component of the Java run-time
system. It is the class responsible for finding and loading class files at run time. Creating your
own ClassLoader lets you customize the JVM in useful and interesting ways, allowing you to
completely redefine how class files are brought into the system.
This tutorial provides an overview of the Java ClassLoader and takes you through the
construction of an example ClassLoader that automatically compiles your code before
loading it. You'll learn exactly what a ClassLoader does and what you need to do to create
your own.
A basic understanding of Java programming, including the ability to create, compile, and
execute simple command-line Java programs, as well as an understanding of the class file
paradigm is sufficient background to take this tutorial.
Upon completion of this tutorial, you will know how to:
* Expand the functionality of the JVM
* Create a custom ClassLoader
* Learn how to integrate a custom ClassLoader into your Java application
* Modify your ClassLoader to accommodate the Java 2 release



Introduction
What is a ClassLoader?

Among commercially popular programming languages, the Java language distinguishes itself
by running on a Java virtual machine (JVM). This means that compiled programs are
expressed in a special, platform-independent format, rather than in the format of the
machine they are running on. This format differs from traditional executable program formats
in a number of important ways.
In particular, a Java program, unlike one written in C or C++, isn't a single executable file, but
instead is composed of many individual class files, each of which corresponds to a single
Java class.
Additionally, these class files are not loaded into memory all at once, but rather are loaded
on demand, as needed by the program. The ClassLoader is the part of the JVM that loads
classes into memory.
The Java ClassLoader, furthermore, is written in the Java language itself. This means that it's
easy to create your own ClassLoader without having to understand the finer details of the
JVM.

Why write a ClassLoader?

If the JVM has a ClassLoader, then why would you want to write another one? Good
question. The default ClassLoader only knows how to load class files from the local
filesystem. This is fine for regular situations, when you have your Java program fully
compiled and waiting on your computer.
But one of the most innovative things about the Java language is that it makes it easy for the
JVM to get classes from places other than the local hard drive or network. For example,
browsers use a custom ClassLoader to load executable content from a Web site.
There are many other ways to get class files. Besides simply loading files from the local disk
or from a network, you can use a custom ClassLoader to:
* Automatically verify a digital signature before executing untrusted code
* Transparently decrypt code with a user-supplied password
* Create dynamically built classes customized to the user's specific needs
Anything you can think of to write that can generate Java bytecode can be integrated into
your application.
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Privacy-Preserving Updates to Anonymous and Confidential Databases - JAVA project uploader 3 2,181 23-12-2012, 07:35 PM
Last Post: mr.patil1234
  Understanding Operational Amplifier Specifications seminar details 0 758 09-06-2012, 05:46 PM
Last Post: seminar details
  Java™: The Complete Reference, Seventh Edition project uploader 0 1,051 09-06-2012, 05:07 PM
Last Post: project uploader
  Understanding IP Addressing seminar details 0 658 08-06-2012, 01:59 PM
Last Post: seminar details
  An Ontology-Supported Web Focused-Crawler for Java Programs project uploader 0 1,166 08-06-2012, 11:31 AM
Last Post: project uploader
  Building a Java chat server seminar details 0 1,333 07-06-2012, 12:07 PM
Last Post: seminar details
  Java Basics project uploader 0 863 14-03-2012, 10:19 AM
Last Post: project uploader
  Object Oriented Programming with Java seminar paper 0 846 12-03-2012, 03:40 PM
Last Post: seminar paper
  Eclipse and Java seminar paper 0 1,185 24-02-2012, 04:51 PM
Last Post: seminar paper
  JAVA MESSAGING SERVICE seminar paper 0 789 21-02-2012, 01:43 PM
Last Post: seminar paper

Forum Jump: