Java Doc for Policy.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.Policy

All known Subclasses:   sun.security.provider.PolicyFile,
Policy
abstract public class Policy (Code)
This is an abstract class for representing the system security policy for a Java application environment (specifying which permissions are available for code from various sources). That is, the security policy is represented by a Policy subclass providing an implementation of the abstract methods in this Policy class.

There is only one Policy object in effect at any given time.

The source location for the policy information utilized by the Policy object is up to the Policy implementation. The policy configuration may be stored, for example, as a flat ASCII file, as a serialized binary file of the Policy class, or as a database.

The currently-installed Policy object can be obtained by calling the getPolicy method, and it can be changed by a call to the setPolicy method (by code with permission to reset the Policy).

The refresh method causes the policy object to refresh/reload its current configuration.

This is implementation-dependent. For example, if the policy object stores its policy in configuration files, calling refresh will cause it to re-read the configuration policy files. The refreshed policy may not have an effect on classes in a particular ProtectionDomain. This is dependent on the Policy provider's implementation of the Policy.implies(ProtectionDomain,Permission) implies method and the PermissionCollection caching strategy.

The default Policy implementation can be changed by setting the value of the "policy.provider" security property (in the Java security properties file) to the fully qualified name of the desired Policy implementation class. The Java security properties file is located in the file named <JAVA_HOME>/lib/security/java.security, where <JAVA_HOME> refers to the directory where the SDK was installed.
author:
   Roland Schemers
author:
   Gary Ellison
version:
   1.76, 10/10/06
See Also:   java.security.CodeSource
See Also:   java.security.PermissionCollection
See Also:   java.security.SecureClassLoader





Method Summary
abstract public  PermissionCollectiongetPermissions(CodeSource codesource)
     Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed for code from the specified code source.
Parameters:
  codesource - the CodeSource associated with the caller.This encapsulates the original location of the code (where the codecame from) and the public key(s) of its signer.
public  PermissionCollectiongetPermissions(ProtectionDomain domain)
     Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain.
Parameters:
  domain - the ProtectionDomain associated with the caller.
public static  PolicygetPolicy()
     Returns the installed Policy object.
static synchronized  PolicygetPolicyNoCheck()
     Returns the installed Policy object, skipping the security check.
public  booleanimplies(ProtectionDomain domain, Permission permission)
     Evaluates the global policy for the permissions granted to the ProtectionDomain and tests whether the permission is granted.
Parameters:
  domain - the ProtectionDomain to test
Parameters:
  permission - the Permission object to be tested for implication.
static  booleanisSet()
    
abstract public  voidrefresh()
     Refreshes/reloads the policy configuration.
public static  voidsetPolicy(Policy policy)
     Sets the system-wide Policy object.



Method Detail
getPermissions
abstract public PermissionCollection getPermissions(CodeSource codesource)(Code)
Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed for code from the specified code source.
Parameters:
  codesource - the CodeSource associated with the caller.This encapsulates the original location of the code (where the codecame from) and the public key(s) of its signer. the set of permissions allowed for code from codesourceaccording to the policy.The returned set of permissions must be a new mutable instance and it must support heterogeneous Permission types.



getPermissions
public PermissionCollection getPermissions(ProtectionDomain domain)(Code)
Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain.
Parameters:
  domain - the ProtectionDomain associated with the caller. the set of permissions allowed for the domainaccording to the policy.The returned set of permissions must be a new mutable instance and it must support heterogeneous Permission types.
See Also:   java.security.ProtectionDomain
See Also:   java.security.SecureClassLoader
since:
   1.4



getPolicy
public static Policy getPolicy()(Code)
Returns the installed Policy object. This value should not be cached, as it may be changed by a call to setPolicy. This method first calls SecurityManager.checkPermission with a SecurityPermission("getPolicy") permission to ensure it's ok to get the Policy object.. the installed Policy.
throws:
  SecurityException - if a security manager exists and itscheckPermission method doesn't allowgetting the Policy object.
See Also:   SecurityManager.checkPermission(Permission)
See Also:   Policy.setPolicy(java.security.Policy)



getPolicyNoCheck
static synchronized Policy getPolicyNoCheck()(Code)
Returns the installed Policy object, skipping the security check. Used by SecureClassLoader and getPolicy. the installed Policy.



implies
public boolean implies(ProtectionDomain domain, Permission permission)(Code)
Evaluates the global policy for the permissions granted to the ProtectionDomain and tests whether the permission is granted.
Parameters:
  domain - the ProtectionDomain to test
Parameters:
  permission - the Permission object to be tested for implication. true if "permission" is a proper subset of a permissiongranted to this ProtectionDomain.
See Also:   java.security.ProtectionDomain
since:
   1.4



isSet
static boolean isSet()(Code)
package private for AccessControlContext



refresh
abstract public void refresh()(Code)
Refreshes/reloads the policy configuration. The behavior of this method depends on the implementation. For example, calling refresh on a file-based policy will cause the file to be re-read.



setPolicy
public static void setPolicy(Policy policy)(Code)
Sets the system-wide Policy object. This method first calls SecurityManager.checkPermission with a SecurityPermission("setPolicy") permission to ensure it's ok to set the Policy.
Parameters:
  policy - the new system Policy object.
throws:
  SecurityException - if a security manager exists and itscheckPermission method doesn't allowsetting the Policy.
See Also:   SecurityManager.checkPermission(Permission)
See Also:   Policy.getPolicy()



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.