Java Doc for SecurityManager.java in  » Apache-Harmony-Java-SE » java-package » java » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.SecurityManager

SecurityManager
public class SecurityManager (Code)
SecurityManager is the abstract superclass of the classes which can provide security verification for a running program.


Field Summary
protected  booleaninCheck
     Flag to indicate whether a security check is in progress.

Constructor Summary
public  SecurityManager()
     Constructs a new instance of this class.

Method Summary
public  voidcheckAccept(String host, int port)
     Checks whether the running program is allowed to accept socket connections.
public  voidcheckAccess(Thread thread)
     Checks whether the running program is allowed to modify the thread.
public  voidcheckAccess(ThreadGroup group)
     Checks whether the running program is allowed to modify the thread group.
public  voidcheckAwtEventQueueAccess()
     Checks whether the running program is allowed to access the AWT Event queue.
public  voidcheckConnect(String host, int port)
     Checks whether the running program is allowed to establish socket connections.
public  voidcheckConnect(String host, int port, Object context)
     Checks whether the given security context is allowed to establish socket connections.
public  voidcheckCreateClassLoader()
     Checks whether the running program is allowed to create a class loader.
public  voidcheckDelete(String file)
     Checks whether the running program is allowed to delete the file named by the argument, which should be passed in canonical form.
public  voidcheckExec(String cmd)
     Checks whether the running program is allowed to execute the specified platform specific command.
public  voidcheckExit(int status)
     Checks whether the running program is allowed to terminate itself.
public  voidcheckLink(String libName)
     Checks whether the running program is allowed to load the specified native library.
public  voidcheckListen(int port)
     Checks whether the running program is allowed to listen on the specified port.
public  voidcheckMemberAccess(Class cls, int type)
     Checks whether the running program is allowed to access members.
public  voidcheckMulticast(InetAddress maddr)
     Checks whether the running program is allowed to join, leave or send to a multicast address.
public  voidcheckMulticast(InetAddress maddr, byte ttl)
     Checks whether the running program is allowed to join, leave or send to a multicast address.
public  voidcheckPackageAccess(String packageName)
     Checks whether the running program is allowed to access the specified package.
public  voidcheckPackageDefinition(String packageName)
     Checks whether the running program is allowed to define new classes in the specified package.
public  voidcheckPermission(Permission permission)
     Checks whether the running program is allowed to access the resource being guarded by the given Permission argument.
public  voidcheckPermission(Permission permission, Object context)
     Checks whether the running program is allowed to access the resource being guarded by the given Permission argument.
public  voidcheckPrintJobAccess()
     Checks whether the running program is allowed to start a new print job.
public  voidcheckPropertiesAccess()
     Checks whether the running program is allowed to access the system properties.
public  voidcheckPropertyAccess(String key)
     Checks whether the running program is allowed to access a particular system property.
public  voidcheckRead(FileDescriptor fd)
     Checks whether the running program is allowed to read from the file whose descriptor is the argument.
public  voidcheckRead(String file)
     Checks whether the running program is allowed to read from the file named by the argument, which should be passed in canonical form.
public  voidcheckRead(String file, Object context)
     Checks whether the given security context is allowed to read from the file named by the argument, which should be passed in canonical form.
public  voidcheckSecurityAccess(String target)
     Checks whether the running program is allowed to perform the security operation named by the target.
public  voidcheckSetFactory()
     Checks whether the running program is allowed to set the net object factories.
public  voidcheckSystemClipboardAccess()
     Checks whether the running program is allowed to access the system clipboard.
public  booleancheckTopLevelWindow(Object window)
     Checks whether the running program is allowed to create a top level window.
public  voidcheckWrite(FileDescriptor fd)
     Checks whether the running program is allowed to read from the file whose descriptor is the argument.
public  voidcheckWrite(String file)
     Checks whether the running program is allowed to write to the file named by the argument, which should be passed in canonical form.
protected  intclassDepth(String name)
     Answers the index in the stack of the first method which is contained in a class called name.
protected  intclassLoaderDepth()
     Answers the index in the stack of three first class whose class loader is not a system class loader.
protected  ClassLoadercurrentClassLoader()
     Answers the class loader of the first class in the stack whose class loader is not a system class loader.
protected  ClasscurrentLoadedClass()
     Answers the first class in the stack which was loaded by a class loader which is not a system class loader.
