AI-generated Key Takeaways
-
SecurityManageris a legacy class for enforcing security policies in Java applications and is not recommended for use in new code. -
It provides methods to check various operations like access to resources, network connections, and thread management.
-
Many
SecurityManagermethods are deprecated and developers should now usecheckPermissionwith appropriate permissions. -
SecurityManagerallows for granular control over actions performed within a Java application, but its complexity and legacy status discourage its general usage. -
Modern security mechanisms, like those provided by the Java security architecture, offer more robust and maintainable alternatives.
Legacy security code; do not use.
Field Summary
| protected boolean | inCheck |
This field is deprecated.
Use checkPermission(Permission) instead.
|
Public Constructor Summary
Public Method Summary
| void |
checkAccept(String host, int port)
|
| void |
checkAccess(Thread t)
|
| void | |
| void | |
| void |
checkConnect(String host, int port)
|
| void | |
| void | |
| void |
checkDelete(String file)
|
| void | |
| void |
checkExit(int status)
|
| void | |
| void |
checkListen(int port)
|
| void |
checkMemberAccess(Class<?> clazz, int which)
|
| void |
checkMulticast(InetAddress maddr)
|
| void |
checkMulticast(InetAddress maddr, byte ttl)
This method is deprecated.
use
checkMulticast(java.net.InetAddress) instead.
|
| void |
checkPackageAccess(String pkg)
|
| void | |
| void | |
| void |
checkPermission(Permission perm)
|
| void | |
| void | |
| void | |
| void | |
| void | |
| void | |
| void |
checkSecurityAccess(String target)
|
| void | |
| void | |
| boolean |
checkTopLevelWindow(Object window)
|
| void | |
| void |
checkWrite(String file)
|
| boolean |
getInCheck()
This method is deprecated.
Use
checkPermission(Permission) instead.
|
| Object | |
| ThreadGroup |
getThreadGroup()
Returns the current thread's thread group.
|
Protected Method Summary
| int | |
| int |
classLoaderDepth()
This method is deprecated.
Use
checkPermission(Permission) instead.
|
| ClassLoader |
currentClassLoader()
This method is deprecated.
Use
checkPermission(Permission) instead.
|
| Class<?> |
currentLoadedClass()
This method is deprecated.
Use
checkPermission(Permission) instead.
|
| Class[] | |
| boolean | |
| boolean |
inClassLoader()
This method is deprecated.
Use
checkPermission(Permission) instead.
|
Inherited Method Summary
Fields
Public Constructors
public SecurityManager ()
Public Methods
public void checkAccess (Thread t)
Parameters
| t |
|---|
public void checkAwtEventQueueAccess ()
public void checkCreateClassLoader ()
public void checkExit (int status)
Parameters
| status |
|---|
public void checkListen (int port)
Parameters
| port |
|---|