David Jencks | bae4484 | 2014-06-21 20:15:24 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) OSGi Alliance (2013, 2014). All Rights Reserved. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.osgi.annotation.versioning; |
| 18 | |
| 19 | import java.lang.annotation.Documented; |
| 20 | import java.lang.annotation.ElementType; |
| 21 | import java.lang.annotation.Retention; |
| 22 | import java.lang.annotation.RetentionPolicy; |
| 23 | import java.lang.annotation.Target; |
| 24 | |
| 25 | /** |
| 26 | * A type implemented by the Provider Role. |
| 27 | * |
| 28 | * <p> |
| 29 | * A non-binary compatible change to a provider type normally requires |
| 30 | * incrementing the minor version of the type's package. This change will |
| 31 | * require all providers to be updated to handle the change, but consumers of |
| 32 | * that package will not require changes since they only use, and do not |
| 33 | * implement, the provider type. |
| 34 | * |
| 35 | * <p> |
| 36 | * A type can be marked {@link ConsumerType} or {@link ProviderType} but not |
| 37 | * both. A type is assumed to be {@link ConsumerType} if it is not marked either |
| 38 | * {@link ConsumerType} or {@link ProviderType}. |
| 39 | * |
| 40 | * <p> |
| 41 | * This annotation is not retained at runtime. It is for use by tools to |
| 42 | * understand the semantic version of a package. When a bundle implements a |
| 43 | * provider type from an imported package, then the bundle's import range for |
| 44 | * that package must require the package's exact major and minor version. |
| 45 | * |
| 46 | * @see <a href="http://www.osgi.org/wiki/uploads/Links/SemanticVersioning.pdf" |
| 47 | * >Semantic Versioning</a> |
| 48 | * @author $Id: 46ccfd7aa446f79451d090e0c23e257c3c5c3cf0 $ |
| 49 | */ |
| 50 | @Documented |
| 51 | @Retention(RetentionPolicy.CLASS) |
| 52 | @Target(ElementType.TYPE) |
| 53 | public @interface ProviderType { |
| 54 | // marker annotation |
| 55 | } |