OSGi Service Platform
Release 4

org.osgi.service.condpermadmin
Interface Condition

All Known Implementing Classes:
Condition.BooleanCondition

public interface Condition

This interface is used to implement Conditions that are bound to Permissions using ConditionalPermissionCollection. The Permissions of the ConditionalPermissionCollection can only be used if the associated Condition is satisfied.


Nested Class Summary
static class Condition.BooleanCondition
          Package internal class used to define the FALSE and TRUE constants.
 
Field Summary
static Condition FALSE
          A condition object that will always evaluate to false and that is never postponed.
static Condition TRUE
          A condition object that will always evaluate to true and that is never postponed.
 
Method Summary
 boolean isMutable()
          This method returns true if the satisfiability may change.
 boolean isPostponed()
          This method returns true if the evaluation of the Condition must be postponed until the end of the permission check.
 boolean isSatisfied()
          This method returns true if the Condition is satisfied.
 boolean isSatisfied(Condition[] conds, java.util.Dictionary context)
          This method returns true if the set of Conditions are satisfied.
 

Field Detail

TRUE

public static final Condition TRUE
A condition object that will always evaluate to true and that is never postponed.


FALSE

public static final Condition FALSE
A condition object that will always evaluate to false and that is never postponed.

Method Detail

isPostponed

public boolean isPostponed()
This method returns true if the evaluation of the Condition must be postponed until the end of the permission check. If it returns false, it must be able to directly answer the isSatisfied method. In other words, isSatisfied() will return very quickly since no external sources, such as for example users, need to be consulted.

Returns:
false if evaluation is immediate, otherwise true to indicate the evaluation must be postponed.

isSatisfied

public boolean isSatisfied()
This method returns true if the Condition is satisfied.


isMutable

public boolean isMutable()
This method returns true if the satisfiability may change.


isSatisfied

public boolean isSatisfied(Condition[] conds,
                           java.util.Dictionary context)
This method returns true if the set of Conditions are satisfied. Although this method is not static, it should be implemented as if it were static. All of the passed Conditions will have the same type and will correspond to the class type of the object on which this method is invoked.

Parameters:
conds - the array of Conditions that must be satisfied
context - a Dictionary object that implementors can use to track state. If this method is invoked multiple times in the same permission evaluation, the same Dictionary will be passed multiple times. The SecurityManager treats this Dictionary as an opaque object simply creates an empty dictionary and passes it to subsequent invocations if multiple invocatios are needed.
Returns:
true if all the Conditions are satisfied.

OSGi Service Platform
Release 4

Copyright (c) OSGi Alliance (2000, 2005). All Rights Reserved.