protected  Class[]getClassContext()
     Answers an array containing one entry for each method in the stack.
public  booleangetInCheck()
     Answers true if the security manager is currently checking something.
public  ObjectgetSecurityContext()
     Answers an object which encapsulates the security state of the current point in the execution.
public  ThreadGroupgetThreadGroup()
     Answers the thread group which should be used to instantiate new threads.
protected  booleaninClass(String name)
     Answers true if there is a method on the stack from the specified class, and false otherwise.
Parameters:
  name - String the name of the class to look for.
protected  booleaninClassLoader()
     Answers true if there is a method on the stack from a class which was defined by a non-system classloader.

Field Detail
inCheck
protected boolean inCheck(Code)
Flag to indicate whether a security check is in progress.




Constructor Detail
SecurityManager
public SecurityManager()(Code)
Constructs a new instance of this class.




Method Detail
checkAccept
public void checkAccept(String host, int port)(Code)
Checks whether the running program is allowed to accept socket connections.
Parameters:
  host - the address of the host which is attempting to connect
Parameters:
  port - the port number to check



checkAccess
public void checkAccess(Thread thread)(Code)
Checks whether the running program is allowed to modify the thread.
Parameters:
  thread - the thread we are attempting to modify



checkAccess
public void checkAccess(ThreadGroup group)(Code)
Checks whether the running program is allowed to modify the thread group.
Parameters:
  group - the thread group we are attempting to modify



checkAwtEventQueueAccess
public void checkAwtEventQueueAccess()(Code)
Checks whether the running program is allowed to access the AWT Event queue. Since we don't support AWT, the answer is no.



checkConnect
public void checkConnect(String host, int port)(Code)
Checks whether the running program is allowed to establish socket connections. A -1 port indicates the caller is trying to resolve the hostname.
Parameters:
  host - String the address of the host to connect to.
Parameters:
  port - int the port number to check, or -1 for resolve.



checkConnect
public void checkConnect(String host, int port, Object context)(Code)
Checks whether the given security context is allowed to establish socket connections. A -1 port indicates the caller is trying to resolve the hostname.
Parameters:
  host - String the address of the host to connect to.
Parameters:
  port - int the port number to check, or -1 for resolve.
Parameters:
  context - Object the security context to use for the check.



checkCreateClassLoader
public void checkCreateClassLoader()(Code)
Checks whether the running program is allowed to create a class loader.



checkDelete
public void checkDelete(String file)(Code)
Checks whether the running program is allowed to delete the file named by the argument, which should be passed in canonical form.
Parameters:
  file - the name of the file to check



checkExec
public void checkExec(String cmd)(Code)
Checks whether the running program is allowed to execute the specified platform specific command.
Parameters:
  cmd - the command line



checkExit
public void checkExit(int status)(Code)
Checks whether the running program is allowed to terminate itself.
Parameters:
  status - the status to return from the exit.



checkLink
public void checkLink(String libName)(Code)
Checks whether the running program is allowed to load the specified native library.
Parameters:
  libName - the name of the library to load



checkListen
public void checkListen(int port)(Code)
Checks whether the running program is allowed to listen on the specified port.
Parameters:
  port - int the port number to check



checkMemberAccess
public void checkMemberAccess(Class cls, int type)(Code)
Checks whether the running program is allowed to access members. The default is to allow access to public members (i.e. java.lang.reflect.PUBLIC) and to classes loaded by the same loader as the original caller (i.e. the method that called the reflect API). Due to the nature of the check, overriding implementations cannot call super.checkMemberAccess() since the stack would no longer be of the expected shape.
Parameters:
  cls - ?
Parameters:
  type - Either java.lang.reflect.Member.PUBLIC or DECLARED



checkMulticast
public void checkMulticast(InetAddress maddr)(Code)
Checks whether the running program is allowed to join, leave or send to a multicast address.



checkMulticast
public void checkMulticast(InetAddress maddr, byte ttl)(Code)
Checks whether the running program is allowed to join, leave or send to a multicast address.



checkPackageAccess
public void checkPackageAccess(String packageName)(Code)
Checks whether the running program is allowed to access the specified package.
Parameters:
  packageName - the name of the package to be accessed.



checkPackageDefinition
public void checkPackageDefinition(String packageName)(Code)
Checks whether the running program is allowed to define new classes in the specified package.
Parameters:
  packageName - the name of the package to add a class to.



