[osgi-compendium] 02/02: Added new types from OSGi Compendium 6 required by BND 2.4.0
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Thu Dec 17 08:55:46 UTC 2015
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository osgi-compendium.
commit 127d61c41d6e76a4af8f93d9d1284aa60ab23c6c
Author: Emmanuel Bourg <ebourg at apache.org>
Date: Thu Dec 17 09:55:28 2015 +0100
Added new types from OSGi Compendium 6 required by BND 2.4.0
---
debian/changelog | 1 +
debian/patches/01-osgi6-features.patch | 1274 ++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 1276 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 9196ef9..e3eb9b2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
osgi-compendium (5.0.0-3) UNRELEASED; urgency=medium
* Team upload.
+ * Added new types from OSGi Compendium 6 required by BND 2.4.0
* Transition to the Servlet API 3.1
-- Emmanuel Bourg <ebourg at apache.org> Wed, 16 Dec 2015 17:51:14 +0100
diff --git a/debian/patches/01-osgi6-features.patch b/debian/patches/01-osgi6-features.patch
new file mode 100644
index 0000000..c753590
--- /dev/null
+++ b/debian/patches/01-osgi6-features.patch
@@ -0,0 +1,1274 @@
+Description: Add new types from OSGi Compendium 6 required by BND 2.4.0
+Origin: backport, http://repo1.maven.org/maven2/org/osgi/org.osgi.service.component.annotations/1.3.0/org.osgi.service.component.annotations-1.3.0-sources.jar
+ http://repo1.maven.org/maven2/org/osgi/org.osgi.service.metatype.annotations/1.3.0/org.osgi.service.metatype.annotations-1.3.0-sources.jar
+--- a/org/osgi/service/component/annotations/Component.java
++++ b/org/osgi/service/component/annotations/Component.java
+@@ -183,18 +183,82 @@
+ ConfigurationPolicy configurationPolicy() default ConfigurationPolicy.OPTIONAL;
+
+ /**
+- * The configuration PID for the configuration of this Component.
++ * The configuration PIDs for the configuration of this Component.
+ *
+ * <p>
+- * Allows the configuration PID for this Component to be different than the
+- * name of this Component.
++ * Each value specifies a configuration PID for this Component.
+ *
+ * <p>
+- * If not specified, the name of this Component is used as the configuration
+- * PID of this Component.
++ * If no value is specified, the name of this Component is used as the
++ * configuration PID of this Component.
++ *
++ * <p>
++ * A special string (<code>{@value #NAME}</code>) can be used to specify the
++ * name of the component as a configuration PID. The {@code NAME} constant
++ * holds this special string. For example:
++ *
++ * <pre>
++ * @Component(configurationPid={"com.acme.system", Component.NAME})
++ * </pre>
++ *
++ * Tools creating a Component Description from this annotation must replace
++ * the special string with the actual name of this Component.
+ *
+ * @see "The configuration-pid attribute of the component element of a Component Description."
+ * @since 1.2
+ */
+- String configurationPid() default "";
++ String[] configurationPid() default NAME;
++
++ /**
++ * Special string representing the name of this Component.
++ *
++ * <p>
++ * This string can be used in {@link #configurationPid()} to specify the
++ * name of the component as a configuration PID. For example:
++ *
++ * <pre>
++ * @Component(configurationPid={"com.acme.system", Component.NAME})
++ * </pre>
++ *
++ * Tools creating a Component Description from this annotation must replace
++ * the special string with the actual name of this Component.
++ *
++ * @since 1.3
++ */
++ String NAME = "$";
++
++ /**
++ * The service scope for the service of this Component.
++ *
++ * <p>
++ * If not specified (and the deprecated {@link #servicefactory()} element is
++ * not specified), the {@link ServiceScope#SINGLETON singleton} service
++ * scope is used. If the {@link #factory()} element is specified or the
++ * {@link #immediate()} element is specified with {@code true}, this element
++ * can only be specified with the {@link ServiceScope#SINGLETON singleton}
++ * service scope.
++ *
++ * @see "The scope attribute of the service element of a Component Description."
++ * @since 1.3
++ */
++ ServiceScope scope() default ServiceScope.DEFAULT;
++
++ /**
++ * The lookup strategy references of this Component.
++ *
++ * <p>
++ * To access references using the lookup strategy, {@link Reference}
++ * annotations are specified naming the reference and declaring the type of
++ * the referenced service. The referenced service can be accessed using one
++ * of the {@code locateService} methods of {@code ComponentContext}.
++ *
++ * <p>
++ * To access references using the event strategy, bind methods are annotated
++ * with {@link Reference}. To access references using the field strategy,
++ * fields are annotated with {@link Reference}.
++ *
++ * @see "The reference element of a Component Description."
++ * @since 1.3
++ */
++ Reference[] reference() default {};
+ }
+--- /dev/null
++++ b/org/osgi/service/component/annotations/FieldOption.java
+@@ -0,0 +1,54 @@
++/*
++ * Copyright (c) OSGi Alliance (2014, 2015). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.component.annotations;
++
++/**
++ * Field options for the {@link Reference} annotation.
++ *
++ * @since 1.3
++ * @author $Id: 35bfd6c67110ff6c5cd5c9c1764398e4024dbb59 $
++ */
++public enum FieldOption {
++
++ /**
++ * The update field option is used to update the collection referenced by
++ * the field when there are changes to the bound services.
++ *
++ * <p>
++ * This field option can only be used when the field reference has dynamic
++ * policy and multiple cardinality.
++ */
++ UPDATE("update"),
++
++ /**
++ * The replace field option is used to replace the field value with a new
++ * value when there are changes to the bound services.
++ */
++ REPLACE("replace");
++
++ private final String value;
++
++ FieldOption(String value) {
++ this.value = value;
++ }
++
++ @Override
++ public String toString() {
++ return value;
++ }
++}
++
+--- /dev/null
++++ b/org/osgi/service/component/annotations/LookupReference.java
+@@ -0,0 +1,112 @@
++/*
++ * Copyright (c) OSGi Alliance (2013). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.component.annotations;
++
++import java.lang.annotation.Retention;
++import java.lang.annotation.RetentionPolicy;
++import java.lang.annotation.Target;
++
++/**
++ * Define a lookup strategy reference for a {@link Component}.
++ *
++ * <p>
++ * The referenced service can be accessed using one of the {@code locateService}
++ * methods of {@code ComponentContext}.
++ *
++ * <p>
++ * This annotation is not processed at runtime by a Service Component Runtime
++ * implementation. It must be processed by tools and used to add a Component
++ * Description to the bundle.
++ *
++ * <p>
++ * In the generated Component Description for a component, the references must
++ * be ordered in ascending lexicographical order (using {@code String.compareTo}
++ * ) of the reference {@link #name() name}s.
++ *
++ * @see "The reference element of a Component Description."
++ * @author $Id: 39a18d2d533af21bee40e41d09b8d5a8405e100b $
++ * @since 1.3
++ */
++ at Retention(RetentionPolicy.CLASS)
++ at Target({})
++public @interface LookupReference {
++ /**
++ * The name of this reference.
++ *
++ * @see "The name attribute of the reference element of a Component Description."
++ */
++ String name();
++
++ /**
++ * The type of the service to bind to this reference.
++ *
++ * @see "The interface attribute of the reference element of a Component Description."
++ */
++ Class<?> service();
++
++ /**
++ * The cardinality of the reference.
++ *
++ * <p>
++ * If not specified, the reference has a
++ * {@link ReferenceCardinality#MANDATORY 1..1} cardinality.
++ *
++ * @see "The cardinality attribute of the reference element of a Component Description."
++ */
++ ReferenceCardinality cardinality() default ReferenceCardinality.MANDATORY;
++
++ /**
++ * The policy for the reference.
++ *
++ * <p>
++ * If not specified, the {@link ReferencePolicy#STATIC STATIC} reference
++ * policy is used.
++ *
++ * @see "The policy attribute of the reference element of a Component Description."
++ */
++ ReferencePolicy policy() default ReferencePolicy.STATIC;
++
++ /**
++ * The target filter for the reference.
++ *
++ * @see "The target attribute of the reference element of a Component Description."
++ */
++ String target() default "";
++
++ /**
++ * The policy option for the reference.
++ *
++ * <p>
++ * If not specified, the {@link ReferencePolicyOption#RELUCTANT RELUCTANT}
++ * reference policy option is used.
++ *
++ * @see "The policy-option attribute of the reference element of a Component Description."
++ */
++ ReferencePolicyOption policyOption() default ReferencePolicyOption.RELUCTANT;
++
++ /**
++ * The requested service scope for this Reference.
++ *
++ * <p>
++ * If not specified, the {@link ReferenceScope#BUNDLE bundle} service scope
++ * is requested.
++ *
++ * @see "The scope attribute of the reference element of a Component Description."
++ */
++ ReferenceScope scope() default ReferenceScope.BUNDLE;
++}
++
+--- a/org/osgi/service/component/annotations/Reference.java
++++ b/org/osgi/service/component/annotations/Reference.java
+@@ -42,7 +42,7 @@
+ * @author $Id: 9887c51c74905b29393f0b2fe7cf5f9a40eb3d72 $
+ */
+ @Retention(RetentionPolicy.CLASS)
+- at Target(ElementType.METHOD)
++ at Target({ElementType.METHOD, ElementType.FIELD})
+ public @interface Reference {
+ /**
+ * The name of this reference.
+@@ -97,11 +97,19 @@
+ String target() default "";
+
+ /**
+- * The name of the unbind method which is associated with the annotated bind
+- * method.
++ * The policy option for this reference.
+ *
+ * <p>
+- * To declare no unbind method, the value {@code "-"} must be used.
++ * If not specified, the {@link ReferencePolicyOption#RELUCTANT RELUCTANT}
++ * reference policy option is used.
++ *
++ * @see "The policy-option attribute of the reference element of a Component Description."
++ * @since 1.2
++ */
++ ReferencePolicyOption policyOption() default ReferencePolicyOption.RELUCTANT;
++
++ /**
++ * The reference scope for this reference.
+ *
+ * <p>
+ * If not specified, the name of the unbind method is derived from the name
+@@ -113,21 +121,39 @@
+ * is only set if the component type contains a method with the derived
+ * name.
+ *
+- * @see "The unbind attribute of the reference element of a Component Description."
++ * @see "The scope attribute of the reference element of a Component Description."
++ * @since 1.3
+ */
+- String unbind() default "";
++ ReferenceScope scope() default ReferenceScope.BUNDLE;
++
++ /* Method injection elements */
+
+ /**
+- * The policy option for the reference.
++ * The name of the bind method for this reference.
+ *
+ * <p>
+ * If not specified, the {@link ReferencePolicyOption#RELUCTANT RELUCTANT}
+ * reference policy option is used.
+ *
+- * @see "The policy-option attribute of the reference element of a Component Description."
+- * @since 1.2
++ * <p>
++ * If not specified, the name of the bind method is based upon how this
++ * annotation is used:
++ * <ul>
++ * <li>Annotated method - The name of the annotated method is the name of
++ * the bind method.</li>
++ * <li>Annotated field - There is no bind method name.</li>
++ * <li>{@link Component#reference()} element - There is no bind method name.
++ * </li>
++ * </ul>
++ *
++ * <p>
++ * If there is a bind method name, the component must contain a method with
++ * that name.
++ *
++ * @see "The bind attribute of the reference element of a Component Description."
++ * @since 1.3
+ */
+- ReferencePolicyOption policyOption() default ReferencePolicyOption.RELUCTANT;
++ String bind() default "";
+
+ /**
+ * The name of the updated method which is associated with the annotated
+@@ -149,4 +175,85 @@
+ * @since 1.2
+ */
+ String updated() default "";
++
++ /**
++ * The name of the unbind method for this reference.
++ *
++ * <p>
++ * If not specified, the name of the unbind method is based upon how this
++ * annotation is used:
++ * <ul>
++ * <li>Annotated method - The name of the unbind method is created from the
++ * name of the annotated method. If the name of the annotated method begins
++ * with {@code bind}, {@code set} or {@code add}, that prefix is replaced
++ * with {@code unbind}, {@code unset} or {@code remove}, respectively, to
++ * create the name candidate for the unbind method. Otherwise, {@code un} is
++ * prefixed to the name of the annotated method to create the name candidate
++ * for the unbind method. If the component type contains a method with the
++ * candidate name, the candidate name is used as the name of the unbind
++ * method. To declare no unbind method when the component type contains a
++ * method with the candidate name, the value {@code "-"} must be used.</li>
++ * <li>Annotated field - There is no unbind method name.</li>
++ * <li>{@link Component#reference()} element - There is no unbind method
++ * name.</li>
++ * </ul>
++ *
++ * <p>
++ * If there is an unbind method name, the component must contain a method
++ * with that name.
++ *
++ * @see "The unbind attribute of the reference element of a Component Description."
++ */
++ String unbind() default "";
++
++ /* Field injection elements */
++
++ /**
++ * The name of the field for this reference.
++ *
++ * <p>
++ * If specified and this reference annotates a field, the specified name
++ * must match the name of the annotated field.
++ *
++ * <p>
++ * If not specified, the name of the field is based upon how this annotation
++ * is used:
++ * <ul>
++ * <li>Annotated method - There is no field name.</li>
++ * <li>Annotated field - The name of the annotated field is the name of the
++ * field.</li>
++ * <li>{@link Component#reference()} element - There is no field name.</li>
++ * </ul>
++ *
++ * <p>
++ * If there is a field name, the component must contain a field with that
++ * name.
++ *
++ * @see "The field attribute of the reference element of a Component Description."
++ * @since 1.3
++ */
++ String field() default "";
++
++ /**
++ * The field option for this reference.
++ *
++ * <p>
++ * If not specified, the field option is based upon how this annotation is
++ * used:
++ * <ul>
++ * <li>Annotated method - There is no field option.</li>
++ * <li>Annotated field - The field option is based upon the policy and
++ * cardinality of the reference and the modifiers of the field. If the
++ * policy is {@link ReferencePolicy#DYNAMIC}, the cardinality is
++ * {@link ReferenceCardinality#MULTIPLE 0..n} or
++ * {@link ReferenceCardinality#AT_LEAST_ONE 1..n}, and the field is declared
++ * {@code final}, the field option is {@link FieldOption#UPDATE}. Otherwise,
++ * the field option is {@link FieldOption#REPLACE}</li>
++ * <li>{@link Component#reference()} element - There is no field option.</li>
++ * </ul>
++ *
++ * @see "The field-option attribute of the reference element of a Component Description."
++ * @since 1.3
++ */
++ FieldOption fieldOption() default FieldOption.REPLACE;
+ }
+--- /dev/null
++++ b/org/osgi/service/component/annotations/ReferenceScope.java
+@@ -0,0 +1,57 @@
++/*
++ * Copyright (c) OSGi Alliance (2013, 2014). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.component.annotations;
++
++/**
++ * Reference scope for the {@link Reference} annotation.
++ *
++ * @author $Id: 2a61ef265cfb7a771bd86710e2319a49ae548f3e $
++ * @since 1.3
++ */
++public enum ReferenceScope {
++ /**
++ * A single service object is used for all references to the service in this
++ * bundle.
++ */
++ BUNDLE("bundle"),
++
++ /**
++ * If the bound service has prototype service scope, then each instance of
++ * the component with this reference can receive a unique instance of the
++ * service. If the bound service does not have prototype service scope, then
++ * this reference scope behaves the same as {@link #BUNDLE}.
++ */
++ PROTOTYPE("prototype"),
++
++ /**
++ * Bound services must have prototype service scope. Each instance of the
++ * component with this reference can receive a unique instance of the
++ * service.
++ */
++ PROTOTYPE_REQUIRED("prototype_required");
++
++ private final String value;
++
++ ReferenceScope(String value) {
++ this.value = value;
++ }
++
++ @Override
++ public String toString() {
++ return value;
++ }
++}
+--- /dev/null
++++ b/org/osgi/service/component/annotations/ServiceScope.java
+@@ -0,0 +1,64 @@
++/*
++ * Copyright (c) OSGi Alliance (2011, 2014). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.component.annotations;
++
++/**
++ * Service scope for the {@link Component} annotation.
++ *
++ * @author $Id: 3c43d5feab4f5f8782acd72b0461feab464db2f8 $
++ * @since 1.3
++ */
++public enum ServiceScope {
++ /**
++ * When the component is registered as a service, it must be registered as a
++ * bundle scope service but only a single instance of the component must be
++ * used for all bundles using the service.
++ */
++ SINGLETON("singleton"),
++
++ /**
++ * When the component is registered as a service, it must be registered as a
++ * bundle scope service and an instance of the component must be created for
++ * each bundle using the service.
++ */
++ BUNDLE("bundle"),
++
++ /**
++ * When the component is registered as a service, it must be registered as a
++ * prototype scope service and an instance of the component must be created
++ * for each distinct request for the service.
++ */
++ PROTOTYPE("prototype"),
++
++ /**
++ * Default element value for annotation. This is used to distinguish the
++ * default value for an element and should not otherwise be used.
++ */
++ DEFAULT("<<default>>");
++
++ private final String value;
++
++ ServiceScope(String value) {
++ this.value = value;
++ }
++
++ @Override
++ public String toString() {
++ return value;
++ }
++}
++
+--- /dev/null
++++ b/org/osgi/service/metatype/annotations/AttributeDefinition.java
+@@ -0,0 +1,217 @@
++/*
++ * Copyright (c) OSGi Alliance (2013, 2014). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.metatype.annotations;
++
++import java.lang.annotation.ElementType;
++import java.lang.annotation.Retention;
++import java.lang.annotation.RetentionPolicy;
++import java.lang.annotation.Target;
++
++/**
++ * {@code AttributeDefinition} information for the annotated method.
++ *
++ * <p>
++ * Each method of a type annotated by {@link ObjectClassDefinition} has an
++ * implied AttributeDefinition annotation. This annotation is only used to
++ * specify non-default AttributeDefinition information.
++ *
++ * <p>
++ * The {@code id} of this AttributeDefinition is generated from the name of the
++ * annotated method. The annotated method name is processed from left to right
++ * changing each character as follows:
++ * <ul>
++ * <li>A dollar sign ({@code '$'} \u0024) is removed unless it is followed
++ * by another dollar sign in which case the two consecutive dollar signs (
++ * {@code '$$'}) are changed to a single dollar sign.</li>
++ * <li>A low line ({@code '_'} \u005F) is changed to a full stop (
++ * {@code '.'} \u002E) unless is it followed by another low line in which
++ * case the two consecutive low lines ({@code '__'}) are changed to a single low
++ * line.</li>
++ * <li>All other characters are unchanged.</li>
++ * </ul>
++ * This id is the value of the id attribute of the generate AD element and is
++ * used as the name of the corresponding configuration property.
++ *
++ * <p>
++ * This annotation is not processed at runtime. It must be processed by tools
++ * and used to contribute to a Meta Type Resource document for the bundle.
++ *
++ * @see "The AD element of a Meta Type Resource."
++ * @author $Id: 366d21759b5562656dc97a391f61181970d71ec7 $
++ */
++ at Retention(RetentionPolicy.CLASS)
++ at Target(ElementType.METHOD)
++public @interface AttributeDefinition {
++ /**
++ * The human readable name of this AttributeDefinition.
++ *
++ * <p>
++ * If not specified, the name of this AttributeDefinition is derived from
++ * the name of the annotated method. For example, low line ({@code '_'}
++ * \u005F) and dollar sign ({@code '$'} \u0024) are replaced with
++ * space ({@code ' '} \u0020) and space is inserted between camel case
++ * words.
++ *
++ * <p>
++ * If the name begins with the percent sign ({@code '%'} \u0025), the
++ * name can be {@link ObjectClassDefinition#localization() localized}.
++ *
++ * @see "The name attribute of the AD element of a Meta Type Resource."
++ */
++ String name() default "";
++
++ /**
++ * The human readable description of this AttributeDefinition.
++ *
++ * <p>
++ * If not specified, the description of this AttributeDefinition is the
++ * empty string.
++ *
++ * <p>
++ * If the description begins with the percent sign ({@code '%'} \u0025),
++ * the description can be {@link ObjectClassDefinition#localization()
++ * localized}.
++ *
++ * @see "The description attribute of the AD element of a Meta Type Resource."
++ */
++ String description() default "";
++
++ /**
++ * The type of this AttributeDefinition.
++ *
++ * <p>
++ * This must be one of the defined {@link AttributeType attributes types}.
++ *
++ * <p>
++ * If not specified, the type is derived from the return type of the
++ * annotated method. Return types of {@code Class} and {@code Enum} are
++ * mapped to {@link AttributeType#STRING STRING}. If the return type is
++ * {@code List}, {@code Set}, {@code Collection}, {@code Iterable} or some
++ * type which can be determined at annotation processing time to
++ * <ol>
++ * <li>be a subtype of {@code Collection} and</li>
++ * <li>have a public no argument constructor,</li>
++ * </ol>
++ * then the type is derived from the generic type. For example, a return
++ * type of {@code List<String>} will be mapped to
++ * {@link AttributeType#STRING STRING}. A return type of a single
++ * dimensional array is supported and the type is the component type of the
++ * array. Multi dimensional arrays are not supported. Annotation return
++ * types are not supported. Any unrecognized type is mapped to
++ * {@link AttributeType#STRING STRING}. A tool processing the annotation
++ * should declare an error for unsupported return types.
++ *
++ * @see "The type attribute of the AD element of a Meta Type Resource."
++ */
++ AttributeType type() default AttributeType.STRING;
++
++ /**
++ * The cardinality of this AttributeDefinition.
++ *
++ * <p>
++ * If not specified, the cardinality is derived from the return type of the
++ * annotated method. For an array return type, the cardinality is a large
++ * positive value. If the return type is {@code List}, {@code Set},
++ * {@code Collection}, {@code Iterable} or some type which can be determined
++ * at annotation processing time to
++ * <ol>
++ * <li>be a subtype of {@code Collection} and</li>
++ * <li>have a public no argument constructor,</li>
++ * </ol>
++ * the cardinality is a large negative value. Otherwise, the cardinality is
++ * 0.
++ *
++ * @see "The cardinality attribute of the AD element of a Meta Type Resource."
++ */
++ int cardinality() default 0;
++
++ /**
++ * The minimum value for this AttributeDefinition.
++ *
++ * <p>
++ * If not specified, there is no minimum value.
++ *
++ * @see "The min attribute of the AD element of a Meta Type Resource."
++ */
++ String min() default "";
++
++ /**
++ * The maximum value for this AttributeDefinition.
++ *
++ * <p>
++ * If not specified, there is no maximum value.
++ *
++ * @see "The max attribute of the AD element of a Meta Type Resource."
++ */
++ String max() default "";
++
++ /**
++ * The default value for this AttributeDefinition.
++ *
++ * <p>
++ * The specified values are concatenated into a comma delimited list to
++ * become the value of the {@code default} attribute of the generated
++ * {@code AD} element.
++ *
++ * <p>
++ * If not specified and the annotated method is an annotation element that
++ * has a {@code default} value, then the value of this element is the
++ * {@code default} value of the annotated element. Otherwise, there is no
++ * default value.
++ *
++ * @see "The default attribute of the AD element of a Meta Type Resource."
++ */
++ String[] defaultValue() default {};
++
++ /**
++ * The required value for this AttributeDefinition.
++ *
++ * <p>
++ * If not specified, the value is {@code true}.
++ *
++ * @see "The required attribute of the AD element of a Meta Type Resource."
++ */
++ boolean required() default true;
++
++ /**
++ * The option information for this AttributeDefinition.
++ *
++ * <p>
++ * For each specified {@link Option}, an {@code Option} element is generated
++ * for this AttributeDefinition.
++ *
++ * <p>
++ * If not specified, the option information is derived from the return type
++ * of the annotated method. If the return type is an {@code enum}, a single
++ * dimensional array of an {@code enum}, or a {@code List}, {@code Set},
++ * {@code Collection}, {@code Iterable} or some type which can be determined
++ * at annotation processing time to
++ * <ol>
++ * <li>be a subtype of {@code Collection} and</li>
++ * <li>have a public no argument constructor,</li>
++ * </ol>
++ * with a generic type of an {@code enum}, then the value of this element
++ * has an {@link Option} for each value of the {@code enum}. The label and
++ * value of each {@link Option} are set to the name of the corresponding
++ * {@code enum} value. Otherwise, no {@code Option} elements will be
++ * generated.
++ *
++ * @see "The Option element of a Meta Type Resource."
++ */
++ Option[] options() default {};
++}
++
+--- /dev/null
++++ b/org/osgi/service/metatype/annotations/AttributeType.java
+@@ -0,0 +1,142 @@
++/*
++ * Copyright (c) OSGi Alliance (2013). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.metatype.annotations;
++
++/**
++ * Attribute types for the {@link AttributeDefinition} annotation.
++ *
++ * @see AttributeDefinition#type()
++ * @author $Id: 9ab62c08937c0f76ba6465cb95e4cd5cf6ca8e8f $
++ */
++public enum AttributeType {
++ /**
++ * The {@code String} type.
++ *
++ * <p>
++ * Attributes of this type should be stored as {@code String},
++ * {@code List<String>} or {@code String[]} objects, depending on the
++ * {@link AttributeDefinition#cardinality() cardinality} value.
++ */
++ STRING("String"),
++
++ /**
++ * The {@code Long} type.
++ *
++ * <p>
++ * Attributes of this type should be stored as {@code Long},
++ * {@code List<Long>} or {@code long[]} objects, depending on the
++ * {@code AttributeDefinition#cardinality() cardinality} value.
++ */
++ LONG("Long"),
++
++ /**
++ * The {@code Integer} type.
++ *
++ * <p>
++ * Attributes of this type should be stored as {@code Integer},
++ * {@code List<Integer>} or {@code int[]} objects, depending on the
++ * {@code AttributeDefinition#cardinality() cardinality} value.
++ */
++ INTEGER("Integer"),
++
++ /**
++ * The {@code Short} type.
++ *
++ * <p>
++ * Attributes of this type should be stored as {@code Short},
++ * {@code List<Short>} or {@code short[]} objects, depending on the
++ * {@code AttributeDefinition#cardinality() cardinality} value.
++ */
++ SHORT("Short"),
++
++ /**
++ * The {@code Character} type.
++ *
++ * <p>
++ * Attributes of this type should be stored as {@code Character},
++ * {@code List<Character>} or {@code char[]} objects, depending on the
++ * {@code AttributeDefinition#cardinality() cardinality} value.
++ */
++ CHARACTER("Character"),
++
++ /**
++ * The {@code Byte} type.
++ *
++ * <p>
++ * Attributes of this type should be stored as {@code Byte},
++ * {@code List<Byte>} or {@code byte[]} objects, depending on the
++ * {@code AttributeDefinition#cardinality() cardinality} value.
++ */
++ BYTE("Byte"),
++
++ /**
++ * The {@code Double} type.
++ *
++ * <p>
++ * Attributes of this type should be stored as {@code Double},
++ * {@code List<Double>} or {@code double[]} objects, depending on the
++ * {@code AttributeDefinition#cardinality() cardinality} value.
++ */
++ DOUBLE("Double"),
++
++ /**
++ * The {@code Float} type.
++ *
++ * <p>
++ * Attributes of this type should be stored as {@code Float},
++ * {@code List<Float>} or {@code float[]} objects, depending on the
++ * {@code AttributeDefinition#cardinality() cardinality} value.
++ */
++ FLOAT("Float"),
++
++ /**
++ * The {@code Boolean} type.
++ *
++ * <p>
++ * Attributes of this type should be stored as {@code Boolean},
++ * {@code List<Boolean>} or {@code boolean[]} objects depending on
++ * {@code AttributeDefinition#cardinality() cardinality}.
++ */
++ BOOLEAN("Boolean"),
++
++ /**
++ * The {@code Password} type.
++ *
++ * <p>
++ * Attributes of this type must be stored as {@code String},
++ * {@code List<String>} or {@code String[]} objects depending on
++ * {@link AttributeDefinition#cardinality() cardinality}.
++ *
++ * <p>
++ * A {@code Password} must be treated as a {@code String} but the type can
++ * be used to disguise the information when displayed to a user to prevent
++ * it from being seen.
++ */
++ PASSWORD("Password");
++
++ private final String value;
++
++ AttributeType(String value) {
++ this.value = value;
++ }
++
++ @Override
++ public String toString() {
++ return value;
++ }
++}
++
+--- /dev/null
++++ b/org/osgi/service/metatype/annotations/Designate.java
+@@ -0,0 +1,69 @@
++/*
++ * Copyright (c) OSGi Alliance (2014). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.metatype.annotations;
++
++import java.lang.annotation.ElementType;
++import java.lang.annotation.Retention;
++import java.lang.annotation.RetentionPolicy;
++import java.lang.annotation.Target;
++
++/**
++ * Generate a {@code Designate} element in the Meta Type Resource for an
++ * {@link ObjectClassDefinition} using the annotated Declarative Services
++ * component.
++ *
++ * <p>
++ * This annotation must be used on a type that is also annotated with the
++ * Declarative Services {@link org.osgi.service.component.annotations.Component
++ * Component} annotation. The component must only have a single PID which is
++ * used for the generated {@code Designate} element.
++ *
++ * <p>
++ * This annotation is not processed at runtime. It must be processed by tools
++ * and used to contribute to a Meta Type Resource document for the bundle.
++ *
++ * @see "The Designate element of a Meta Type Resource."
++ * @author $Id: 99cf054e1e37e4114494d492910fc2a2dc57ab0a $
++ */
++ at Retention(RetentionPolicy.CLASS)
++ at Target(ElementType.TYPE)
++public @interface Designate {
++ /**
++ * The type of the {@link ObjectClassDefinition} for this Designate.
++ *
++ * <p>
++ * The specified type must be annotated with {@link ObjectClassDefinition}.
++ *
++ * @see "The ocdref attribute of the Designate element of a Meta Type Resource."
++ */
++ Class<?> ocd();
++
++ /**
++ * Specifies whether this Designate is for a factory PID.
++ *
++ * <p>
++ * If {@code false}, then the PID value from the annotated component will be
++ * used in the {@code pid} attribute of the generated {@code Designate}
++ * element. If {@code true}, then the PID value from the annotated component
++ * will be used in the {@code factoryPid} attribute of the generated
++ * {@code Designate} element.
++ *
++ * @see "The pid and factoryPid attributes of the Designate element of a Meta Type Resource."
++ */
++ boolean factory() default false;
++}
++
+--- /dev/null
++++ b/org/osgi/service/metatype/annotations/Icon.java
+@@ -0,0 +1,59 @@
++/*
++ * Copyright (c) OSGi Alliance (2013). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.metatype.annotations;
++
++import java.lang.annotation.Retention;
++import java.lang.annotation.RetentionPolicy;
++import java.lang.annotation.Target;
++
++/**
++ * {@code Icon} information for an {@link ObjectClassDefinition}.
++ *
++ * @see ObjectClassDefinition#icon()
++ * @author $Id: e9e89ed20e3fc24a1f1e74324fe2b717ebecad45 $
++ */
++ at Retention(RetentionPolicy.CLASS)
++ at Target({})
++public @interface Icon {
++
++ /**
++ * The resource name for this Icon.
++ *
++ * <p>
++ * The resource is a URL. The resource URL can be relative to the root of
++ * the bundle containing the Meta Type Resource.
++ *
++ * <p>
++ * If the resource begins with the percent sign ({@code '%'} \u0025),
++ * the resource can be {@link ObjectClassDefinition#localization()
++ * localized}.
++ *
++ * @see "The resource attribute of the Icon element of a Meta Type Resource."
++ */
++ String resource();
++
++ /**
++ * The pixel size of this Icon.
++ *
++ * <p>
++ * For example, 32 represents a 32x32 icon.
++ *
++ * @see "The size attribute of the Icon element of a Meta Type Resource."
++ */
++ int size();
++}
++
+--- /dev/null
++++ b/org/osgi/service/metatype/annotations/ObjectClassDefinition.java
+@@ -0,0 +1,156 @@
++/*
++ * Copyright (c) OSGi Alliance (2013, 2014). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.metatype.annotations;
++
++import java.lang.annotation.ElementType;
++import java.lang.annotation.Retention;
++import java.lang.annotation.RetentionPolicy;
++import java.lang.annotation.Target;
++
++/**
++ * Generate a Meta Type Resource using the annotated type.
++ *
++ * <p>
++ * This annotation can be used without defining any element values since
++ * defaults can be generated from the annotated type. Each method of the
++ * annotated type has an implied {@link AttributeDefinition} annotation if not
++ * explicitly annotated.
++ *
++ * <p>
++ * This annotation may only be used on annotation types and interface types. Use
++ * on concrete or abstract class types is unsupported. If applied to an
++ * interface then all methods inherited from super types are included as
++ * attributes.
++ *
++ * <p>
++ * This annotation is not processed at runtime. It must be processed by tools
++ * and used to generate a Meta Type Resource document for the bundle.
++ *
++ * @see "The OCD element of a Meta Type Resource."
++ * @author $Id: fa6a22c95ba6d3a19845177e3b8375c4064ded9a $
++ */
++ at Retention(RetentionPolicy.CLASS)
++ at Target(ElementType.TYPE)
++public @interface ObjectClassDefinition {
++ /**
++ * The id of this ObjectClassDefinition.
++ *
++ * <p>
++ * If not specified, the id of this ObjectClassDefinition is the fully
++ * qualified name of the annotated type using the dollar sign ({@code '$'}
++ * \u0024) to separate nested class names from the name of their
++ * enclosing class. The id is not to be confused with a PID which can be
++ * specified by the {@link #pid()} or {@link #factoryPid()} element.
++ *
++ * @see "The id attribute of the OCD element of a Meta Type Resource."
++ */
++ String id() default "";
++
++ /**
++ * The human readable name of this ObjectClassDefinition.
++ *
++ * <p>
++ * If not specified, the name of this ObjectClassDefinition is derived from
++ * the {@link #id()}. For example, low line ({@code '_'} \u005F) and
++ * dollar sign ({@code '$'} \u0024) are replaced with space ({@code ' '}
++ * \u0020) and space is inserted between camel case words.
++ *
++ * <p>
++ * If the name begins with the percent sign ({@code '%'} \u0025), the
++ * name can be {@link #localization() localized}.
++ *
++ * @see "The name attribute of the OCD element of a Meta Type Resource."
++ */
++ String name() default "";
++
++ /**
++ * The human readable description of this ObjectClassDefinition.
++ *
++ * <p>
++ * If not specified, the description of this ObjectClassDefinition is the
++ * empty string.
++ *
++ * <p>
++ * If the description begins with the percent sign ({@code '%'} \u0025),
++ * the description can be {@link #localization() localized}.
++ *
++ * @see "The description attribute of the OCD element of a Meta Type Resource."
++ */
++ String description() default "";
++
++ /**
++ * The localization resource of this ObjectClassDefinition.
++ *
++ * <p>
++ * This refers to a resource property entry in the bundle that can be
++ * augmented with locale information. If not specified, the localization
++ * resource for this ObjectClassDefinition is the string
++ * "OSGI-INF/l10n/" followed by the {@link #id()}.
++ *
++ * @see "The localization attribute of the MetaData element of a Meta Type Resource."
++ */
++ String localization() default "";
++
++ /**
++ * The PIDs associated with this ObjectClassDefinition.
++ *
++ * <p>
++ * For each specified PID, a {@code Designate} element with a pid attribute
++ * is generated that {@link #id() references} this ObjectClassDefinition.
++ *
++ * <p>
++ * The {@link Designate} annotation can also be used to associate a
++ * Declarative Services component with an ObjectClassDefinition and generate
++ * a {@code Designate} element.
++ *
++ * @see "The pid attribute of the Designate element of a Meta Type Resource."
++ * @see Designate
++ */
++ String[] pid() default {};
++
++ /**
++ * The factory PIDs associated with this ObjectClassDefinition.
++ *
++ * <p>
++ * For each specified factory PID, a {@code Designate} element with a
++ * factoryPid attribute is generated that {@link #id() references} this
++ * ObjectClassDefinition.
++ *
++ * <p>
++ * The {@link Designate} annotation can also be used to associate a
++ * Declarative Services component with an ObjectClassDefinition and generate
++ * a {@code Designate} element.
++ *
++ *
++ * @see "The factoryPid attribute of the Designate element of a Meta Type Resource."
++ * @see Designate
++ */
++ String[] factoryPid() default {};
++
++ /**
++ * The icon resources associated with this ObjectClassDefinition.
++ *
++ * <p>
++ * For each specified {@link Icon}, an {@code Icon} element is generated for
++ * this ObjectClassDefinition. If not specified, no {@code Icon} elements
++ * will be generated.
++ *
++ * @see "The Icon element of a Meta Type Resource."
++ */
++ Icon[] icon() default {};
++}
++
+--- /dev/null
++++ b/org/osgi/service/metatype/annotations/Option.java
+@@ -0,0 +1,54 @@
++/*
++ * Copyright (c) OSGi Alliance (2013). All Rights Reserved.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.osgi.service.metatype.annotations;
++
++import java.lang.annotation.Retention;
++import java.lang.annotation.RetentionPolicy;
++import java.lang.annotation.Target;
++
++/**
++ * {@code Option} information for an {@link AttributeDefinition}.
++ *
++ * @see AttributeDefinition#options()
++ * @author $Id: 62ba7da6da943cb1b3d124a36c9861277c93a740 $
++ */
++ at Retention(RetentionPolicy.CLASS)
++ at Target({})
++public @interface Option {
++
++ /**
++ * The human readable label of this Option.
++ *
++ * <p>
++ * If not specified, the label of this Option is the empty string.
++ *
++ * <p>
++ * If the label begins with the percent sign ({@code '%'} \u0025), the
++ * label can be {@link ObjectClassDefinition#localization() localized}.
++ *
++ * @see "The label attribute of the Option element of a Meta Type Resource."
++ */
++ String label() default "";
++
++ /**
++ * The value of this Option.
++ *
++ * @see "The value attribute of the Option element of a Meta Type Resource."
++ */
++ String value();
++}
++
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..973bb18
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+01-osgi6-features.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/osgi-compendium.git
More information about the pkg-java-commits
mailing list