public final class WirePermission
extends java.security.BasicPermission
Wire
object. When a
Envelope
object is used for communication with the
poll
or update
method, and the scope is set, then
the Wire
object must verify that the Consumer service has
WirePermission[name,CONSUME]
and the Producer service has
WirePermission[name,PRODUCE]
for all names in the scope.
The names are compared with the normal rules for permission names. This means
that they may end with a "*" to indicate wildcards. E.g. Door.* indicates all
scope names starting with the string "Door". The last period is required due
to the implementations of the BasicPermission
class.
Modifier and Type | Field and Description |
---|---|
private static int |
ACTION_ALL |
private static int |
ACTION_CONSUME |
private int |
action_mask
The actions mask.
|
private static int |
ACTION_NONE |
private static int |
ACTION_PRODUCE |
private java.lang.String |
actions
The actions in canonical form.
|
static java.lang.String |
CONSUME
The action string for the
consume action. |
static java.lang.String |
PRODUCE
The action string for the
produce action. |
(package private) static long |
serialVersionUID |
Constructor and Description |
---|
WirePermission(java.lang.String name,
int mask)
Package private constructor used by WirePermissionCollection.
|
WirePermission(java.lang.String name,
java.lang.String actions)
Create a new WirePermission with the given name (may be wildcard) and
actions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Determines the equalty of two
WirePermission objects. |
java.lang.String |
getActions()
Returns the canonical string representation of the actions.
|
(package private) int |
getActionsMask()
Returns the current action mask.
|
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(java.security.Permission p)
Checks if this
WirePermission object implies
the specified permission. |
java.security.PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection object for storing
WirePermission objects. |
private static int |
parseActions(java.lang.String actions)
Parse action string into action mask.
|
private void |
readObject(java.io.ObjectInputStream s)
readObject is called to restore the state of the ServicePermission from a
stream.
|
private void |
setTransients(int mask)
Called by constructors and when deserialized.
|
java.lang.String |
toString()
Returns a string describing this
WirePermission . |
private void |
writeObject(java.io.ObjectOutputStream s)
WriteObject is called to save the state of the ServicePermission to a
stream.
|
static final long serialVersionUID
public static final java.lang.String PRODUCE
produce
action.public static final java.lang.String CONSUME
consume
action.private static final int ACTION_PRODUCE
private static final int ACTION_CONSUME
private static final int ACTION_ALL
private static final int ACTION_NONE
private transient int action_mask
private volatile java.lang.String actions
public WirePermission(java.lang.String name, java.lang.String actions)
name
- Wire name.actions
- produce
, consume
(canonical
order).WirePermission(java.lang.String name, int mask)
name
- class namemask
- action maskprivate void setTransients(int mask)
mask
- action maskint getActionsMask()
private static int parseActions(java.lang.String actions)
actions
- Action string.public boolean implies(java.security.Permission p)
WirePermission
object implies
the specified permission.
More specifically, this method returns true
if:
WirePermission
class,
java.*
implies java.home
.
implies
in class java.security.BasicPermission
p
- The permission to check against.true
if the specified permission is implied by this
object; false
otherwise.public java.lang.String getActions()
produce
,
consume
.getActions
in class java.security.BasicPermission
public java.security.PermissionCollection newPermissionCollection()
PermissionCollection
object for storing
WirePermission
objects.newPermissionCollection
in class java.security.BasicPermission
PermissionCollection
object suitable for
storing WirePermission
objects.public boolean equals(java.lang.Object obj)
WirePermission
objects.
Checks that specified object has the same name and actions as this
WirePermission
object.equals
in class java.security.BasicPermission
obj
- The object to test for equality.obj
is a WirePermission
, and
has the same name and actions as this WirePermission
object; false
otherwise.public int hashCode()
hashCode
in class java.security.BasicPermission
public java.lang.String toString()
WirePermission
. The
convention is to specify the class name, the permission name, and the
actions in the following format:
'(org.osgi.service.wireadmin.WirePermission "name"
"actions")'.toString
in class java.security.Permission
Permission
object.private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException