java.lang.Objectjavax.security.auth.Policy
public PermissionCollection getPermissions
public ProtectionDomain (CodeSource cs, PermissionCollection permissions, ClassLoader loader,
@Deprecated public abstract class Policy
This is an abstract class for representing the system policy for
Subject-based authorization. A subclass implementation
of this class provides a means to specify a Subject-based
access control Policy.
A Policy object can be queried for the set of
Permissions granted to code running as a
Principal in the following manner:
codeSource);
Policy object consults the local policy and returns
and appropriate Permissions object with the
Permissions granted to the Principals associated with the
provided subject, and granted to the code specified
by the provided codeSource.
A Policy contains the following information.
Note that this example only represents the syntax for the default
Policy implementation. Subclass implementations of this class
may implement alternative syntaxes and may retrieve the
Policy from any source such as files, databases,
or servers.
Each entry in the Policy is represented as
a grant entry. Each grant entry
specifies a codebase, code signers, and Principals triplet,
as well as the Permissions granted to that triplet.
grant CodeBase ["URL"], Signedby ["signers"], [, "Permission_Actions"] [, signedBy "SignerName"]; };
grant CodeBase "foo.com", Signedby "foo", };
SolarisPrincipal with the
name, duke, has one Permission. This Permission
permits the executing code to read and write files in the directory,
"/home/duke".
To "run" as a particular Principal,
code invokes the Subject.doAs(subject, ...) method.
After invoking that method, the code runs as all the Principals
associated with the specified Subject.
Note that this Policy (and the Permissions
granted in this Policy) only become effective
after the call to Subject.doAs has occurred.
Multiple Principals may be listed within one grant entry.
All the Principals in the grant entry must be associated with
the Subject provided to Subject.doAs
for that Subject to be granted the specified Permissions.
};
Note that non Principal-based grant entries are not permitted
in this Policy. Therefore, grant entries such as:
grant CodeBase "foo.com", Signedby "foo" { };
java.security.Policy.
The default Policy implementation can be changed by
setting the value of the "auth.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 JDK was installed.
| Constructor Summary | |
|---|---|
protected |
Policy()
Deprecated. Sole constructor. |
| Method Summary | |
|---|---|
abstract PermissionCollection |
getPermissions(Subject subject,
CodeSource cs)
Deprecated. Retrieve the Permissions granted to the Principals associated with the specified CodeSource. |
static Policy |
getPolicy()
Deprecated. Returns the installed Policy object. |
abstract void |
refresh()
Deprecated. Refresh and reload the Policy. |
static void |
setPolicy(Policy policy)
Deprecated. Sets the system-wide Policy object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Policy()
| Method Detail |
|---|
public static Policy getPolicy()
SecurityManager.checkPermission with the
AuthPermission("getPolicy") permission
to ensure the caller has permission to get the Policy object.
null.
SecurityException - if the current thread does not
have permission to get the Policy object.setPolicy(javax.security.auth.Policy)public static void setPolicy(Policy policy)
SecurityManager.checkPermission with the
AuthPermission("setPolicy")
permission to ensure the caller has permission to set the Policy.
policy - the new system Policy object.
SecurityException - if the current thread does not
have permission to set the Policy.getPolicy()public abstract PermissionCollection getPermissions(Subject subject, CodeSource cs)
CodeSource.
subject - the Subject
whose associated Principals,
in conjunction with the provided
CodeSource, determines the Permissions
returned by this method. This parameter
may be null. cs - the code specified by its CodeSource
that determines, in conjunction with the provided
Subject, the Permissions
returned by this method. This parameter may be
null.
Subject and code specified in
the provided subject and cs
parameters.public abstract void refresh()
This method causes this object to refresh/reload its current
Policy. This is implementation-dependent.
For example, if the Policy object is stored in
a file, calling refresh will cause the file to be re-read.
SecurityException - if the caller does not have permission
to refresh the Policy.Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
7 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)