summaryrefslogtreecommitdiffstats
path: root/annotations/src/main/java/com/yahoo/osgi
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /annotations/src/main/java/com/yahoo/osgi
Publish
Diffstat (limited to 'annotations/src/main/java/com/yahoo/osgi')
-rw-r--r--annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java23
-rw-r--r--annotations/src/main/java/com/yahoo/osgi/annotation/Version.java24
-rw-r--r--annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java3
3 files changed, 50 insertions, 0 deletions
diff --git a/annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java b/annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java
new file mode 100644
index 00000000000..f3bf17e29bd
--- /dev/null
+++ b/annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java
@@ -0,0 +1,23 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.osgi.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * For annotating packages that should be exported.
+ *
+ * Must be placed in a file called package-info.java in the
+ * package that is to be exported.
+ *
+ * @author tonytv
+ */
+@Retention(RetentionPolicy.CLASS)
+@Target(ElementType.PACKAGE)
+@Documented
+public @interface ExportPackage {
+ Version version() default @Version;
+}
diff --git a/annotations/src/main/java/com/yahoo/osgi/annotation/Version.java b/annotations/src/main/java/com/yahoo/osgi/annotation/Version.java
new file mode 100644
index 00000000000..69379780182
--- /dev/null
+++ b/annotations/src/main/java/com/yahoo/osgi/annotation/Version.java
@@ -0,0 +1,24 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.osgi.annotation;
+
+/**
+ * Version of an exported package
+ * The default version is 1.0.0
+ * @see <a href="http://www.osgi.org/javadoc/r4v43/org/osgi/framework/Version.html">Osgi version documentation</a>
+ * @author tonytv
+ */
+public @interface Version {
+
+ /** must be non-negative **/
+ int major() default 1;
+
+ /** must be non-negative **/
+ int minor() default 0;
+
+ /** must be non-negative **/
+ int micro() default 0;
+
+ /** must follow the format (alpha|digit|'_'|'-')+ **/
+ String qualifier() default "";
+
+}
diff --git a/annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java b/annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java
new file mode 100644
index 00000000000..5e84b29d8f3
--- /dev/null
+++ b/annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java
@@ -0,0 +1,3 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+@com.yahoo.api.annotations.PublicApi
+package com.yahoo.osgi.annotation;