Debian Codegraph @

src/aQute/bnd/annotation/ProviderType.java

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 package aQute.bnd.annotation;
2
3 import java.lang.annotation.Documented;
4 import java.lang.annotation.ElementType;
5 import java.lang.annotation.Retention;
6 import java.lang.annotation.RetentionPolicy;
7 import java.lang.annotation.Target;
8
9 /**
10 * <p>
11 * A change in a provider type (that is all except Consumer types) can be
12 * changed with only (at minimum) a minor update to the package API version
13 * number. This interface is similar to the Eclipse @noextend and @noimplement
14 * annotations. OSGi specifications use the @noimplement annotation, see below.
15 * </p>
16 * <h2>Elaborate and Simple Explanation</h2>
17 * <p>
18 * There is a distinction between "provider implemented" and "consumer
19 * implemented" interfaces, which is reflected in the {@link ProviderType} and
20 * {@link ConsumerType} annotations respectively.
21 * </p>
22 * <p>
23 * These annotations can be placed on an interface to enable the tooling to
24 * detect the role of the interface and generate the correct import range.
25 * </p>
26 * <p>
27 * Usually - to a developer - the role of the interface is clear: interfaces
28 * that are merely call-backs or listeners are generally "consumer implemented".
29 * </p>
30 * <h2>Thought Experiment with ConfigurationAdmin</h2>
31 * <p>
32 * In the case of the ConfigurationAdmin specification: implementing
33 * ManagedService or ManagedServiceFactory does not make you a provider. You
34 * would have to implement ConfigurationAdmin in order to be a provider.
35 * </p>
36 * <p>
37 * <b>Rule of thumb:</b> suppose a method would be added to
38 * ManagedServiceFactory. How many bundles would be broken as a result? The
39 * answer is "lots" and therefore ManagedServiceFactory is a consumer type.
40 * However, if a method would be added to ConfigurationAdmin then only a very
41 * small number of bundles would be broken; these are the providers of the
42 * ConfigurationAdmin API, e.g. org.apache.felix.configadmin and so on.
43 * </p>
44 * <h2>Relation to OSGi Specifications and Javadoc</h2>
45 * <p>
46 * At OSGi, the javadoc tag @noimplement is used to mark "provider implemented"
47 * interfaces. Interfaces not marked @noimplement are "consumer implemented"
48 * interfaces.
49 * </p>
50 * <p>
51 * So, for example, the ConfigurationAdmin interface is marked @noimplement
52 * while the ManagedService and ManagedServiceFactory interfaces are not.
53 * </p>
54 * <p>
55 * In the specification, you will see "No Implement Consumers of this API must
56 * not implement this interface" for @noimplement marked interfaces.
57 * </p>
58 * <p>
59 * In the html javadoc, you will see "Consumers of this API must not implement
60 * this interface" for @noimplement marked interfaces.
61 * </p>
62 * Deprecated because replaced by OSGi annotations
63 */
64 @Deprecated(forRemoval = true, since = "7.0.0")
65 @Documented
66 @Retention(RetentionPolicy.CLASS)
67 @Target(ElementType.TYPE)
68 public @interface ProviderType {
69
70 }