public final class PackagePermission extends java.security.BasicPermission
java.lang.Object
|
+--java.security.Permission
|
+--java.security.BasicPermission
|
+--org.osgi.framework.PackagePermission
All Implemented Interfaces: java.security.Guard, java.io.Serializable
PackagePermission indicates a bundle's right to import or export a package. A package is a dot-separated string that defines a fully qualified Java package, e.g., org.osgi.service.http.
PackagePermission has two actions: “export” and “import.” The export action also implies the import action.
Member Summary | |
---|---|
Fields | |
public static final | EXPORT |
The action string “export.” | |
public static final | IMPORT |
The action string “import.” | |
Constructors | |
public | PackagePermission(String, String) |
Define the permission to import and/or export a package. | |
Methods | |
public boolean | equals(Object) |
Checks two PackagePermission for equality. | |
public String | getActions() |
Return the canonical string representation of the actions. | |
public int | hashCode() |
Returns the hash code value for this object. | |
public boolean | implies(Permission) |
Checks if the specified permission is “implied” by this object. |
public static final java.lang.String EXPORT
The action string “export.”
public static final java.lang.String IMPORT
The action string “import.”
public PackagePermission(java.lang.String name,
java.lang.String actions)
Define the permission to import and/or export a package. The name is specified as a normal Java package name, with dots separating the parts. Wildcards may be used. For example,
org.osgi.service.http javax.servlet.* *Package Permissions are granted over all possible versions of a package. A bundle that wants to export a package must have the PackagePermission for “export” on that package. Similarly, a bundle that wants to import a package must have the PackagePermission for “import” on that package.
Access permission is granted for both classes and resources.
Parameters:
public boolean equals(java.lang.Object obj)
Checks two PackagePermission for equality. Checks that obj has the same package name and actions as this PackagePermission.
Overrides: java.security.BasicPermission.equals(java.lang.Object) in class java.security.BasicPermission
Parameters:
Returns: true if obj is a PackagePermission, and has the same package name and actions as this PackagePermission object. Otherwise, return false.
public java.lang.String getActions()
Return the canonical string representation of the actions. Always returns present actions in the following order: export, import.
Overrides: java.security.BasicPermission.getActions() in class java.security.BasicPermission
public int hashCode()
Returns the hash code value for this object.
Overrides: java.security.BasicPermission.hashCode() in class java.security.BasicPermission
public boolean implies(java.security.Permission p)
Checks if the specified permission is “implied” by this object. This method checks that the package name of the target is implied by the package name of this object. The list of actions must either match or allow for the list for the target object to imply the target permission. The permission to export a package implies the permission to import the named package.
x.y.*,"export" -> x.y.z,"export" is true *,"import" -> x.y, "import" is true *,"export" -> x.y, "import" is true x.y,"export" -> x.y.z, "export" is falseOverrides: java.security.BasicPermission.implies(java.security.Permission) in class java.security.BasicPermission
Parameters:
Returns: true if the specified permission is implied by this object, false if not.
3.15.151.32