1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Fri Jan 14 17:00:47 PST 2000 -->
<TITLE>
: Class AdaptiveClassLoader
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> <FONT ID="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.ClassCacheEntry.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="AdaptiveClassLoader.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#inner_class_summary">INNER</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.java.lang</FONT>
<BR>
Class AdaptiveClassLoader</H2>
<PRE>
java.lang.Object
|
+--java.lang.ClassLoader
|
+--<B>org.apache.java.lang.AdaptiveClassLoader</B>
</PRE>
<HR>
<DL>
<DT>public class <B>AdaptiveClassLoader</B><DT>extends java.lang.ClassLoader</DL>
<P>
A class loader that loads classes from directories and/or zip-format
file such as JAR file. It tracks the modification time of the classes
it loads to permit reloading through re-instantiation.
<P>
When the classloader reports its creator that one of the classes it
has loaded has changed on disk, it should discard the classloader
and create a new instance using <CODE>reinstantiate</CODE>.
The classes are then reloaded into the new classloader as required.
<P>The classloader can also load resources, which are a means
for packaging application data such as images within a jar file
or directory.
<P>The classloader always first tries to load classes and resources
from the system, and uses it's own path if that fails. This is also
done if an empty repository is passed at construction.
<P><B>How autoreload works:</B></P>
<P>The Java VM considers two classes the same if they have the same
fully-qualified name <B>and</B> if they were loaded from the same
<CODE>ClassLoader</CODE>.
<P>There is no way for a classloader to 'undefine' a class once it
has been loaded. However, the servlet engine can discard a
classloader and the classes it contains, causing the
<P>The <CODE>JServServletManager</CODE> creates a new instance of
the classloader each time it detects that any of the loaded classes
have changed.
<P>Before terminating, all servlets are destroyed.
<P>According to the Java Language Specification (JLS), classes may
be garbage-collected when there are no longer any instances of that
class and the <CODE>java.lang.Class</CODE> object is finalizable.
It is intended that this be the case when a <CODE>JServClassLoader</CODE>
is discarded.
<P>Many VM releases did not implement class garbage collection
properly. In such a VM, the memory usage will continue to grow if
autoreloading is enable. Running the VM with
<CODE>-verbosegc</CODE> (or the corresponding option for
non-Javasoft VMs) may give some debugging information.
<P>It is important that the <CODE>destroy</CODE> method be
implemented properly, as servlets may be destroyed and
reinitialized several times in the life of a VM.
<P>
<DL>
<DT><B>Version: </B><DD>$Revision: 1.15 $ $Date: 1999/12/08 20:33:25 $</DD>
<DT><B>See Also: </B><DD><CODE>ClassLoader</CODE></DL>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<A NAME="inner_class_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Inner Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.ClassCacheEntry.html">AdaptiveClassLoader.ClassCacheEntry</A></B></CODE>
<BR>
Private class used to maintain information about the classes that
we loaded.</TD>
</TR>
</TABLE>
<A NAME="inner_classes_inherited_from_class_java.lang.ClassLoader"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Inner classes inherited from class java.lang.ClassLoader</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><B>java.lang.ClassLoader.NativeLibrary</B></CODE></TD>
</TR>
</TABLE>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.util.Hashtable</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#cache">cache</A></B></CODE>
<BR>
Cache of the loaded classes.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#generation">generation</A></B></CODE>
<BR>
Generation number of the classloader, used to distinguish between
different instances.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#generationCounter">generationCounter</A></B></CODE>
<BR>
Generation counter, incremented for each classloader as they are
created.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.util.Vector</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#repository">repository</A></B></CODE>
<BR>
The classpath which this classloader searches for class definitions.</TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_java.lang.ClassLoader"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Fields inherited from class java.lang.ClassLoader</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE>bootstrapClassPath,
classes,
defaultDomain,
defaultPermissions,
getClassLoaderPerm,
initialized,
loadedLibraryNames,
nativeLibraries,
nativeLibraryContext,
packages,
parent,
scl,
sclSet,
sys_paths,
systemNativeLibraries,
usr_paths</CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#AdaptiveClassLoader(java.util.Vector)">AdaptiveClassLoader</A></B>(java.util.Vector classRepository)</CODE>
<BR>
Creates a new class loader that will load classes from specified
class repositories.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.net.URL</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#getResource(java.lang.String)">getResource</A></B>(java.lang.String name)</CODE>
<BR>
Find a resource with a given name.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.io.InputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#getResourceAsStream(java.lang.String)">getResourceAsStream</A></B>(java.lang.String name)</CODE>
<BR>
Get an InputStream on a given resource.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#isZipOrJarArchive(java.io.File)">isZipOrJarArchive</A></B>(java.io.File file)</CODE>
<BR>
Test if a file is a ZIP or JAR archive.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#loadBytesFromStream(java.io.InputStream, int)">loadBytesFromStream</A></B>(java.io.InputStream in,
int length)</CODE>
<BR>
Loads all the bytes of an InputStream.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected java.lang.Class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#loadClass(java.lang.String, boolean)">loadClass</A></B>(java.lang.String name,
boolean resolve)</CODE>
<BR>
Resolves the specified name to a Class.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#loadClassFromDirectory(java.io.File, java.lang.String, org.apache.java.lang.AdaptiveClassLoader.ClassCacheEntry)">loadClassFromDirectory</A></B>(java.io.File dir,
java.lang.String name,
<A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.ClassCacheEntry.html">AdaptiveClassLoader.ClassCacheEntry</A> cache)</CODE>
<BR>
Tries to load the class from a directory.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#loadClassFromZipfile(java.io.File, java.lang.String, org.apache.java.lang.AdaptiveClassLoader.ClassCacheEntry)">loadClassFromZipfile</A></B>(java.io.File file,
java.lang.String name,
<A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.ClassCacheEntry.html">AdaptiveClassLoader.ClassCacheEntry</A> cache)</CODE>
<BR>
Tries to load the class from a zip file.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.io.InputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#loadResourceFromDirectory(java.io.File, java.lang.String)">loadResourceFromDirectory</A></B>(java.io.File dir,
java.lang.String name)</CODE>
<BR>
Loads resource from a directory.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.io.InputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#loadResourceFromZipfile(java.io.File, java.lang.String)">loadResourceFromZipfile</A></B>(java.io.File file,
java.lang.String name)</CODE>
<BR>
Loads resource from a zip file</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.lang.Class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#loadSystemClass(java.lang.String, boolean)">loadSystemClass</A></B>(java.lang.String name,
boolean resolve)</CODE>
<BR>
Load a class using the system classloader.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html">AdaptiveClassLoader</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#reinstantiate()">reinstantiate</A></B>()</CODE>
<BR>
Re-instantiate this class loader.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#securityAllowsClass(java.lang.String)">securityAllowsClass</A></B>(java.lang.String className)</CODE>
<BR>
Checks whether a classloader is allowed to define a given class,
within the security manager restrictions.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#shouldReload()">shouldReload</A></B>()</CODE>
<BR>
Check whether the classloader should be reinstantiated.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html#shouldReload(java.lang.String)">shouldReload</A></B>(java.lang.String classname)</CODE>
<BR>
Check to see if a given class should be reloaded because of a
modification to the original class.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.ClassLoader"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.ClassLoader</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><clinit>,
addClass,
check,
defineClass,
defineClass,
defineClass,
defineClass0,
definePackage,
findBootstrapClass,
findClass,
findLibrary,
findLoadedClass,
findNative,
findResource,
findResources,
findSystemClass,
getBootstrapClassPath,
getBootstrapResource,
getBootstrapResources,
getCallerClassLoader,
getDefaultDomain,
getGetClassLoaderPerm,
getPackage,
getPackages,
getParent,
getResources,
getSystemClassLoader,
getSystemResource,
getSystemResourceAsStream,
getSystemResources,
initializePath,
isAncestor,
loadClass,
loadLibrary,
loadLibrary0,
resolveClass,
resolveClass0,
setSigners</CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE>clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="generationCounter"><!-- --></A><H3>
generationCounter</H3>
<PRE>
private static int <B>generationCounter</B></PRE>
<DL>
<DD>Generation counter, incremented for each classloader as they are
created.</DL>
<HR>
<A NAME="generation"><!-- --></A><H3>
generation</H3>
<PRE>
private int <B>generation</B></PRE>
<DL>
<DD>Generation number of the classloader, used to distinguish between
different instances.</DL>
<HR>
<A NAME="cache"><!-- --></A><H3>
cache</H3>
<PRE>
private java.util.Hashtable <B>cache</B></PRE>
<DL>
<DD>Cache of the loaded classes. This contains ClassCacheEntry keyed
by class names.</DL>
<HR>
<A NAME="repository"><!-- --></A><H3>
repository</H3>
<PRE>
private java.util.Vector <B>repository</B></PRE>
<DL>
<DD>The classpath which this classloader searches for class definitions.
Each element of the vector should be either a directory, a .zip
file, or a .jar file.
<p>
It may be empty when only system classes are controlled.</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="AdaptiveClassLoader(java.util.Vector)"><!-- --></A><H3>
AdaptiveClassLoader</H3>
<PRE>
public <B>AdaptiveClassLoader</B>(java.util.Vector classRepository)
throws java.lang.IllegalArgumentException</PRE>
<DL>
<DD>Creates a new class loader that will load classes from specified
class repositories.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>classRepository</CODE> - An set of File classes indicating
directories and/or zip/jar files. It may be empty when
only system classes are loaded.</DL>
</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="isZipOrJarArchive(java.io.File)"><!-- --></A><H3>
isZipOrJarArchive</H3>
<PRE>
private boolean <B>isZipOrJarArchive</B>(java.io.File file)</PRE>
<DL>
<DD>Test if a file is a ZIP or JAR archive.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>file</CODE> - the file to be tested.<DT><B>Returns:</B><DD>true if the file is a ZIP/JAR archive, false otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="shouldReload(java.lang.String)"><!-- --></A><H3>
shouldReload</H3>
<PRE>
public boolean <B>shouldReload</B>(java.lang.String classname)</PRE>
<DL>
<DD>Check to see if a given class should be reloaded because of a
modification to the original class.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>className</CODE> - The name of the class to check for modification.</DL>
</DD>
</DL>
<HR>
<A NAME="shouldReload()"><!-- --></A><H3>
shouldReload</H3>
<PRE>
public boolean <B>shouldReload</B>()</PRE>
<DL>
<DD>Check whether the classloader should be reinstantiated.
<P>
The classloader must be replaced if there is any class whose
origin file has changed since it was last loaded.</DL>
<HR>
<A NAME="reinstantiate()"><!-- --></A><H3>
reinstantiate</H3>
<PRE>
public <A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.html">AdaptiveClassLoader</A> <B>reinstantiate</B>()</PRE>
<DL>
<DD>Re-instantiate this class loader.
<p>
This method creates a new instance
of the class loader that will load classes form the same path
as this one.</DL>
<HR>
<A NAME="loadClass(java.lang.String, boolean)"><!-- --></A><H3>
loadClass</H3>
<PRE>
protected java.lang.Class <B>loadClass</B>(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException</PRE>
<DL>
<DD>Resolves the specified name to a Class. The method loadClass()
is called by the virtual machine. As an abstract method,
loadClass() must be defined in a subclass of ClassLoader.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the desired Class.<DD><CODE>resolve</CODE> - true if the Class needs to be resolved;
false if the virtual machine just wants to determine
whether the class exists or not<DT><B>Returns:</B><DD>the resulting Class.<DT><B>Throws:</B><DD>java.lang.ClassNotFoundException - if the class loader cannot
find a the requested class.<DT><B>Overrides:</B><DD>loadClass in class java.lang.ClassLoader</DL>
</DD>
</DL>
<HR>
<A NAME="loadSystemClass(java.lang.String, boolean)"><!-- --></A><H3>
loadSystemClass</H3>
<PRE>
private java.lang.Class <B>loadSystemClass</B>(java.lang.String name,
boolean resolve)
throws java.lang.NoClassDefFoundError,
java.lang.ClassNotFoundException</PRE>
<DL>
<DD>Load a class using the system classloader.<DD><DL>
<DT><B>Throws:</B><DD>java.lang.ClassNotFoundException - if the class loader cannot
find a the requested class.<DD>java.lang.NoClassDefFoundError - if the class loader cannot
find a definition for the class.</DL>
</DD>
</DL>
<HR>
<A NAME="securityAllowsClass(java.lang.String)"><!-- --></A><H3>
securityAllowsClass</H3>
<PRE>
private boolean <B>securityAllowsClass</B>(java.lang.String className)</PRE>
<DL>
<DD>Checks whether a classloader is allowed to define a given class,
within the security manager restrictions.</DL>
<HR>
<A NAME="loadClassFromDirectory(java.io.File, java.lang.String, org.apache.java.lang.AdaptiveClassLoader.ClassCacheEntry)"><!-- --></A><H3>
loadClassFromDirectory</H3>
<PRE>
private byte[] <B>loadClassFromDirectory</B>(java.io.File dir,
java.lang.String name,
<A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.ClassCacheEntry.html">AdaptiveClassLoader.ClassCacheEntry</A> cache)
throws java.io.IOException</PRE>
<DL>
<DD>Tries to load the class from a directory.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dir</CODE> - The directory that contains classes.<DD><CODE>name</CODE> - The classname<DD><CODE>cache</CODE> - The cache entry to set the file if successful.</DL>
</DD>
</DL>
<HR>
<A NAME="loadClassFromZipfile(java.io.File, java.lang.String, org.apache.java.lang.AdaptiveClassLoader.ClassCacheEntry)"><!-- --></A><H3>
loadClassFromZipfile</H3>
<PRE>
private byte[] <B>loadClassFromZipfile</B>(java.io.File file,
java.lang.String name,
<A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.ClassCacheEntry.html">AdaptiveClassLoader.ClassCacheEntry</A> cache)
throws java.io.IOException</PRE>
<DL>
<DD>Tries to load the class from a zip file.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>file</CODE> - The zipfile that contains classes.<DD><CODE>name</CODE> - The classname<DD><CODE>cache</CODE> - The cache entry to set the file if successful.</DL>
</DD>
</DL>
<HR>
<A NAME="loadBytesFromStream(java.io.InputStream, int)"><!-- --></A><H3>
loadBytesFromStream</H3>
<PRE>
private byte[] <B>loadBytesFromStream</B>(java.io.InputStream in,
int length)
throws java.io.IOException</PRE>
<DL>
<DD>Loads all the bytes of an InputStream.</DL>
<HR>
<A NAME="getResourceAsStream(java.lang.String)"><!-- --></A><H3>
getResourceAsStream</H3>
<PRE>
public java.io.InputStream <B>getResourceAsStream</B>(java.lang.String name)</PRE>
<DL>
<DD>Get an InputStream on a given resource. Will return null if no
resource with this name is found.
<p>
The JServClassLoader translate the resource's name to a file
or a zip entry. It looks for the resource in all its repository
entry.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the resource, to be used as is.<DT><B>Returns:</B><DD>an InputStream on the resource, or null if not found.<DT><B>Overrides:</B><DD>getResourceAsStream in class java.lang.ClassLoader<DT><B>See Also: </B><DD><CODE>Class.getResourceAsStream(String)</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="loadResourceFromDirectory(java.io.File, java.lang.String)"><!-- --></A><H3>
loadResourceFromDirectory</H3>
<PRE>
private java.io.InputStream <B>loadResourceFromDirectory</B>(java.io.File dir,
java.lang.String name)</PRE>
<DL>
<DD>Loads resource from a directory.</DL>
<HR>
<A NAME="loadResourceFromZipfile(java.io.File, java.lang.String)"><!-- --></A><H3>
loadResourceFromZipfile</H3>
<PRE>
private java.io.InputStream <B>loadResourceFromZipfile</B>(java.io.File file,
java.lang.String name)</PRE>
<DL>
<DD>Loads resource from a zip file</DL>
<HR>
<A NAME="getResource(java.lang.String)"><!-- --></A><H3>
getResource</H3>
<PRE>
public java.net.URL <B>getResource</B>(java.lang.String name)</PRE>
<DL>
<DD>Find a resource with a given name. The return is a URL to the
resource. Doing a getContent() on the URL may return an Image,
an AudioClip,or an InputStream.
<p>
This classloader looks for the resource only in the directory
repository for this resource.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the resource, to be used as is.<DT><B>Returns:</B><DD>an URL on the resource, or null if not found.<DT><B>Overrides:</B><DD>getResource in class java.lang.ClassLoader</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> <FONT ID="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../../../org/apache/java/lang/AdaptiveClassLoader.ClassCacheEntry.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="AdaptiveClassLoader.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#inner_class_summary">INNER</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
|