Most visited

Recently visited

Added in API level 1

SecurityManager

public class SecurityManager
extends Object

java.lang.Object
   ↳ java.lang.SecurityManager


旧版安全代码; 不使用。

Summary

Fields

protected boolean inCheck

此字段在API级别1中已弃用。请改为使用checkPermission(Permission)

Public constructors

SecurityManager()

Public methods

void checkAccept(String host, int port)
void checkAccess(Thread t)
void checkAccess(ThreadGroup g)
void checkAwtEventQueueAccess()
void checkConnect(String host, int port)
void checkConnect(String host, int port, Object context)
void checkCreateClassLoader()
void checkDelete(String file)
void checkExec(String cmd)
void checkExit(int status)
void checkLink(String lib)
void checkListen(int port)
void checkMemberAccess(Class<?> clazz, int which)
void checkMulticast(InetAddress maddr)
void checkMulticast(InetAddress maddr, byte ttl)

此方法在API级别1中已弃用。 checkMulticast(java.net.InetAddress)改为使用checkMulticast(java.net.InetAddress)

void checkPackageAccess(String pkg)
void checkPackageDefinition(String pkg)
void checkPermission(Permission perm, Object context)
void checkPermission(Permission perm)
void checkPrintJobAccess()
void checkPropertiesAccess()
void checkPropertyAccess(String key)
void checkRead(FileDescriptor fd)
void checkRead(String file)
void checkRead(String file, Object context)
void checkSecurityAccess(String target)
void checkSetFactory()
void checkSystemClipboardAccess()
boolean checkTopLevelWindow(Object window)
void checkWrite(FileDescriptor fd)
void checkWrite(String file)
boolean getInCheck()

此方法在API级别1中已被弃用。请改为使用checkPermission(Permission)

Object getSecurityContext()
ThreadGroup getThreadGroup()

返回当前线程的线程组。

Protected methods

int classDepth(String name)

此方法在API级别1中已弃用。请改为使用checkPermission(Permission)

int classLoaderDepth()

此方法在API级别1中已弃用。请改用checkPermission(Permission)

ClassLoader currentClassLoader()

此方法在API级别1中已弃用。请改用checkPermission(Permission)

Class<?> currentLoadedClass()

此方法在API级别1中已弃用。请改用checkPermission(Permission)

Class[] getClassContext()
boolean inClass(String name)

此方法在API级别1中已弃用。请改用checkPermission(Permission)

boolean inClassLoader()

此方法在API级别1中已弃用。请改用checkPermission(Permission)

Inherited methods

From class java.lang.Object

Fields

inCheck

Added in API level 1
boolean inCheck

此字段在API级别1中已被弃用。
改用checkPermission(Permission)

Public constructors

SecurityManager

Added in API level 1
SecurityManager ()

Public methods

checkAccept

Added in API level 1
void checkAccept (String host, 
                int port)

Parameters
host String
port int

checkAccess

Added in API level 1
void checkAccess (Thread t)

Parameters
t Thread

checkAccess

Added in API level 1
void checkAccess (ThreadGroup g)

Parameters
g ThreadGroup

checkAwtEventQueueAccess

Added in API level 1
void checkAwtEventQueueAccess ()

checkConnect

Added in API level 1
void checkConnect (String host, 
                int port)

Parameters
host String
port int

checkConnect

Added in API level 1
void checkConnect (String host, 
                int port, 
                Object context)

Parameters
host String
port int
context Object

checkCreateClassLoader

Added in API level 1
void checkCreateClassLoader ()

checkDelete

Added in API level 1
void checkDelete (String file)

Parameters
file String

checkExec

Added in API level 1
void checkExec (String cmd)

Parameters
cmd String

checkExit

Added in API level 1
void checkExit (int status)

Parameters
status int

checkLink

Added in API level 1
void checkLink (String lib)

Parameters
lib String

checkListen

Added in API level 1
void checkListen (int port)

Parameters
port int

checkMemberAccess

Added in API level 1
void checkMemberAccess (Class<?> clazz, 
                int which)

Parameters
clazz Class
which int

checkMulticast

Added in API level 1
void checkMulticast (InetAddress maddr)

Parameters
maddr InetAddress

checkMulticast

Added in API level 1
void checkMulticast (InetAddress maddr, 
                byte ttl)

此方法在API级别1中已弃用。
改为使用checkMulticast(java.net.InetAddress)

Parameters
maddr InetAddress
ttl byte

checkPackageAccess

Added in API level 1
void checkPackageAccess (String pkg)

Parameters
pkg String

checkPackageDefinition

Added in API level 1
void checkPackageDefinition (String pkg)

Parameters
pkg String

checkPermission

Added in API level 1
void checkPermission (Permission perm, 
                Object context)

Parameters
perm Permission
context Object

checkPermission

Added in API level 1
void checkPermission (Permission perm)

Parameters
perm Permission

checkPrintJobAccess

Added in API level 1
void checkPrintJobAccess ()

checkPropertiesAccess

Added in API level 1
void checkPropertiesAccess ()

checkPropertyAccess

Added in API level 1
void checkPropertyAccess (String key)

Parameters
key String

checkRead

Added in API level 1
void checkRead (FileDescriptor fd)

Parameters
fd FileDescriptor

checkRead

Added in API level 1
void checkRead (String file)

Parameters
file String

checkRead

Added in API level 1
void checkRead (String file, 
                Object context)

Parameters
file String
context Object

checkSecurityAccess

Added in API level 1
void checkSecurityAccess (String target)

Parameters
target String

checkSetFactory

Added in API level 1
void checkSetFactory ()

checkSystemClipboardAccess

Added in API level 1
void checkSystemClipboardAccess ()

checkTopLevelWindow

Added in API level 1
boolean checkTopLevelWindow (Object window)

Parameters
window Object
Returns
boolean

checkWrite

Added in API level 1
void checkWrite (FileDescriptor fd)

Parameters
fd FileDescriptor

checkWrite

Added in API level 1
void checkWrite (String file)

Parameters
file String

getInCheck

Added in API level 1
boolean getInCheck ()

此方法在API级别1中已弃用。
改为使用checkPermission(Permission)

Returns
boolean

getSecurityContext

Added in API level 1
Object getSecurityContext ()

Returns
Object

getThreadGroup

Added in API level 1
ThreadGroup getThreadGroup ()

返回当前线程的线程组。

Returns
ThreadGroup

Protected methods

classDepth

Added in API level 1
int classDepth (String name)

此方法在API级别1中已弃用。
改为使用checkPermission(Permission)

Parameters
name String
Returns
int

classLoaderDepth

Added in API level 1
int classLoaderDepth ()

此方法在API级别1中已弃用。
改为使用checkPermission(Permission)

Returns
int

currentClassLoader

Added in API level 1
ClassLoader currentClassLoader ()

此方法在API级别1中已弃用。
改为使用checkPermission(Permission)

Returns
ClassLoader

currentLoadedClass

Added in API level 1
Class<?> currentLoadedClass ()

此方法在API级别1中已弃用。
改为使用checkPermission(Permission)

Returns
Class<?>

getClassContext

Added in API level 1
Class[] getClassContext ()

Returns
Class[]

inClass

Added in API level 1
boolean inClass (String name)

此方法在API级别1中已弃用。
改为使用checkPermission(Permission)

Parameters
name String
Returns
boolean

inClassLoader

Added in API level 1
boolean inClassLoader ()

此方法在API级别1中已弃用。
改为使用checkPermission(Permission)

Returns
boolean

Hooray!