diff options
author | Thomas Watson | 2015-01-26 19:36:16 +0000 |
---|---|---|
committer | Thomas Watson | 2015-01-26 19:36:16 +0000 |
commit | 1aea8dc45282dc32e96608c465c30761feb1d268 (patch) | |
tree | 325fdaa5e0d3445dc08c0e4636512c6ad235ee74 | |
parent | 8fd03ed980b8cecfacfd9f0d40dd5b46f16bf867 (diff) | |
download | rt.equinox.framework-1aea8dc45282dc32e96608c465c30761feb1d268.tar.gz rt.equinox.framework-1aea8dc45282dc32e96608c465c30761feb1d268.tar.xz rt.equinox.framework-1aea8dc45282dc32e96608c465c30761feb1d268.zip |
Update to the latest R6 API for cm, event, http and metatypeI20150127-0900I20150126-2000
22 files changed, 176 insertions, 153 deletions
diff --git a/bundles/org.eclipse.osgi.services/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.services/META-INF/MANIFEST.MF index 9a46b8bbd..64ec60b3e 100644 --- a/bundles/org.eclipse.osgi.services/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.osgi.services/META-INF/MANIFEST.MF @@ -12,14 +12,14 @@ Export-Package: org.osgi.service.cm; version="1.5", org.osgi.service.component; version="1.2.2", org.osgi.service.component.annotations; version="1.2", org.osgi.service.device; version="1.1", - org.osgi.service.event; version="1.3", + org.osgi.service.event; version="1.3.1", org.osgi.service.http;version="1.2.1", org.osgi.service.http.context;version="1.0", org.osgi.service.http.runtime;version="1.0", org.osgi.service.http.runtime.dto;version="1.0", org.osgi.service.http.whiteboard;version="1.0", org.osgi.service.log; version="1.3", - org.osgi.service.metatype; version="1.2", + org.osgi.service.metatype; version="1.3", org.osgi.service.provisioning; version="1.2", org.osgi.service.upnp; version="1.2", org.osgi.service.useradmin; version="1.1", @@ -27,17 +27,17 @@ Export-Package: org.osgi.service.cm; version="1.5", Import-Package: org.osgi.dto; version=1.0, org.osgi.framework; version=1.6, org.osgi.service.cm; version="[1.5, 1.6)", - org.osgi.service.component; version="[1.2.2, 1.3)", + org.osgi.service.component; version="[1.2, 1.3)", org.osgi.service.component.annotations; version="[1.2, 1.3)", org.osgi.service.device; version="[1.1, 1.2)", org.osgi.service.event; version="[1.3, 1.4)", - org.osgi.service.http; version="[1.2.1, 1.3)", + org.osgi.service.http; version="[1.2, 1.3)", org.osgi.service.log; version="[1.3, 1.4)", - org.osgi.service.metatype; version="[1.2, 1.3)", + org.osgi.service.metatype; version="[1.3, 1.4)", org.osgi.service.provisioning; version="[1.2, 1.3)", org.osgi.service.upnp; version="[1.2, 1.3)", org.osgi.service.useradmin; version="[1.1, 1.2)", - org.osgi.service.wireadmin; version="[1.0.1, 1.1)", + org.osgi.service.wireadmin; version="[1.0, 1.1)", javax.servlet; resolution:="optional", javax.servlet.http; resolution:="optional" DynamicImport-Package: javax.servlet, diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/Configuration.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/Configuration.java index 1bfb10729..b9057fdde 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/Configuration.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/Configuration.java @@ -72,6 +72,7 @@ import org.osgi.framework.Filter; * between these two the term "factory configuration" is used. * * @author $Id$ + * @ThreadSafe */ @ProviderType public interface Configuration { @@ -121,8 +122,8 @@ public interface Configuration { * callback is delayed until aforementioned registration occurs. * * <p> - * Also initiates an asynchronous call to all {@link ConfigurationListener}s - * with a {@link ConfigurationEvent#CM_UPDATED} event. + * Also notifies all Configuration Listeners with a + * {@link ConfigurationEvent#CM_UPDATED} event. * * @param properties the new set of properties for this configuration * @throws IOException if update cannot be made persistent @@ -144,8 +145,8 @@ public interface Configuration { * {@code deleted} method. * * <p> - * Also initiates an asynchronous call to all {@link ConfigurationListener}s - * with a {@link ConfigurationEvent#CM_DELETED} event. + * Also notifies all Configuration Listeners with a + * {@link ConfigurationEvent#CM_DELETED} event. * * @throws IOException If delete fails. * @throws IllegalStateException If this configuration has been deleted. @@ -201,8 +202,8 @@ public interface Configuration { * visible then they must be updated with this configuration. * * <p> - * Also initiates an asynchronous call to all {@link ConfigurationListener}s - * with a {@link ConfigurationEvent#CM_LOCATION_CHANGED} event. + * Also notifies all Configuration Listeners with a + * {@link ConfigurationEvent#CM_LOCATION_CHANGED} event. * * @param location a location, region, or {@code null} * @throws IllegalStateException If this configuration has been deleted. @@ -239,15 +240,14 @@ public interface Configuration { /** * Get the change count. * - * The Configuration must maintain a change counter that every time when - * this configuration is updated and its properties are stored is - * incremented with a positive value. The counter must be changed after the - * properties are persisted but before the targets are updated and events - * are sent out. - * - * @return A monotonously increasing value reflecting changes in this - * Configuration + * Each Configuration must maintain a change counter that is incremented + * with a positive value every time the configuration is updated and its + * properties are stored. The counter must be incremented before the targets + * are updated and events are sent out. * + * @return A monotonically increasing value reflecting changes in this + * Configuration. + * @throws IllegalStateException If this configuration has been deleted. * @since 1.5 */ public long getChangeCount(); diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationAdmin.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationAdmin.java index 3c2d838a0..ead1a221a 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationAdmin.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationAdmin.java @@ -116,6 +116,7 @@ import org.osgi.framework.InvalidSyntaxException; * {@link org.osgi.framework.ServiceFactory} to support this concept. * * @author $Id$ + * @ThreadSafe */ @ProviderType public interface ConfigurationAdmin { diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationEvent.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationEvent.java index b6e83bbc5..d0c13bb6c 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationEvent.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationEvent.java @@ -25,8 +25,7 @@ import org.osgi.framework.ServiceReference; * <p> * {@code ConfigurationEvent} objects are delivered to all registered * {@code ConfigurationListener} service objects. ConfigurationEvents must be - * asynchronously delivered in chronological order with respect to each - * listener. + * delivered in chronological order with respect to each listener. * * <p> * A type code is used to identify the type of event. The following event types diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationException.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationException.java index 373726d33..d4646fc2a 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationException.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationException.java @@ -81,6 +81,7 @@ public class ConfigurationException extends Exception { * @return The cause of this exception or {@code null} if no cause was set. * @since 1.2 */ + @Override public Throwable getCause() { return super.getCause(); } @@ -96,6 +97,7 @@ public class ConfigurationException extends Exception { * been set. * @since 1.2 */ + @Override public Throwable initCause(Throwable cause) { return super.initCause(cause); } diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationListener.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationListener.java index 7b228e523..ee8427b3d 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationListener.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationListener.java @@ -20,7 +20,7 @@ import org.osgi.annotation.versioning.ConsumerType; /** * Listener for Configuration Events. When a {@code ConfigurationEvent} is - * fired, it is asynchronously delivered to a {@code ConfigurationListener}. + * fired, it is asynchronously delivered to all {@code ConfigurationListener}s. * * <p> * {@code ConfigurationListener} objects are registered with the Framework @@ -39,6 +39,7 @@ import org.osgi.annotation.versioning.ConsumerType; * * @author $Id$ * @since 1.2 + * @ThreadSafe */ @ConsumerType public interface ConfigurationListener { diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationPlugin.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationPlugin.java index 97d5ee807..a3c11ec22 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationPlugin.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ConfigurationPlugin.java @@ -69,6 +69,7 @@ import org.osgi.framework.ServiceReference; * for all configuration updates. * * @author $Id$ + * @ThreadSafe */ @ConsumerType public interface ConfigurationPlugin { diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ManagedService.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ManagedService.java index a4905c472..69ba242e0 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ManagedService.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ManagedService.java @@ -108,6 +108,7 @@ import org.osgi.annotation.versioning.ConsumerType; * Configuration Permission to also be updated for other locations. * * @author $Id$ + * @ThreadSafe */ @ConsumerType public interface ManagedService { diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ManagedServiceFactory.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ManagedServiceFactory.java index e1d53892f..97807d23b 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ManagedServiceFactory.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/ManagedServiceFactory.java @@ -94,6 +94,7 @@ import org.osgi.annotation.versioning.ConsumerType; * </pre> * * @author $Id$ + * @ThreadSafe */ @ConsumerType public interface ManagedServiceFactory { diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/SynchronousConfigurationListener.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/SynchronousConfigurationListener.java index bcd2b68aa..6eb8494c3 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/SynchronousConfigurationListener.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/cm/SynchronousConfigurationListener.java @@ -20,8 +20,8 @@ import org.osgi.annotation.versioning.ConsumerType; /** * Synchronous Listener for Configuration Events. When a - * {@code ConfigurationEvent} is fired, it is synchronously delivered to a - * {@code SynchronousConfigurationListener}. + * {@code ConfigurationEvent} is fired, it is synchronously delivered to all + * {@code SynchronousConfigurationListener}s. * * <p> * {@code SynchronousConfigurationListener} objects are registered with the @@ -41,6 +41,7 @@ import org.osgi.annotation.versioning.ConsumerType; * * @author $Id$ * @since 1.5 + * @ThreadSafe */ @ConsumerType public interface SynchronousConfigurationListener extends ConfigurationListener { diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/Event.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/Event.java index 6fc64b4e9..fd99f3152 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/Event.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/Event.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2005, 2013). All Rights Reserved. + * Copyright (c) OSGi Alliance (2005, 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. @@ -52,6 +52,9 @@ public class Event { * @param topic The topic of the event. * @param properties The event's properties (may be {@code null}). A * property whose key is not of type {@code String} will be ignored. + * If the specified properties is an {@link EventProperties} object, + * then it will be directly used. Otherwise, a copy of the specified + * properties is made. * @throws IllegalArgumentException If topic is not a valid topic name. * @since 1.2 */ @@ -68,6 +71,7 @@ public class Event { * @param topic The topic of the event. * @param properties The event's properties (may be {@code null}). A * property whose key is not of type {@code String} will be ignored. + * A copy of the specified properties is made. * @throws IllegalArgumentException If topic is not a valid topic name. */ public Event(String topic, Dictionary<String, ?> properties) { @@ -189,7 +193,7 @@ public class Event { */ @Override public String toString() { - return getClass().getName() + " [topic=" + topic + "]"; + return getClass().getName() + " [topic=" + topic + "] " + properties.toString(); } /** diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/package-info.java index 7fe07b461..90332d68d 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/package-info.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2010, 2013). All Rights Reserved. + * Copyright (c) OSGi Alliance (2010, 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. @@ -35,7 +35,7 @@ * @author $Id$ */ -@Version("1.3") +@Version("1.3.1") package org.osgi.service.event; import org.osgi.annotation.versioning.Version; diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/packageinfo index 0117a56c1..6435862fd 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/packageinfo +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/packageinfo @@ -1 +1 @@ -version 1.3 +version 1.3.1 diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java index 56f11630c..a6d9e57fe 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java @@ -45,10 +45,11 @@ import org.osgi.framework.Bundle; * <p> * A context is registered with the * {@link org.osgi.service.http.whiteboard.HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH - * service property} to define a path under which all services registered with - * this context are reachable. If there is more than one - * {@code ServletContextHelper} registered with the same path, the one with the - * highest service ranking is active, the others are inactive. + * service property} to define a path under which all services registered with this context are + * reachable. If there is more than one {@code ServletContextHelper} registered with the same + * path, each duplicate context path is searched by service ranking order according to + * {@link org.osgi.framework.ServiceReference#compareTo(Object)} until a matching servlet or + * resource is found. * * <p> * Servlets, servlet filters, resources, and listeners services may be @@ -79,10 +80,10 @@ import org.osgi.framework.Bundle; * <li>{@code handleSecurity} - Performs implementation-defined authentication * on the request.</li> * <li>{@code getResource} - Assumes the named resource is in the bundle of the - * whiteboard service. This method calls the whiteboard service bundle's - * {@code Bundle.getEntry} method, and returns the appropriate URL to access the - * resource. On a Java runtime environment that supports permissions, the Http - * Whiteboard Implementation needs to be granted + * whiteboard service, addressed from the root. This method calls the whiteboard + * service bundle's {@code Bundle.getEntry} method, and returns the appropriate + * URL to access the resource. On a Java runtime environment that supports + * permissions, the Http Whiteboard Implementation needs to be granted * {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.</li> * <li>{@code getResourcePaths} - Assumes that the resources are in the bundle * of the whiteboard service. This method calls {@code Bundle.findEntries} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java index 42fee06d6..8f2496a1a 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java @@ -16,6 +16,10 @@ package org.osgi.service.http.whiteboard; +import org.osgi.framework.Filter; +import org.osgi.service.http.context.ServletContextHelper; +import org.osgi.service.http.runtime.HttpServiceRuntimeConstants; + /** * Defines standard constants for the whiteboard services. * @@ -27,25 +31,23 @@ public final class HttpWhiteboardConstants { } /** - * Service property specifying the name of an - * {@link org.osgi.service.http.context.ServletContextHelper} service. + * Service property specifying the name of an {@link ServletContextHelper} + * service. * * <p> - * For {@link org.osgi.service.http.context.ServletContextHelper} services, - * this service property must be specified. Context services without this - * service property are ignored. + * For {@link ServletContextHelper} services, this service property must be + * specified. Context services without this service property are ignored. * * <p> * Servlet, listener, servlet filter, and resource services might refer to a - * specific {@link org.osgi.service.http.context.ServletContextHelper} - * service referencing the name with the - * {@link #HTTP_WHITEBOARD_CONTEXT_SELECT} property. + * specific {@link ServletContextHelper} service referencing the name with + * the {@link #HTTP_WHITEBOARD_CONTEXT_SELECT} property. * * <p> - * For {@link org.osgi.service.http.context.ServletContextHelper} services, - * the value of this service property must be of type {@code String}. The - * value must follow the "symbolic-name" specification from Section 1.3.2 of - * the OSGi Core Specification. + * For {@link ServletContextHelper} services, the value of this service + * property must be of type {@code String}. The value must follow the + * "symbolic-name" specification from Section 1.3.2 of the OSGi Core + * Specification. * * @see #HTTP_WHITEBOARD_CONTEXT_PATH * @see #HTTP_WHITEBOARD_CONTEXT_SELECT @@ -54,23 +56,21 @@ public final class HttpWhiteboardConstants { public static final String HTTP_WHITEBOARD_CONTEXT_NAME = "osgi.http.whiteboard.context.name"; /** - * The name of the default - * {@link org.osgi.service.http.context.ServletContextHelper}. If a service - * is registered with this property, it is overriding the default context - * with a custom provided context. + * The name of the default {@link ServletContextHelper}. If a service is + * registered with this property, it is overriding the default context with + * a custom provided context. * * @see #HTTP_WHITEBOARD_CONTEXT_NAME */ public static final String HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME = "default"; /** - * Service property specifying the path of an - * {@link org.osgi.service.http.context.ServletContextHelper} service. + * Service property specifying the path of an {@link ServletContextHelper} + * service. * * <p> - * For {@link org.osgi.service.http.context.ServletContextHelper} services - * this service property is required. Context services without this service - * property are ignored. + * For {@link ServletContextHelper} services this service property is + * required. Context services without this service property are ignored. * * <p> * This property defines a context path under which all whiteboard services @@ -78,11 +78,11 @@ public final class HttpWhiteboardConstants { * with different paths allows to separate the URL space. * * <p> - * For {@link org.osgi.service.http.context.ServletContextHelper} services, - * the value of this service property must be of type {@code String}. The - * value is either a slash for the root or it must start with a slash but - * not end with a slash. Valid characters are defined in - * rfc3986#section-3.3. Contexts with an invalid path are ignored. + * For {@link ServletContextHelper} services, the value of this service + * property must be of type {@code String}. The value is either a slash for + * the root or it must start with a slash but not end with a slash. Valid + * characters are defined in rfc3986#section-3.3. Contexts with an invalid + * path are ignored. * * @see #HTTP_WHITEBOARD_CONTEXT_NAME * @see #HTTP_WHITEBOARD_CONTEXT_SELECT @@ -90,8 +90,7 @@ public final class HttpWhiteboardConstants { public static final String HTTP_WHITEBOARD_CONTEXT_PATH = "osgi.http.whiteboard.context.path"; /** - * Service property referencing a - * {@link org.osgi.service.http.context.ServletContextHelper} service. + * Service property referencing a {@link ServletContextHelper} service. * * <p> * For servlet, listener, servlet filter, or resource services, this service @@ -131,10 +130,9 @@ public final class HttpWhiteboardConstants { * * <p> * Servlet names must be unique among all servlet services associated with a - * single {@link org.osgi.service.http.context.ServletContextHelper}. If - * multiple servlet services associated with the same HttpContext have the - * same servlet name, then all but the highest ranked servlet service are - * ignored. + * single {@link ServletContextHelper}. If multiple servlet services + * associated with the same HttpContext have the same servlet name, then all + * but the highest ranked servlet service are ignored. * * <p> * The value of this service property must be of type {@code String}. @@ -202,8 +200,7 @@ public final class HttpWhiteboardConstants { * * <p> * Servlet filter names must be unique among all servlet filter services - * associated with a single - * {@link org.osgi.service.http.context.ServletContextHelper}. If multiple + * associated with a single {@link ServletContextHelper}. If multiple * servlet filter services associated with the same context have the same * servlet filter name, then all but the highest ranked servlet filter * service are ignored. @@ -393,7 +390,7 @@ public final class HttpWhiteboardConstants { * An Http Whiteboard Implementation can define any number of attributes * which can be referenced by the target filter. The attributes should * always include the - * {@link org.osgi.service.http.runtime.HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT_ATTRIBUTE + * {@link HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT_ATTRIBUTE * osgi.http.endpoint} attribute if the endpoint information is known. * * <p> @@ -402,7 +399,7 @@ public final class HttpWhiteboardConstants { * * <p> * The value of this service property must be of type {@code String} and be - * a valid {@link org.osgi.framework.Filter filter string}. + * a valid {@link Filter filter string}. */ public static final String HTTP_WHITEBOARD_TARGET = "osgi.http.whiteboard.target"; } diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/AttributeDefinition.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/AttributeDefinition.java index f2aa9ead0..33ebf7fd6 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/AttributeDefinition.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/AttributeDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2001, 2013). All Rights Reserved. + * Copyright (c) OSGi Alliance (2001, 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. @@ -16,6 +16,8 @@ package org.osgi.service.metatype; +import org.osgi.annotation.versioning.ConsumerType; + /** * An interface to describe an attribute. * @@ -26,109 +28,110 @@ package org.osgi.service.metatype; * @ThreadSafe * @author $Id$ */ +@ConsumerType public interface AttributeDefinition { /** - * The {@code STRING} (1) type. + * The {@code STRING} type. * * <p> * Attributes of this type should be stored as {@code String}, - * {@code Vector} with {@code String} or {@code String[]} objects, depending - * on the {@code getCardinality()} value. + * {@code List<String>} or {@code String[]} objects, depending on the + * {@link #getCardinality()} value. */ int STRING = 1; /** - * The {@code LONG} (2) type. + * The {@code LONG} type. * - * Attributes of this type should be stored as {@code Long}, {@code Vector} - * with {@code Long} or {@code long[]} objects, depending on the - * {@code getCardinality()} value. + * Attributes of this type should be stored as {@code Long}, + * {@code List<Long>} or {@code long[]} objects, depending on the + * {@link #getCardinality()} value. */ int LONG = 2; /** - * The {@code INTEGER} (3) type. + * The {@code INTEGER} type. * * Attributes of this type should be stored as {@code Integer}, - * {@code Vector} with {@code Integer} or {@code int[]} objects, depending - * on the {@code getCardinality()} value. + * {@code List<Integer>} or {@code int[]} objects, depending on the + * {@link #getCardinality()} value. */ int INTEGER = 3; /** - * The {@code SHORT} (4) type. + * The {@code SHORT} type. * - * Attributes of this type should be stored as {@code Short}, {@code Vector} - * with {@code Short} or {@code short[]} objects, depending on the - * {@code getCardinality()} value. + * Attributes of this type should be stored as {@code Short}, + * {@code List<Short>} or {@code short[]} objects, depending on the + * {@link #getCardinality()} value. */ int SHORT = 4; /** - * The {@code CHARACTER} (5) type. + * The {@code CHARACTER} type. * * Attributes of this type should be stored as {@code Character}, - * {@code Vector} with {@code Character} or {@code char[]} objects, - * depending on the {@code getCardinality()} value. + * {@code List<Character>} or {@code char[]} objects, depending on the + * {@link #getCardinality()} value. */ int CHARACTER = 5; /** - * The {@code BYTE} (6) type. + * The {@code BYTE} type. * - * Attributes of this type should be stored as {@code Byte}, {@code Vector} - * with {@code Byte} or {@code byte[]} objects, depending on the - * {@code getCardinality()} value. + * Attributes of this type should be stored as {@code Byte}, + * {@code List<Byte>} or {@code byte[]} objects, depending on the + * {@link #getCardinality()} value. */ int BYTE = 6; /** - * The {@code DOUBLE} (7) type. + * The {@code DOUBLE} type. * * Attributes of this type should be stored as {@code Double}, - * {@code Vector} with {@code Double} or {@code double[]} objects, depending - * on the {@code getCardinality()} value. + * {@code List<Double>} or {@code double[]} objects, depending on the + * {@link #getCardinality()} value. */ int DOUBLE = 7; /** - * The {@code FLOAT} (8) type. + * The {@code FLOAT} type. * - * Attributes of this type should be stored as {@code Float}, {@code Vector} - * with {@code Float} or {@code float[]} objects, depending on the - * {@code getCardinality()} value. + * Attributes of this type should be stored as {@code Float}, + * {@code List<Float>} or {@code float[]} objects, depending on the + * {@link #getCardinality()} value. */ int FLOAT = 8; /** - * The {@code BIGINTEGER} (9) type. + * The {@code BIGINTEGER} type. * * Attributes of this type should be stored as {@code BigInteger}, - * {@code Vector} with {@code BigInteger} or {@code BigInteger[]} objects, - * depending on the {@code getCardinality()} value. + * {@code List<BigInteger>} or {@code BigInteger[]} objects, depending on + * the {@link #getCardinality()} value. * * @deprecated As of 1.1. */ int BIGINTEGER = 9; /** - * The {@code BIGDECIMAL} (10) type. + * The {@code BIGDECIMAL} type. * * Attributes of this type should be stored as {@code BigDecimal}, - * {@code Vector} with {@code BigDecimal} or {@code BigDecimal[]} objects - * depending on {@code getCardinality()}. + * {@code List<BigDecimal>} or {@code BigDecimal[]} objects depending on + * {@link #getCardinality()}. * * @deprecated As of 1.1. */ int BIGDECIMAL = 10; /** - * The {@code BOOLEAN} (11) type. + * The {@code BOOLEAN} type. * * Attributes of this type should be stored as {@code Boolean}, - * {@code Vector} with {@code Boolean} or {@code boolean[]} objects - * depending on {@code getCardinality()}. + * {@code List<Boolean>} or {@code boolean[]} objects depending on + * {@link #getCardinality()}. */ int BOOLEAN = 11; /** - * The {@code PASSWORD} (12) type. + * The {@code PASSWORD} type. * - * Attributes of this type must be stored as {@code String}, {@code Vector} - * with {@code String} or {@code String[]} objects depending on {link - * getCardinality()}. A {@code PASSWORD} must be treated as a string but the - * type can be used to disguise the information when displayed to a user to - * prevent others from seeing it. + * Attributes of this type must be stored as {@code String}, + * {@code List<String>} or {@code String[]} objects depending on + * {@link #getCardinality()}. A {@code PASSWORD} must be treated as a string + * but the type can be used to disguise the information when displayed to a + * user to prevent others from seeing it. * * @since 1.2 */ @@ -144,18 +147,19 @@ public interface AttributeDefinition { /** * Unique identity for this attribute. * - * Attributes share a global namespace in the registry. E.g. an attribute - * {@code cn} or {@code commonName} must always be a {@code String} and the - * semantics are always a name of some object. They share this aspect with - * LDAP/X.500 attributes. In these standards the OSI Object Identifier (OID) - * is used to uniquely identify an attribute. If such an OID exists, (which - * can be requested at several standard organisations and many companies - * already have a node in the tree) it can be returned here. Otherwise, a - * unique id should be returned which can be a Java class name (reverse - * domain name) or generated with a GUID algorithm. Note that all LDAP - * defined attributes already have an OID. It is strongly advised to define - * the attributes from existing LDAP schemes which will give the OID. Many - * such schemes exist ranging from postal addresses to DHCP parameters. + * Attributes share a global namespace in the registry. For example, an + * attribute {@code cn} or {@code commonName} must always be a + * {@code String} and the semantics are always a name of some object. They + * share this aspect with LDAP/X.500 attributes. In these standards the OSI + * Object Identifier (OID) is used to uniquely identify an attribute. If + * such an OID exists, (which can be requested at several standard + * organisations and many companies already have a node in the tree) it can + * be returned here. Otherwise, a unique id should be returned which can be + * a Java class name (reverse domain name) or generated with a GUID + * algorithm. Note that all LDAP defined attributes already have an OID. It + * is strongly advised to define the attributes from existing LDAP schemes + * which will give the OID. Many such schemes exist ranging from postal + * addresses to DHCP parameters. * * @return The id or oid */ @@ -175,12 +179,12 @@ public interface AttributeDefinition { * Return the cardinality of this attribute. * * The OSGi environment handles multi valued attributes in arrays ([]) or in - * {@code Vector} objects. The return value is defined as follows: + * {@code List} objects. The return value is defined as follows: * * <pre> * - * x = Integer.MIN_VALUE no limit, but use Vector - * x < 0 -x = max occurrences, store in Vector + * x = Integer.MIN_VALUE no limit, but use List + * x < 0 -x = max occurrences, store in List * x > 0 x = max occurrences, store in array [] * x = Integer.MAX_VALUE no limit, but use array [] * x = 0 1 occurrence required @@ -196,8 +200,9 @@ public interface AttributeDefinition { * * <p> * Defined in the following constants which map to the appropriate Java - * type. {@code STRING},{@code LONG},{@code INTEGER}, {@code CHAR}, - * {@code BYTE},{@code DOUBLE},{@code FLOAT}, {@code BOOLEAN}. + * type. {@link #STRING},{@link #LONG},{@link #INTEGER}, {@link #SHORT}, + * {@link #CHARACTER}, {@link #BYTE},{@link #DOUBLE},{@link #FLOAT}, + * {@link #BOOLEAN}, {@link #PASSWORD}. * * @return The type for this attribute. */ @@ -216,8 +221,8 @@ public interface AttributeDefinition { * getType() for this attribute. * * <p> - * This list must be in the same sequence as {@code getOptionLabels()}. I.e. - * for each index i in {@code getOptionValues}, i in + * This list must be in the same sequence as {@code getOptionLabels()}. That + * is, for each index i in {@code getOptionValues}, i in * {@code getOptionLabels()} should be the label. * * <p> @@ -242,7 +247,7 @@ public interface AttributeDefinition { * available. * <p> * This list must be in the same sequence as the {@code getOptionValues()} - * method. I.e. for each index i in {@code getOptionLabels}, i in + * method. That is, for each index i in {@code getOptionLabels}, i in * {@code getOptionValues()} should be the associated value. * * <p> @@ -291,12 +296,12 @@ public interface AttributeDefinition { * The object must be of the appropriate type as defined by the cardinality * and {@code getType()}. The return type is a list of {@code String} * objects that can be converted to the appropriate type. The cardinality of - * the return array must follow the absolute cardinality of this type. E.g. - * if the cardinality = 0, the array must contain 1 element. If the + * the return array must follow the absolute cardinality of this type. For + * example, if the cardinality = 0, the array must contain 1 element. If the * cardinality is 1, it must contain 0 or 1 elements. If it is -5, it must * contain from 0 to max 5 elements. Note that the special case of a 0 - * cardinality, meaning a single value, does not allow arrays or vectors of - * 0 elements. + * cardinality, meaning a single value, does not allow arrays or lists of 0 + * elements. * * @return Return a default value or {@code null} if no default exists. */ diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeInformation.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeInformation.java index 5d7956910..009761611 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeInformation.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeInformation.java @@ -16,6 +16,7 @@ package org.osgi.service.metatype; +import org.osgi.annotation.versioning.ProviderType; import org.osgi.framework.Bundle; /** @@ -23,10 +24,10 @@ import org.osgi.framework.Bundle; * meta type information for a specific bundle. * * @ThreadSafe - * @noimplement * @author $Id$ * @since 1.1 */ +@ProviderType public interface MetaTypeInformation extends MetaTypeProvider { /** * Return the PIDs (for ManagedServices) for which ObjectClassDefinition diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeProvider.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeProvider.java index 44778640e..2812fb7a5 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeProvider.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeProvider.java @@ -16,6 +16,8 @@ package org.osgi.service.metatype; +import org.osgi.annotation.versioning.ConsumerType; + /** * Provides access to metatypes. This interface can be implemented on a Managed * Service or Managed Service Factory as well as registered as a service. When @@ -27,6 +29,7 @@ package org.osgi.service.metatype; * @ThreadSafe * @author $Id$ */ +@ConsumerType public interface MetaTypeProvider { /** diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java index e4733d8f8..ce3d84b6c 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java @@ -16,6 +16,7 @@ package org.osgi.service.metatype; +import org.osgi.annotation.versioning.ProviderType; import org.osgi.framework.Bundle; /** @@ -33,10 +34,10 @@ import org.osgi.framework.Bundle; * {@code MetaTypeProvider} objects. * * @ThreadSafe - * @noimplement * @author $Id$ * @since 1.1 */ +@ProviderType public interface MetaTypeService { /** * Return the MetaType information for the specified bundle. diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/ObjectClassDefinition.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/ObjectClassDefinition.java index f65f64dbc..263c105a1 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/ObjectClassDefinition.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/ObjectClassDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2001, 2013). All Rights Reserved. + * Copyright (c) OSGi Alliance (2001, 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. @@ -18,6 +18,7 @@ package org.osgi.service.metatype; import java.io.IOException; import java.io.InputStream; +import org.osgi.annotation.versioning.ConsumerType; /** * Description for the data type information of an objectclass. @@ -25,6 +26,7 @@ import java.io.InputStream; * @ThreadSafe * @author $Id$ */ +@ConsumerType public interface ObjectClassDefinition { /** * Argument for {@code getAttributeDefinitions(int)}. @@ -110,8 +112,8 @@ public interface ObjectClassDefinition { * <p> * The icon may depend on the localization. * - * @param size Requested size of an icon, e.g. a 16x16 pixels icon then size - * = 16 + * @param size Requested size of an icon. For example, a 16x16 pixel icon + * has a size of 16 * @return An InputStream representing an icon or {@code null} * @throws IOException If the {@code InputStream} cannot be returned. */ diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/package-info.java index 3be55f7d3..ca1a06007 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/package-info.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved. + * Copyright (c) OSGi Alliance (2010, 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. @@ -15,7 +15,7 @@ */ /** - * Metatype Package Version 1.2. + * Metatype Package Version 1.3. * * <p> * Bundles wishing to use this package must list the package in the @@ -26,15 +26,17 @@ * <p> * Example import for consumers using the API in this package: * <p> - * {@code Import-Package: org.osgi.service.metatype; version="[1.2,2.0)"} + * {@code Import-Package: org.osgi.service.metatype; version="[1.3,2.0)"} * <p> * Example import for providers implementing the API in this package: * <p> - * {@code Import-Package: org.osgi.service.metatype; version="[1.2,1.3)"} + * {@code Import-Package: org.osgi.service.metatype; version="[1.3,1.4)"} * - * @version 1.2 * @author $Id$ */ +@Version("1.3") package org.osgi.service.metatype; +import org.osgi.annotation.versioning.Version; + diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/packageinfo index ef7df68cb..0117a56c1 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/packageinfo +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/packageinfo @@ -1 +1 @@ -version 1.2 +version 1.3 |