|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
public class SecureClassLoader
此類別擴展了 ClassLoader,使它另外還支持使用相關的程式碼源和權限定義類別,這些程式碼源和權限預設情況下可根據系統策略獲取到。
| 建構子摘要 | |
|---|---|
protected |
SecureClassLoader()
使用預設的父類別載入器為委託創建新 SecureClassLoader。 |
protected |
SecureClassLoader(ClassLoader parent)
使用指定的父類別載入器為委託創建新 SecureClassLoader。 |
| 方法摘要 | |
|---|---|
protected Class<?> |
defineClass(String name,
byte[] b,
int off,
int len,
CodeSource cs)
使用可選的 CodeSource 將 byte 陣列轉換為 Class 類別的實例。 |
protected Class<?> |
defineClass(String name,
ByteBuffer b,
CodeSource cs)
使用可選的 CodeSource 將 ByteBuffer 轉換為 Class 類別的實例。 |
protected PermissionCollection |
getPermissions(CodeSource codesource)
返回給定的 CodeSource 物件的權限。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
protected SecureClassLoader(ClassLoader parent)
如果有安全管理器,此方法會首先調用安全管理器的 checkCreateClassLoader 方法,以確保允許創建類別載入器。
parent - 父 ClassLoader
SecurityException - 如果安全管理器存在並且其 checkCreateClassLoader 方法不允許創建類別載入器。SecurityManager.checkCreateClassLoader()protected SecureClassLoader()
如果有安全管理器,此方法會首先調用安全管理器的 checkCreateClassLoader 方法,以確保允許創建類別載入器。
SecurityException - 如果安全管理器存在並且其 checkCreateClassLoader 方法不允許創建類別載入器。SecurityManager.checkCreateClassLoader()| 方法詳細資訊 |
|---|
protected final Class<?> defineClass(String name,
byte[] b,
int off,
int len,
CodeSource cs)
如果提供了非 null CodeSource,將建構 ProtectionDomain 並將其與要定義的類別關聯起來。
name - 期望的類別名稱,如果未知,則為 null,使用 '.'(而不是 '/')作為分隔符,並且末尾沒有 ".class" 後綴。b - 組成類別資料的位元組。從 off 到 off+len-1 的位元組應該具有由 Java Virtual Machine Specification 定義的有效類別檔案的格式。off - 類別資料的 b 的起始偏移量len - 類別資料的長度cs - 相關的 CodeSource,如果沒有,則為 null
Class 物件和可選的 CodeSource。
ClassFormatError - 如果資料未包含有效的類別
IndexOutOfBoundsException - 如果 off 或 len 為負數,或者 off+len 大於 b.length。
SecurityException - 如果試圖將該類別添加到包含用與該類別不同的證書集簽章的類別的套件中,或者類別名以 "java." 開頭。
protected final Class<?> defineClass(String name,
ByteBuffer b,
CodeSource cs)
ByteBuffer 轉換為 Class 類別的實例。類別必須解析後才能使用。
如果提供了非 null CodeSource,將建構 ProtectionDomain 並將其與要定義的類別關聯起來。
name - 期望的類別名稱,如果未知,則為 null,使用 '.'(而不是 '/')作為分隔符,並且末尾沒有 ".class" 後綴。b - 組成類別資料的位元組。從 b.position() 到 b.position() + b.limit() -1 的位元組應該具有由 Java Virtual Machine Specification 定義的有效類別檔案的格式。cs - 相關的 CodeSource,如果沒有,則為 null
Class 物件和可選的 CodeSource。
ClassFormatError - 如果資料未包含一個有效類別
SecurityException - 如果試圖將該類別添加到包含使用與該類別不同的證書集簽章的類別的套件中,或者類別名以 "java." 開頭。protected PermissionCollection getPermissions(CodeSource codesource)
此方法將由 defineClass 方法調用,後者在建構 ProtectionDomain 時將 CodeSource 作為要定義的類別的參數。
codesource - codesource。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。