public final class ServiceContextPermission extends BasicPermission
ServiceContextPermission represents permission to
control a ServiceContext. A
ServiceContextPermission contains a name (also
referred to as a "target name") and an actions string.
The target name is the name of the service context permission (see the table below). Each permission identifies a method. A wildcard match is signified by an asterisk, i.e., "*".
The actions string is either "own" or "*". A callers "own" service contexts are those which it has created through ServiceContextFactory.createServiceContext(). If an Xlet would have a ServiceContext returned should it call ServiceContextFactory.getServiceContext(javax.tv.xlet.XletContext) then that ServiceContext is also considered to be one of its "own". The string "own" means the permission applies to your own service contexts; the string "*" implies permission to these, plus permission for service contexts obtained from all other sources.
The following table lists all the possible
ServiceContextPermission target names, and describes
what the permission allows for each.
| Permission Target Name | What the Permission Allows |
|---|---|
| access | Access to a ServiceContext, via ServiceContextFactory.getServiceContexts() |
| create | Creation of a ServiceContext. |
| destroy | Destruction of a ServiceContext. |
| getServiceContentHandlers | Obtaining the service content handlers from a ServiceContext. |
| stop | Stopping a ServiceContext. |
The permission ServiceContextPermission("access", "*") is intended to be granted only to special monitoring applications and not to general broadcast applications.
Note that undefined target and actions strings may be provided to
the constructors of this class, but subsequent calls to
SecurityManager.checkPermission() with the resulting
SelectPermission object will fail.
BasicPermission,
Permission,
ServiceContext,
ServiceContextFactory,
Serialized Form| Constructor and Description |
|---|
ServiceContextPermission(String name,
String actions)
Creates a new ServiceContextPermission object with the specified
name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Tests two
ServiceContextPermission objects for
equality. |
String |
getActions()
Returns the canonical representation of the actions string.
|
int |
hashCode()
Provides the hash code value of this object.
|
boolean |
implies(Permission p)
Checks if the specified permission is "implied" by this object.
|
newPermissionCollectioncheckGuard, getName, toStringpublic ServiceContextPermission(String name, String actions)
name - The name of the ServiceContextPermissionactions - The actions string, as
detailed in the class description.public boolean implies(Permission p)
More specifically, this method returns true if:
implies in class BasicPermissionp - The permission against which to test.true if the specified permission is equal
to or implied by this permission; false otherwise.public boolean equals(Object obj)
ServiceContextPermission objects for
equality. Returns true if and only if
obj's class is the same as the class of this
object, and obj has the same name and actions
string as this object.equals in class BasicPermissionobj - The object to test for equality.true if the two permissions are equal;
false otherwise.public int hashCode()
ServiceContextPermission objects that are equal will
return the same hash code.hashCode in class BasicPermissionpublic String getActions()
getActions in class BasicPermissionCopyright © 2012 code4tv.com. All Rights Reserved.