| •1 |
package aQute.bnd.annotation.spi; |
| 2 |
|
| 3 |
import static aQute.bnd.annotation.Constants.EFFECTIVE_MACRO; |
| 4 |
import static aQute.bnd.annotation.Constants.RESOLUTION_MACRO; |
| 5 |
import static aQute.bnd.annotation.Constants.USES_MACRO; |
| 6 |
import static aQute.bnd.annotation.spi.Constants.ATTRIBUTE_MACRO; |
| 7 |
import static aQute.bnd.annotation.spi.Constants.REGISTER_MACRO; |
| 8 |
import static aQute.bnd.annotation.spi.Constants.SERVICELOADER_REGISTRAR; |
| 9 |
import static aQute.bnd.annotation.spi.Constants.SERVICELOADER_VERSION; |
| 10 |
import static aQute.bnd.annotation.spi.Constants.SERVICE_MACRO; |
| 11 |
import static aQute.bnd.annotation.spi.Constants.VALUE_MACRO; |
| 12 |
import static java.lang.annotation.ElementType.PACKAGE; |
| 13 |
import static java.lang.annotation.ElementType.TYPE; |
| 14 |
import static java.lang.annotation.RetentionPolicy.CLASS; |
| 15 |
import static org.osgi.namespace.extender.ExtenderNamespace.EXTENDER_NAMESPACE; |
| 16 |
import static org.osgi.namespace.service.ServiceNamespace.SERVICE_NAMESPACE; |
| 17 |
import static org.osgi.resource.Namespace.EFFECTIVE_ACTIVE; |
| 18 |
import static org.osgi.service.serviceloader.ServiceLoaderNamespace.SERVICELOADER_NAMESPACE; |
| 19 |
|
| 20 |
import java.lang.annotation.Repeatable; |
| 21 |
import java.lang.annotation.Retention; |
| 22 |
import java.lang.annotation.Target; |
| 23 |
|
| 24 |
import org.osgi.annotation.bundle.Capability; |
| 25 |
import org.osgi.annotation.bundle.Requirement; |
| 26 |
|
| 27 |
import aQute.bnd.annotation.Resolution; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
@Retention(CLASS) |
| 42 |
@Target({ |
| 43 |
PACKAGE, TYPE |
| 44 |
}) |
| 45 |
@Repeatable(ServiceProviders.class) |
| 46 |
@Capability(name = VALUE_MACRO, namespace = SERVICELOADER_NAMESPACE, attribute = { |
| 47 |
REGISTER_MACRO, USES_MACRO, ATTRIBUTE_MACRO |
| 48 |
}) |
| 49 |
@Capability(namespace = SERVICE_NAMESPACE, attribute = { |
| 50 |
SERVICE_MACRO, USES_MACRO, ATTRIBUTE_MACRO |
| 51 |
}, effective = EFFECTIVE_ACTIVE) |
| 52 |
@Requirement(name = SERVICELOADER_REGISTRAR, namespace = EXTENDER_NAMESPACE, version = SERVICELOADER_VERSION, attribute = { |
| 53 |
EFFECTIVE_MACRO, RESOLUTION_MACRO |
| 54 |
}) |
| 55 |
public @interface ServiceProvider { |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
Class<?> value(); |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
String effective() default ""; |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
Class<?>[] uses() default {}; |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
String[] attribute() default {}; |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
String resolution() default Resolution.DEFAULT; |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
Class<?> register() default Target.class; |
| 123 |
|
| 124 |
} |