Top Description Fields
org.osgi.service.condition

public Interface Condition

Additional top-level class in compilation unit: ConditionImpl.

Known Direct Implementers
org.osgi.service.condition.ConditionImpl
Annotations
@ConsumerType
Imports
org.osgi.annotation.versioning.ConsumerType

Condition Service interface.

In dynamic systems, such as OSGi, one of the more challenging problems can be to define when a system or part of it is ready to do work. The answer can change depending on the individual perspective. The developer of a web server might say, the system is ready when the server starts listening on port 80. An application developer however would define the system as ready when the database connection is up and all servlets are registered. Taking the application developers view, the web server should start listening on port 80 when the application is ready and not beforehand.

The Condition service interface is a marker interface designed to address this issue. Its role is to provide a dependency that can be tracked. It acts as a defined signal to other services.

A Condition service must be registered with the Condition#CONDITION_ID service property.

Author
$Id: 9736e5e1c38c45254f733d73ed7ae2c0e253f544 $

Field Summary

Modifier and TypeField and Description
public static final String
CONDITION_ID

Service property identifying a condition's unique identifier.

public static final String
CONDITION_ID_TRUE

The unique identifier for the default True condition.

public static final Condition
INSTANCE

A condition instance that can be used to register Condition services.

Field Detail

CONDITION_IDback to summary
public static final String CONDITION_ID

Service property identifying a condition's unique identifier.

Since a Condition service can potentially describe more then one condition, the type of this service property is String+.

CONDITION_ID_TRUEback to summary
public static final String CONDITION_ID_TRUE

The unique identifier for the default True condition.

The default True condition is registered by the framework during framework initialization and therefore can always be relied upon.

See Also
Condition#CONDITION_ID
INSTANCEback to summary
public static final Condition INSTANCE

A condition instance that can be used to register Condition services.

This can be helpful to avoid a bundle having to implement this interface to register a Condition service