Home | History | Annotate | Download | only in tutorial

Lines Matching full:loader

23 <br>3. <a href="#load">Class loader</a>
105 <p><code>toClass()</code> requests the context class loader for the current
206 the system class loader. In that case, an additional class path must be
392 for each class loader (i.e. container).
542 <h2>3. Class loader</h2>
555 the users must make Javassist collaborate with a class loader.
556 Javassist can be used with a class loader so that bytecode can be
558 version of class loader but they can also use a class loader provided
569 <code>toClass()</code>, which requests the context class loader for
621 throws an exception since the class loader cannot load two different
625 JBoss and Tomcat,</em> the context class loader used by
628 this exception, you must explicitly give an appropriate class loader
636 <p>would work. You should give <code>toClass()</code> the class loader
641 more complex functionality, you should write your own class loader.
648 each class loader creates its own name space.
657 Once a class loader loads a class, it cannot reload a modified
684 Suppose that a class loader CL loads a class including this code snippet.
687 CL also loads these classes (unless it delegates to another class loader).
699 Each class loader except the bootstrap loader has a
700 parent class loader, which has normally loaded the class of that child
701 class loader. Since the request to load a class can be delegated along this
702 hierarchy of class loaders, a class may be loaded by a class loader that
704 Therefore, the class loader that has been requested to load a class C
705 may be different from the loader that actually loads the class C.
706 For distinction, we call the former loader <em>the initiator of C</em>
707 and we call the latter loader <em>the real loader of C</em>.
710 Furthermore, if a class loader CL requested to load a class C
712 to the parent class loader PL, then the class loader CL is never requested
715 Instead, the parent class loader PL becomes their initiators
718 the real loader of C.</em>
729 public class Box { // the initiator is L but the real loader is PL
735 public class Window { // loaded by a class loader L
740 <p>Suppose that a class <code>Window</code> is loaded by a class loader L.
741 Both the initiator and the real loader of <code>Window</code> are L.
744 Here, suppose that L delegates this task to the parent class loader PL.
745 The initiator of <code>Box</code> is L but the real loader is PL.
747 since it is the same as the real loader of <code>Box</code>.
759 public class Box { // the initiator is L but the real loader is PL
765 public class Window { // loaded by a class loader L
774 <code>Point</code>. In this case, the class loader L must
783 Since the real loader of <code>Box</code> is PL,
826 <h3>3.3 Using <code>javassist.Loader</code></h3>
828 <p>Javassist provides a class loader
829 <code>javassist.Loader</code>. This class loader uses a
832 <p>For example, <code>javassist.Loader</code> can be used for loading
842 Loader cl = new Loader(pool);
861 the users can add an event listener to a <code>javassist.Loader</code>.
863 notified when the class loader loads a class.
874 is added to a <code>javassist.Loader</code> object by
875 <code>addTranslator()</code> in <code>javassist.Loader</code>. The
877 <code>javassist.Loader</code> loads a class. <code>onLoad()</code>
896 <code>javassist.Loader</code> calls these methods to obtain a class
909 Loader cl = new Loader();
926 access the <em>loader</em> classes such as <code>Main2</code>,
929 by <code>javassist.Loader</code> whereas the loader classes such as
930 <code>Main2</code> are by the default Java class loader.
932 <p><code>javassist.Loader</code> searches for classes in a different
935 the parent class loader and then attempts to load the classes
936 only if the parent class loader cannot find them.
938 <code>javassist.Loader</code> attempts
939 to load the classes before delegating to the parent class loader.
947 to be loaded by the parent class loader.
951 However, it delegates to the parent class loader if it fails
953 the parent class loader, the other classes referred to in that class will be
954 also loaded by the parent class loader and thus they are never modified.
956 real loader of C.
959 <code>javassist.Loader</code>.
963 <h3>3.4 Writing a class loader</h3>
965 <p>A simple class loader using Javassist is as follows:
1009 be loaded by the default system class loader, which is the parent
1010 loader of <code>SampleLoader</code>.
1018 <p>The class loader loads the class <code>MyApp</code>
1023 a more complex class loader, you may need detailed knowledge of
1037 loaded by a class loader other than the system class loader.
1038 Therefore, <code>SampleLoader</code> or <code>javassist.Loader</code>