checkPermission
public void checkPermission(Permission permission)(Code)
Checks whether the running program is allowed to access the resource being guarded by the given Permission argument.
Parameters:
  permission - the permission to check



checkPermission
public void checkPermission(Permission permission, Object context)(Code)
Checks whether the running program is allowed to access the resource being guarded by the given Permission argument.
Parameters:
  permission - the permission to check



checkPrintJobAccess
public void checkPrintJobAccess()(Code)
Checks whether the running program is allowed to start a new print job.



checkPropertiesAccess
public void checkPropertiesAccess()(Code)
Checks whether the running program is allowed to access the system properties.



checkPropertyAccess
public void checkPropertyAccess(String key)(Code)
Checks whether the running program is allowed to access a particular system property.
Parameters:
  key - the name of the property to be accessed.



checkRead
public void checkRead(FileDescriptor fd)(Code)
Checks whether the running program is allowed to read from the file whose descriptor is the argument.
Parameters:
  fd - the file descriptor of the file to check



checkRead
public void checkRead(String file)(Code)
Checks whether the running program is allowed to read from the file named by the argument, which should be passed in canonical form.
Parameters:
  file - String the name of the file or directory to check.



checkRead
public void checkRead(String file, Object context)(Code)
Checks whether the given security context is allowed to read from the file named by the argument, which should be passed in canonical form.
Parameters:
  file - String the name of the file or directory to check.
Parameters:
  context - Object the security context to use for the check.



checkSecurityAccess
public void checkSecurityAccess(String target)(Code)
Checks whether the running program is allowed to perform the security operation named by the target.
Parameters:
  target - String the name of the operation to perform.



checkSetFactory
public void checkSetFactory()(Code)
Checks whether the running program is allowed to set the net object factories.



checkSystemClipboardAccess
public void checkSystemClipboardAccess()(Code)
Checks whether the running program is allowed to access the system clipboard.



checkTopLevelWindow
public boolean checkTopLevelWindow(Object window)(Code)
Checks whether the running program is allowed to create a top level window.
Parameters:
  window - The non-null window for which to check access



checkWrite
public void checkWrite(FileDescriptor fd)(Code)
Checks whether the running program is allowed to read from the file whose descriptor is the argument.
Parameters:
  fd - the file descriptor of the file to check



checkWrite
public void checkWrite(String file)(Code)
Checks whether the running program is allowed to write to the file named by the argument, which should be passed in canonical form.
Parameters:
  file - the name of the file to check



classDepth
protected int classDepth(String name)(Code)
Answers the index in the stack of the first method which is contained in a class called name. If no methods from this class are in the stack, return -1.
Parameters:
  name - String the name of the class to look for. int the depth in the stack of a the first method found.



classLoaderDepth
protected int classLoaderDepth()(Code)
Answers the index in the stack of three first class whose class loader is not a system class loader. int the frame index of the first method whose class was loaded bya non-system class loader.



currentClassLoader
protected ClassLoader currentClassLoader()(Code)
Answers the class loader of the first class in the stack whose class loader is not a system class loader. ClassLoader the most recent non-system class loader.



currentLoadedClass
protected Class currentLoadedClass()(Code)
Answers the first class in the stack which was loaded by a class loader which is not a system class loader. Class the most recent class loaded by a non-system class loader.



getClassContext
protected Class[] getClassContext()(Code)
Answers an array containing one entry for each method in the stack. Each entry is the java.lang.Class which represents the class in which the method is defined. Class[] all of the classes in the stack.



getInCheck
public boolean getInCheck()(Code)
Answers true if the security manager is currently checking something. boolean true if we are are in a security check method.



getSecurityContext
public Object getSecurityContext()(Code)
Answers an object which encapsulates the security state of the current point in the execution. In our case, this is an AccessControlContext.



getThreadGroup
public ThreadGroup getThreadGroup()(Code)
Answers the thread group which should be used to instantiate new threads. By default, this is the same as the thread group of the thread running this method. ThreadGroup The thread group to create new threads in.



inClass
protected boolean inClass(String name)(Code)
Answers true if there is a method on the stack from the specified class, and false otherwise.
Parameters:
  name - String the name of the class to look for. boolean true if we are running a method from the specified class.



inClassLoader
protected boolean inClassLoader()(Code)
Answers true if there is a method on the stack from a class which was defined by a non-system classloader. boolean



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.