Skip to content

Commit

Permalink
Python foreign provider
Browse files Browse the repository at this point in the history
  • Loading branch information
pkriens committed Jul 14, 2021
1 parent 61f7e3d commit 81378f3
Show file tree
Hide file tree
Showing 35 changed files with 1,567 additions and 1 deletion.
3 changes: 2 additions & 1 deletion biz.aQute.api/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
org.osgi.annotation.bundle,\
org.osgi.dto,\
org.apache.felix.http.servlet-api,\
org.osgi.service.component.annotations
org.osgi.service.component.annotations,\
org.osgi.namespace.extender

-sub: *.bnd
1 change: 1 addition & 0 deletions biz.aQute.api/kpi.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-includepackage: biz.aQute.kpi.api
1 change: 1 addition & 0 deletions biz.aQute.api/python.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-includepackage: biz.aQute.foreign.python.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package biz.aQute.foreign.python.api;

public interface ForeignPythonConstants {
String EXTENDER_NAME = "biz.aQute.foreign.python";
String VERSION = "1.0.0";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package biz.aQute.foreign.python.api;

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;

import org.osgi.annotation.bundle.Capability;
import org.osgi.namespace.extender.ExtenderNamespace;

@Documented
@Retention(RetentionPolicy.CLASS)
@Target({
ElementType.TYPE, ElementType.PACKAGE
})
@Capability(namespace = ExtenderNamespace.EXTENDER_NAMESPACE, name=ForeignPythonConstants.EXTENDER_NAME, version=ForeignPythonConstants.VERSION)
public @interface ProvideForeignPython {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package biz.aQute.foreign.python.api;

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;

import org.osgi.annotation.bundle.Requirement;
import org.osgi.namespace.extender.ExtenderNamespace;

@Documented
@Retention(RetentionPolicy.CLASS)
@Target({
ElementType.TYPE, ElementType.PACKAGE
})
@Requirement(namespace = ExtenderNamespace.EXTENDER_NAMESPACE, name = ForeignPythonConstants.EXTENDER_NAME, version=ForeignPythonConstants.VERSION)
public @interface RequireForeignPython {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@Version("1.0.0")
@org.osgi.annotation.bundle.Export
package biz.aQute.foreign.python.api;

import org.osgi.annotation.versioning.Version;
25 changes: 25 additions & 0 deletions biz.aQute.api/src/main/java/biz/aQute/kpi/api/KPI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package biz.aQute.kpi.api;

import org.osgi.dto.DTO;

/**
* A Key Performance Indicator (KPI) is a set of values representing the ongoing state of a service implementation.
* <p>
* A service implementation can define a Data Transfer Object (DTO) that contains its measurements. This services
* van ask for a snapshot of this value. The caller then owns the returned object. The DTO can also be reset.
*
*/
public interface KPI {

/**
* Reset any counters and time based values
*/
void reset();

/**
* Return a snapshot
*
* @return a snapshot of the KPI values
*/
DTO snapshot();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@org.osgi.annotation.bundle.Export
@Version("1.0.0")
package biz.aQute.kpi.api;

import org.osgi.annotation.versioning.Version;
9 changes: 9 additions & 0 deletions biz.aQute.foreign.python.provider/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="output" path="bin"/>
</classpath>
29 changes: 29 additions & 0 deletions biz.aQute.foreign.python.provider/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>biz.aQute.foreign.python.provider</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>bndtools.core.bndbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>bndtools.core.bndnature</nature>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
5 changes: 5 additions & 0 deletions biz.aQute.foreign.python.provider/.pydevproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python interpreter</pydev_property>
</pydev_project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
line.separator=\n
Loading

0 comments on commit 81378f3

Please sign in to comment.