37 |
|
|
38 |
package java.security; |
package java.security; |
39 |
|
|
40 |
|
import java.util.WeakHashMap; |
41 |
|
|
42 |
/** |
/** |
43 |
* A Secure Class Loader for loading classes with additional |
* A Secure Class Loader for loading classes with additional |
44 |
* support for specifying code source and permissions when |
* support for specifying code source and permissions when |
50 |
*/ |
*/ |
51 |
public class SecureClassLoader extends ClassLoader |
public class SecureClassLoader extends ClassLoader |
52 |
{ |
{ |
53 |
java.util.WeakHashMap protectionDomainCache = new java.util.WeakHashMap(); |
WeakHashMap<CodeSource, ProtectionDomain> protectionDomainCache |
54 |
|
= new WeakHashMap<CodeSource, ProtectionDomain>(); |
55 |
|
|
56 |
protected SecureClassLoader(ClassLoader parent) |
protected SecureClassLoader(ClassLoader parent) |
57 |
{ |
{ |
82 |
* |
* |
83 |
* @exception ClassFormatError if the byte array is not in proper classfile format. |
* @exception ClassFormatError if the byte array is not in proper classfile format. |
84 |
*/ |
*/ |
85 |
protected final Class defineClass(String name, byte[] b, int off, int len, |
protected final Class<?> defineClass(String name, byte[] b, int off, int len, |
86 |
CodeSource cs) |
CodeSource cs) |
87 |
{ |
{ |
88 |
if (cs != null) |
if (cs != null) |