Additional top-level class in compilation unit: PackagePermissionCollection.
A package is a dot-separated string that defines a fully qualified Java package.
For example:
org.osgi.service.http
PackagePermission has three actions: exportonly,
import and export. The export action, which is
deprecated, implies the import action.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int | |
| pack-priv transient int | action_mask
The actions mask. |
| pack-priv static final int | |
| private volatile String | actions
The actions in canonical form. |
| pack-priv final transient Bundle | bundle
The bundle used by this PackagePermission. |
| public static final String | |
| public static final String | EXPORTONLY
The action string |
| pack-priv transient Filter | filter
If this PackagePermission was constructed with a filter, this holds a Filter matching object used to evaluate the filter in implies. |
| public static final String | IMPORT
The action string |
| private transient volatile Map | properties
This map holds the properties of the permission, used to match a filter in implies. |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| public | PackagePermission(String
Package name or filter expression. A filter expression can
only be specified if the specified action is name, String import.exportonly,import (canonical order).Creates a new |
| public | PackagePermission(String
The name of the requested package to import. name, Bundle The bundle exporting the requested package. exportingBundle, String The action actions)import.Creates a new requested |
| pack-priv | PackagePermission(String
package name name, int action mask mask)Package private constructor used by PackagePermissionCollection. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if obj is a PackagePermission, and
has the same package name and actions as this
PackagePermission object; false otherwise.The object to test for equality with this
obj)PackagePermission object.Overrides java. Determines the equality of two |
| public String | Returns: Canonical string representation of thePackagePermission
actions.Overrides java. Returns the canonical string representation of the
|
| private Map | Returns: a map of properties for this permission.Called by |
| public int | Returns: A hash code value for this object.Overrides java. Returns the hash code value for this object. |
| public boolean | Returns: true if the specified permission is implied by this
object; false otherwise.The requested permission. p)Overrides java. Determines if the specified permission is implied by this object. |
| pack-priv boolean | Returns: true if the specified permission is implied by this
object; false otherwise.The requested PackagePermission which has already be
validated as a proper argument. The requested PackagePermission
must not have a filter expression. requested, int The effective actions with which to start. effective)Internal implies method. |
| public PermissionCollection | Returns: A newPermissionCollection object.Overrides java. Returns a new |
| private static int | Returns: action mask.Action string. actions)Parse action string into action mask. |
| private static Filter | Returns: a Filter for this bundle. If the specified filterString is not a filter expression, thennull is returned.The filter string to parse. filterString)Parse filter string into a Filter object. |
| private synchronized void | readObject(ObjectInputStream
the s)ObjectInputStream from which data is readHides java. readObject is called to restore the state of this permission from a stream. |
| private void | |
| private synchronized void | writeObject(ObjectOutputStream s)
WriteObject is called to save the state of this permission object to a stream. |
| ACTION_ALL | back to summary |
|---|---|
| private static final int ACTION_ALL | |
| ACTION_EXPORT | back to summary |
|---|---|
| private static final int ACTION_EXPORT | |
| ACTION_IMPORT | back to summary |
|---|---|
| private static final int ACTION_IMPORT | |
| action_mask | back to summary |
|---|---|
| pack-priv transient int action_mask The actions mask. | |
| ACTION_NONE | back to summary |
|---|---|
| pack-priv static final int ACTION_NONE | |
| actions | back to summary |
|---|---|
| private volatile String actions The actions in canonical form. | |
| bundle | back to summary |
|---|---|
| pack-priv final transient Bundle bundle The bundle used by this PackagePermission. | |
| EXPORT | back to summary |
|---|---|
| public static final String EXPORT
Deprecated As of 1.5. Use The action string | |
| EXPORTONLY | back to summary |
|---|---|
| public static final String EXPORTONLY The action string
| |
| filter | back to summary |
|---|---|
| pack-priv transient Filter filter If this PackagePermission was constructed with a filter, this holds a Filter matching object used to evaluate the filter in implies. | |
| IMPORT | back to summary |
|---|---|
| public static final String IMPORT The action string | |
| properties | back to summary |
|---|---|
| private transient volatile Map<String, Object> properties This map holds the properties of the permission, used to match a filter in implies. This is not initialized until necessary, and then cached in this object. | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| PackagePermission | back to summary |
|---|---|
| public PackagePermission(String name, String actions) Creates a new The name is specified as a normal Java package name: a dot-separated string. Wildcards may be used. name ::= <package name> | <package name ending in ".*"> | *Examples: org.osgi.service.http javax.servlet.* *For the import action, the name can also be a filter expression.
The filter gives access to the following attributes:
Package Permissions are granted over all possible versions of a package.
A bundle that needs to export a package must have the appropriate
Permission is granted for both classes and resources.
| |
| PackagePermission | back to summary |
|---|---|
| public PackagePermission(String name, Bundle exportingBundle, String actions) Creates a new requested
| |
| PackagePermission | back to summary |
|---|---|
| pack-priv PackagePermission(String name, int mask) Package private constructor used by PackagePermissionCollection.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Determines the equality of two | |
| getActions | back to summary |
|---|---|
| public String getActions() Overrides java. Returns the canonical string representation of the
Always returns present | |
| getProperties | back to summary |
|---|---|
| private Map Called by | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns the hash code value for this object.
| |
| implies | back to summary |
|---|---|
| public boolean implies(Permission p) Overrides java. Determines 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 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 false
| |
| implies0 | back to summary |
|---|---|
| pack-priv boolean implies0(PackagePermission requested, int effective) Internal implies method. Used by the implies and the permission collection implies methods.
| |
| newPermissionCollection | back to summary |
|---|---|
| public PermissionCollection newPermissionCollection() Overrides java. Returns a new
| |
| parseActions | back to summary |
|---|---|
| private static int parseActions(String actions) Parse action string into action mask.
| |
| parseFilter | back to summary |
|---|---|
| private static Filter parseFilter(String filterString) Parse filter string into a Filter object.
| |
| readObject | back to summary |
|---|---|
| private synchronized void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Hides java. readObject is called to restore the state of this permission from a stream.
| |
| setTransients | back to summary |
|---|---|
| private void setTransients(String name, int mask) Called by constructors and when deserialized.
| |
| writeObject | back to summary |
|---|---|
| private synchronized void writeObject(ObjectOutputStream s) throws IOException WriteObject is called to save the state of this permission object to a stream. The actions are serialized, and the superclass takes care of the name. | |