FElIX-4403 update rfc190 dto classes
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1616384 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/osgi/service/component/runtime/dto/ComponentConfigurationDTO.java b/scr/src/main/java/org/osgi/service/component/runtime/dto/ComponentConfigurationDTO.java
index 6b87ee0..b320f62 100755
--- a/scr/src/main/java/org/osgi/service/component/runtime/dto/ComponentConfigurationDTO.java
+++ b/scr/src/main/java/org/osgi/service/component/runtime/dto/ComponentConfigurationDTO.java
@@ -26,41 +26,37 @@
*
* @since 1.3
* @NotThreadSafe
- * @author $Id: e852b2edb4d364069d01ca41130aac4a3b3112a3 $
+ * @author $Id: f519b5fddd8002ffc252d039856acc8ba6f422d6 $
*/
public class ComponentConfigurationDTO extends DTO {
/**
- * The component configuration is unsatisfied.
- *
- * <p>
- * This is the initial state of a component configuration. When the
- * component configuration becomes satisfied it enters the
- * {@link #SATISFIED} state.
+ * The component configuration is unsatisfied due to a missing required
+ * configuration.
*/
- public static final int UNSATISFIED = 1;
+ public static final int UNSATISFIED_CONFIGURATION = 1;
+
+ /**
+ * The component configuration is unsatisfied due to an unsatisfied
+ * reference.
+ */
+ public static final int UNSATISFIED_REFERENCE = 2;
/**
* The component configuration is satisfied.
*
* <p>
- * Any {@link ComponentDescriptionDTO#serviceInterfaces services} declared by
- * the component description are registered.
- *
- * If the component configuration becomes unsatisfied for any reason, any
- * declared services must be unregistered and the component configuration
- * returns to the {@link #UNSATISFIED} state.
+ * Any {@link ComponentDescriptionDTO#serviceInterfaces services} declared
+ * by the component description are registered.
*/
- public static final int SATISFIED = 2;
+ public static final int SATISFIED = 4;
/**
* The component configuration is active.
*
* <p>
- * This is the normal operational state of a component configuration. The
- * component configuration will move to the {@link #SATISFIED} state when it
- * is deactivated.
+ * This is the normal operational state of a component configuration.
*/
- public static final int ACTIVE = 4;
+ public static final int ACTIVE = 8;
/**
* The representation of the component configuration's component
@@ -81,8 +77,8 @@
* The current state of the component configuration.
*
* <p>
- * This is one of {@link #UNSATISFIED}, {@link #SATISFIED} or
- * {@link #ACTIVE}.
+ * This is one of {@link #UNSATISFIED_CONFIGURATION},
+ * {@link #UNSATISFIED_REFERENCE}, {@link #SATISFIED} or {@link #ACTIVE}.
*/
public int state;
@@ -94,12 +90,22 @@
public Map<String, Object> properties;
/**
- * The currently bound references.
+ * The satisfied references.
*
* <p>
- * Each {@link BoundReferenceDTO} in the array represents a service bound to a
- * reference of the component configuration. The array will be empty if the
- * component configuration has no bound references.
+ * Each {@link SatisfiedReferenceDTO} in the array represents a satisfied
+ * reference of the component configuration. The array must be empty if the
+ * component configuration has no satisfied references.
*/
- public BoundReferenceDTO[] boundReferences;
+ public SatisfiedReferenceDTO[] satisfiedReferences;
+
+ /**
+ * The unsatisfied references.
+ *
+ * <p>
+ * Each {@link UnsatisfiedReferenceDTO} in the array represents an
+ * unsatisfied reference of the component configuration. The array must be
+ * empty if the component configuration has no unsatisfied references.
+ */
+ public UnsatisfiedReferenceDTO[] unsatisfiedReferences;
}
diff --git a/scr/src/main/java/org/osgi/service/component/runtime/dto/ComponentDescriptionDTO.java b/scr/src/main/java/org/osgi/service/component/runtime/dto/ComponentDescriptionDTO.java
index bab6ad4..8e50ca3 100755
--- a/scr/src/main/java/org/osgi/service/component/runtime/dto/ComponentDescriptionDTO.java
+++ b/scr/src/main/java/org/osgi/service/component/runtime/dto/ComponentDescriptionDTO.java
@@ -25,7 +25,7 @@
*
* @since 1.3
* @NotThreadSafe
- * @author $Id: 5ed89a27964e91018c55dc9e72434eb92a438fa6 $
+ * @author $Id: 9f098a6edef3359b4dbd21e1e58bbad01b89b995 $
*/
public class ComponentDescriptionDTO extends DTO {
/**
@@ -33,7 +33,7 @@
*
* <p>
* This is declared in the {@code name} attribute of the {@code component}
- * element. This will be the default name if the component description does
+ * element. This must be the default name if the component description does
* not declare a name.
*/
public String name;
@@ -48,7 +48,7 @@
*
* <p>
* This is declared in the {@code factory} attribute of the
- * {@code component} element. This will be {@code null} if the component
+ * {@code component} element. This must be {@code null} if the component
* description is not declared as a component factory.
*/
public String factory;
@@ -58,7 +58,7 @@
*
* <p>
* This is declared in the {@code scope} attribute of the {@code service}
- * element. This will be {@code null} if the component description does not
+ * element. This must be {@code null} if the component description does not
* declare any service interfaces.
*/
public String scope;
@@ -95,7 +95,7 @@
*
* <p>
* These are declared in the {@code interface} attribute of the
- * {@code provide} elements. The array will be empty if the component
+ * {@code provide} elements. The array must be empty if the component
* description does not declare any service interfaces.
*/
public String[] serviceInterfaces;
@@ -113,7 +113,7 @@
* The referenced services.
*
* <p>
- * These are declared in the {@code reference} elements. The array will be
+ * These are declared in the {@code reference} elements. The array must be
* empty if the component description does not declare references to any
* services.
*/
@@ -124,7 +124,7 @@
*
* <p>
* This is declared in the {@code activate} attribute of the
- * {@code component} element. This will be {@code null} if the component
+ * {@code component} element. This must be {@code null} if the component
* description does not declare an activate method name.
*/
public String activate;
@@ -134,7 +134,7 @@
*
* <p>
* This is declared in the {@code deactivate} attribute of the
- * {@code component} element. This will be {@code null} if the component
+ * {@code component} element. This must be {@code null} if the component
* description does not declare a deactivate method name.
*/
public String deactivate;
@@ -144,7 +144,7 @@
*
* <p>
* This is declared in the {@code modified} attribute of the
- * {@code component} element. This will be {@code null} if the component
+ * {@code component} element. This must be {@code null} if the component
* description does not declare a modified method name.
*/
public String modified;
@@ -154,7 +154,7 @@
*
* <p>
* This is declared in the {@code configuration-policy} attribute of the
- * {@code component} element. This will be the default configuration policy
+ * {@code component} element. This must be the default configuration policy
* if the component description does not declare a configuration policy.
*/
public String configurationPolicy;
@@ -164,7 +164,7 @@
*
* <p>
* These are declared in the {@code configuration-pid} attribute of the
- * {@code component} element. This will contain the default configuration
+ * {@code component} element. This must contain the default configuration
* pid if the component description does not declare a configuration pid.
*/
public String[] configurationPid;
diff --git a/scr/src/main/java/org/osgi/service/component/runtime/dto/ReferenceDTO.java b/scr/src/main/java/org/osgi/service/component/runtime/dto/ReferenceDTO.java
index 33fec8b..e4392bc 100755
--- a/scr/src/main/java/org/osgi/service/component/runtime/dto/ReferenceDTO.java
+++ b/scr/src/main/java/org/osgi/service/component/runtime/dto/ReferenceDTO.java
@@ -23,15 +23,61 @@
*
* @since 1.3
* @NotThreadSafe
- * @author $Id: 2fc8a3deac2ece6b9fff4878dbe3f082faadd5f8 $
+ * @author $Id: a02ee5ad7b783a19bf7e1d8f9dcc6f44685ccd41 $
*/
public class ReferenceDTO extends DTO {
+
+ /**
+ * Constant for the lookup strategy
+ *
+ * @see #strategy
+ */
+ String STRATEGY_LOOKUP = "LOOKUP";
+
+ /**
+ * Constant for the method strategy
+ *
+ * @see #strategy
+ */
+ String STRATEGY_METHOD = "METHOD";
+
+ /**
+ * Constant for the field replace strategy
+ *
+ * @see #strategy
+ */
+ String STRATEGY_FIELD_REPLACE = "FIELD_REPLACE";
+
+ /**
+ * Constant for the field update strategy
+ *
+ * @see #strategy
+ */
+ String STRATEGY_FIELD_UPDATE = "FIELD_UPDATE";
+
+ /**
+ * The strategy of the reference.
+ *
+ * <p>
+ * This field returns the strategy used for this reference. If the value is
+ * either {@code #STRATEGY_FIELD_REPLACE} or {@code #STRATEGY_FIELD_UPDATE},
+ * {@link #field} returns the name of the field. If the strategy is
+ * {@code #STRATEGY_METHOD} {@link #bind}, {@link #unbind}, and
+ * {@link #updated} return the name of the methods.
+ *
+ * @see #STRATEGY_FIELD_REPLACE
+ * @see #STRATEGY_FIELD_UPDATE
+ * @see #STRATEGY_LOOKUP
+ * @see #STRATEGY_METHOD
+ */
+ public String strategy;
+
/**
* The name of the reference.
*
* <p>
* This is declared in the {@code name} attribute of the {@code reference}
- * element. This will be the default name if the component description does
+ * element. This must be the default name if the component description does
* not declare a name for the reference.
*/
public String name;
@@ -50,7 +96,7 @@
*
* <p>
* This is declared in the {@code cardinality} attribute of the
- * {@code reference} element. This will be the default cardinality if the
+ * {@code reference} element. This must be the default cardinality if the
* component description does not declare a cardinality for the reference.
*/
public String cardinality;
@@ -60,7 +106,7 @@
*
* <p>
* This is declared in the {@code policy} attribute of the {@code reference}
- * element. This will be the default policy if the component description
+ * element. This must be the default policy if the component description
* does not declare a policy for the reference.
*/
public String policy;
@@ -70,7 +116,7 @@
*
* <p>
* This is declared in the {@code policy-option} attribute of the
- * {@code reference} element. This will be the default policy option if the
+ * {@code reference} element. This must be the default policy option if the
* component description does not declare a policy option for the reference.
*/
public String policyOption;
@@ -80,7 +126,7 @@
*
* <p>
* This is declared in the {@code target} attribute of the {@code reference}
- * element. This will be {@code null} if the component description does not
+ * element. This must be {@code null} if the component description does not
* declare a target for the reference.
*/
public String target;
@@ -90,8 +136,9 @@
*
* <p>
* This is declared in the {@code bind} attribute of the {@code reference}
- * element. This will be {@code null} if the component description does not
- * declare a bind method for the reference.
+ * element. This must be {@code null} if the component is not using the
+ * method strategy or the component description does not declare a bind
+ * method for the reference.
*/
public String bind;
@@ -100,8 +147,11 @@
*
* <p>
* This is declared in the {@code unbind} attribute of the {@code reference}
- * element. This will be {@code null} if the component description does not
- * declare an unbind method for the reference.
+ * element. This must be {@code null} if the component is not using the
+ * method strategy or the component description does not declare an unbind
+ * method for the reference.
+ *
+ * @see #strategy
*/
public String unbind;
@@ -110,17 +160,32 @@
*
* <p>
* This is declared in the {@code updated} attribute of the
- * {@code reference} element. This will be {@code null} if the component
- * description does not declare an updated method for the reference.
+ * {@code reference} element. This must be {@code null} if the component is
+ * not using the method strategy or the component description does not
+ * declare an updated method for the reference.
+ *
+ * @see #strategy
*/
public String updated;
/**
+ * The name of the field of the reference.
+ *
+ * <p>
+ * This is declared in the {@code field} attribute of the {@code reference}
+ * element. This must be {@code null} if the component is using the lookup
+ * or method strategy.
+ *
+ * @see #strategy
+ */
+ public String field;
+
+ /**
* The scope of the reference.
*
* <p>
* This is declared in the {@code scope} attribute of the {@code reference}
- * element. This will be the default scope if the component description does
+ * element. This must be the default scope if the component description does
* not declare a scope for the reference.
*/
public String scope;
diff --git a/scr/src/main/java/org/osgi/service/component/runtime/dto/BoundReferenceDTO.java b/scr/src/main/java/org/osgi/service/component/runtime/dto/SatisfiedReferenceDTO.java
similarity index 76%
rename from scr/src/main/java/org/osgi/service/component/runtime/dto/BoundReferenceDTO.java
rename to scr/src/main/java/org/osgi/service/component/runtime/dto/SatisfiedReferenceDTO.java
index b843280..3bfc082 100755
--- a/scr/src/main/java/org/osgi/service/component/runtime/dto/BoundReferenceDTO.java
+++ b/scr/src/main/java/org/osgi/service/component/runtime/dto/SatisfiedReferenceDTO.java
@@ -20,13 +20,13 @@
import org.osgi.framework.dto.ServiceReferenceDTO;
/**
- * A representation of a bound reference to a service.
+ * A representation of a satisfied reference.
*
* @since 1.3
* @NotThreadSafe
- * @author $Id: 1ba28863312f0c0784e4a5596f991a6a6a68c147 $
+ * @author $Id: 20de229ef78ffbfd603b62d4534721e2f2b17922 $
*/
-public class BoundReferenceDTO extends DTO {
+public class SatisfiedReferenceDTO extends DTO {
/**
* The name of the declared reference.
*
@@ -34,18 +34,18 @@
* This is declared in the {@code name} attribute of the {@code reference}
* element of the component description.
*
- * @see ComponentDescriptionDTO#name
+ * @see ReferenceDTO#name
*/
public String name;
/**
- * The target property of the bound reference.
+ * The target property of the satisfied reference.
*
* <p>
* This is the value of the {@link ComponentConfigurationDTO#properties
* component property} whose name is the concatenation of the
* {@link ReferenceDTO#name declared reference name} and
- * ".target". This will be {@code null} if no target property is
+ * ".target". This must be {@code null} if no target property is
* set for the reference.
*/
public String target;
@@ -55,7 +55,8 @@
*
* <p>
* Each {@link ServiceReferenceDTO} in the array represents a service bound
- * to the component configuration.
+ * to the satisfied reference. The array must be empty if there are no bound
+ * services.
*/
- public ServiceReferenceDTO[] serviceReferences;
+ public ServiceReferenceDTO[] boundServices;
}
diff --git a/scr/src/main/java/org/osgi/service/component/runtime/dto/BoundReferenceDTO.java b/scr/src/main/java/org/osgi/service/component/runtime/dto/UnsatisfiedReferenceDTO.java
old mode 100755
new mode 100644
similarity index 65%
copy from scr/src/main/java/org/osgi/service/component/runtime/dto/BoundReferenceDTO.java
copy to scr/src/main/java/org/osgi/service/component/runtime/dto/UnsatisfiedReferenceDTO.java
index b843280..870c5c3
--- a/scr/src/main/java/org/osgi/service/component/runtime/dto/BoundReferenceDTO.java
+++ b/scr/src/main/java/org/osgi/service/component/runtime/dto/UnsatisfiedReferenceDTO.java
@@ -20,13 +20,13 @@
import org.osgi.framework.dto.ServiceReferenceDTO;
/**
- * A representation of a bound reference to a service.
+ * A representation of an unsatisfied reference.
*
* @since 1.3
* @NotThreadSafe
- * @author $Id: 1ba28863312f0c0784e4a5596f991a6a6a68c147 $
+ * @author $Id: 20ce77a3dbc307be592c86bf7b5eddacfe77e21b $
*/
-public class BoundReferenceDTO extends DTO {
+public class UnsatisfiedReferenceDTO extends DTO {
/**
* The name of the declared reference.
*
@@ -34,28 +34,31 @@
* This is declared in the {@code name} attribute of the {@code reference}
* element of the component description.
*
- * @see ComponentDescriptionDTO#name
+ * @see ReferenceDTO#name
*/
public String name;
/**
- * The target property of the bound reference.
+ * The target property of the unsatisfied reference.
*
* <p>
* This is the value of the {@link ComponentConfigurationDTO#properties
* component property} whose name is the concatenation of the
* {@link ReferenceDTO#name declared reference name} and
- * ".target". This will be {@code null} if no target property is
+ * ".target". This must be {@code null} if no target property is
* set for the reference.
*/
public String target;
/**
- * The bound services.
+ * The target services.
*
* <p>
- * Each {@link ServiceReferenceDTO} in the array represents a service bound
- * to the component configuration.
+ * Each {@link ServiceReferenceDTO} in the array represents a target service
+ * for the reference. The array must be empty if there are no target
+ * services. The upper bound on the number of target services in the array
+ * is the upper bound on the {@link ReferenceDTO#cardinality cardinality} of
+ * the reference.
*/
- public ServiceReferenceDTO[] serviceReferences;
+ public ServiceReferenceDTO[] targetServices;
}