464 |
ProtectionDomain domain) |
ProtectionDomain domain) |
465 |
throws ClassFormatError |
throws ClassFormatError |
466 |
{ |
{ |
467 |
|
checkInitialized(); |
468 |
if (domain == null) |
if (domain == null) |
469 |
domain = StaticData.defaultProtectionDomain; |
domain = StaticData.defaultProtectionDomain; |
|
if (! initialized) |
|
|
throw new SecurityException("attempt to define class from uninitialized class loader"); |
|
470 |
|
|
471 |
return VMClassLoader.defineClass(this, name, data, offset, len, domain); |
return VMClassLoader.defineClass(this, name, data, offset, len, domain); |
472 |
} |
} |
481 |
*/ |
*/ |
482 |
protected final void resolveClass(Class c) |
protected final void resolveClass(Class c) |
483 |
{ |
{ |
484 |
|
checkInitialized(); |
485 |
VMClassLoader.resolveClass(c); |
VMClassLoader.resolveClass(c); |
486 |
} |
} |
487 |
|
|
497 |
protected final Class findSystemClass(String name) |
protected final Class findSystemClass(String name) |
498 |
throws ClassNotFoundException |
throws ClassNotFoundException |
499 |
{ |
{ |
500 |
|
checkInitialized(); |
501 |
return Class.forName(name, false, StaticData.systemClassLoader); |
return Class.forName(name, false, StaticData.systemClassLoader); |
502 |
} |
} |
503 |
|
|
534 |
*/ |
*/ |
535 |
protected final void setSigners(Class c, Object[] signers) |
protected final void setSigners(Class c, Object[] signers) |
536 |
{ |
{ |
537 |
|
checkInitialized(); |
538 |
c.setSigners(signers); |
c.setSigners(signers); |
539 |
} |
} |
540 |
|
|
547 |
*/ |
*/ |
548 |
protected final synchronized Class findLoadedClass(String name) |
protected final synchronized Class findLoadedClass(String name) |
549 |
{ |
{ |
550 |
|
checkInitialized(); |
551 |
return VMClassLoader.findLoadedClass(this, name); |
return VMClassLoader.findLoadedClass(this, name); |
552 |
} |
} |
553 |
|
|
1103 |
.initCause(e); |
.initCause(e); |
1104 |
} |
} |
1105 |
} |
} |
1106 |
|
|
1107 |
|
/** |
1108 |
|
* Before doing anything "dangerous" please call this method to make sure |
1109 |
|
* this class loader instance was properly constructed (and not obtained |
1110 |
|
* by exploiting the finalizer attack) |
1111 |
|
* @see #initialized |
1112 |
|
*/ |
1113 |
|
private void checkInitialized() |
1114 |
|
{ |
1115 |
|
if (! initialized) |
1116 |
|
throw new SecurityException("attempt to use uninitialized class loader"); |
1117 |
|
} |
1118 |
} |
} |