Java Doc for AccessControlContext.java in  » 6.0-JDK-Modules » j2me » java » security » 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 » 6.0 JDK Modules » j2me » java.security 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.security.AccessControlContext

AccessControlContext
final public class AccessControlContext (Code)
An AccessControlContext is used to make system resource access decisions based on the context it encapsulates.

More specifically, it encapsulates a context and has a single method, checkPermission, that is equivalent to the checkPermission method in the AccessController class, with one difference: The AccessControlContext checkPermission method makes access decisions based on the context it encapsulates, rather than that of the current execution thread.

Thus, the purpose of AccessControlContext is for those situations where a security check that should be made within a given context actually needs to be done from within a different context (for example, from within a worker thread).

An AccessControlContext is created by calling the AccessController.getContext method. The getContext method takes a "snapshot" of the current calling context, and places it in an AccessControlContext object, which it returns. A sample call is the following:

 AccessControlContext acc = AccessController.getContext()
 

Code within a different context can subsequently call the checkPermission method on the previously-saved AccessControlContext object. A sample call is the following:

 acc.checkPermission(permission)
 

See Also:   AccessController
author:
   Roland Schemers



Constructor Summary
public  AccessControlContext(ProtectionDomain context)
     Create an AccessControlContext with the given set of ProtectionDomains. Context must not be null.
public  AccessControlContext(AccessControlContext acc, DomainCombiner combiner)
     Create a new AccessControlContext with the given AccessControlContext and DomainCombiner. This constructor associates the provided DomainCombiner with the provided AccessControlContext.


Parameters:
  acc - the AccessControlContext associatedwith the provided DomainCombiner.

 AccessControlContext(ProtectionDomain context, boolean isPrivileged, AccessControlContext privilegedContext)
    

Method Summary
public  voidcheckPermission(Permission perm)
     Determines whether the access request indicated by the specified permission should be allowed or denied, based on the security policy currently in effect, and the context in this object.

This method quietly returns if the access request is permitted, or throws a suitable AccessControlException otherwise.

public  booleanequals(Object obj)
     Checks two AccessControlContext objects for equality.
static  DebuggetDebug()
    
public  DomainCombinergetDomainCombiner()
     Get the DomainCombiner associated with this AccessControlContext.
public  inthashCode()
     Returns the hash code value for this context.
 booleanisPrivileged()
     Returns true if this context is privileged.
 AccessControlContextoptimize()
     Take the stack-based context (this) and combine it with the privileged or inherited context, if need be.


Constructor Detail
AccessControlContext
public AccessControlContext(ProtectionDomain context)(Code)
Create an AccessControlContext with the given set of ProtectionDomains. Context must not be null. Duplicate domains will be removed from the context.
Parameters:
  context - the ProtectionDomains associated with this context.



AccessControlContext
public AccessControlContext(AccessControlContext acc, DomainCombiner combiner)(Code)
Create a new AccessControlContext with the given AccessControlContext and DomainCombiner. This constructor associates the provided DomainCombiner with the provided AccessControlContext.


Parameters:
  acc - the AccessControlContext associatedwith the provided DomainCombiner.


Parameters:
  combiner - the DomainCombiner to be associatedwith the provided AccessControlContext.
exception:
  NullPointerException - if the providedcontext is null.


exception:
  SecurityException - if the caller does not have permissionto invoke this constructor.




AccessControlContext
AccessControlContext(ProtectionDomain context, boolean isPrivileged, AccessControlContext privilegedContext)(Code)
package private constructor for AccessController




Method Detail
checkPermission
public void checkPermission(Permission perm) throws AccessControlException(Code)
Determines whether the access request indicated by the specified permission should be allowed or denied, based on the security policy currently in effect, and the context in this object.

This method quietly returns if the access request is permitted, or throws a suitable AccessControlException otherwise.
Parameters:
  perm - the requested permission.
exception:
  AccessControlException - if the specified permissionis not permitted, based on the current security policy and thecontext encapsulated by this object.
exception:
  NullPointerException - if the permission to check for is null.




equals
public boolean equals(Object obj)(Code)
Checks two AccessControlContext objects for equality. Checks that obj is an AccessControlContext and has the same set of ProtectionDomains as this context.


Parameters:
  obj - the object we are testing for equality with this object. true if obj is an AccessControlContext, and has the same set of ProtectionDomains as this context, false otherwise.




getDebug
static Debug getDebug()(Code)



getDomainCombiner
public DomainCombiner getDomainCombiner()(Code)
Get the DomainCombiner associated with this AccessControlContext.

the DomainCombiner associated with thisAccessControlContext, or nullif there is none.
exception:
  SecurityException - if the caller does not have permissionto get the DomainCombiner associated with thisAccessControlContext.




hashCode
public int hashCode()(Code)
Returns the hash code value for this context. The hash code is computed by exclusive or-ing the hash code of all the protection domains in the context together. a hash code value for this context.



isPrivileged
boolean isPrivileged()(Code)
Returns true if this context is privileged.



optimize
AccessControlContext optimize()(Code)
Take the stack-based context (this) and combine it with the privileged or inherited context, if need be.



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) 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.