Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pderop committed Aug 26, 2016
0 parents commit f1590bf
Show file tree
Hide file tree
Showing 118 changed files with 1,525 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This project is used to reproduce the issue reported at https://issues.apache.org/jira/browse/FELIX-5337.

Basically, two versions of the same service are registered in the osgi registry:

service.Service (version v1)
service.Service (version v2)

now, a catchall.withapi bundle tries to lookup all services, using filter "(objectClass=*)": this works.
but the catchall.withannotation bundle is not able to lookup all services, using @ServiceDependency(filter"=(objectClass=*).
38 changes: 38 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Master Gradle build script
*
* Depends on bndPlugin property set by settings.gradle.
* and bnd_* values from gradle.properties.
*/

import aQute.bnd.build.Workspace
import aQute.bnd.osgi.Constants

/* Add bnd gradle plugin as a script dependency */
buildscript {
dependencies {
classpath bndPlugin
}
}

/* Initialize the bnd workspace */
Workspace.setDriver(Constants.BNDDRIVER_GRADLE)
Workspace.addGestalt(Constants.GESTALT_BATCH, null)
ext.bndWorkspace = new Workspace(rootDir, bnd_cnf)
if (bndWorkspace == null) {
throw new GradleException("Unable to load workspace ${rootDir}/${bnd_cnf}")
}

ext.cnf = rootProject.project(bnd_cnf)

/* Configure the subprojects */
subprojects {
def bndProject = bndWorkspace.getProject(name)
if (bndProject != null) {
plugins.apply 'biz.aQute.bnd'
}
}

task wrapper(type: Wrapper) {
jarFile = rootProject.file('.gradle-wrapper/gradle-wrapper.jar')
}
8 changes: 8 additions & 0 deletions catchall.withannotation/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin" path="src"/>
<classpathentry kind="src" output="bin_test" path="test"/>
<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="output" path="bin"/>
</classpath>
23 changes: 23 additions & 0 deletions catchall.withannotation/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>catchall.withannotation</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<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>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/catchall/withannotation/CatchAll.java=UTF-8
encoding//test/catchall/withannotation/ExampleTest.java=UTF-8
encoding/bnd.bnd=UTF-8
encoding/launch.bndrun=UTF-8
11 changes: 11 additions & 0 deletions catchall.withannotation/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
1 change: 1 addition & 0 deletions catchall.withannotation/bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/catchall/
1 change: 1 addition & 0 deletions catchall.withannotation/bin_test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/catchall/
15 changes: 15 additions & 0 deletions catchall.withannotation/bnd.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-buildpath: \
osgi.annotation;version=6.0.1,\
osgi.core;version=6.0,\
osgi.cmpn;version=6.0,\
org.apache.felix.dependencymanager.annotation;version=4.1

-testpath: \
${junit}

javac.source: 1.8
javac.target: 1.8

Bundle-Version: 0.0.0.${tstamp}
Private-Package: catchall.withannotation
-plugin: org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin
3 changes: 3 additions & 0 deletions catchall.withannotation/generated/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.index
/buildfiles
/catchall.withannotation.jar
1 change: 1 addition & 0 deletions catchall.withannotation/generated/fw/bundle0/bundle.id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle1/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1
reference:file:/home/nxuser/Download/tmp/dm.felix5337/catchall.withannotation/generated/catchall.withannotation.jar
8
1
1472250914344
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/Download/tmp/dm.felix5337/catchall.withannotation/generated/catchall.withannotation.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle10/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
10
reference:file:/home/nxuser/Download/tmp/dm.felix5337/service.v1/generated/service.v1.jar
8
1
1472250914375
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/Download/tmp/dm.felix5337/service.v1/generated/service.v1.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle11/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
11
reference:file:/home/nxuser/Download/tmp/dm.felix5337/service.v2/generated/service.v2.jar
8
1
1472250914377
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/Download/tmp/dm.felix5337/service.v2/generated/service.v2.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle2/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
2
reference:file:/home/nxuser/.bnd/shacache/shas/21A5FFD5F2598A77BF81C6306A3CAB63A5786C04/org.apache.felix.configadmin-1.8.8.jar
8
1
1472250914351
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/.bnd/shacache/shas/21A5FFD5F2598A77BF81C6306A3CAB63A5786C04/org.apache.felix.configadmin-1.8.8.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle3/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
3
reference:file:/home/nxuser/Download/tmp/dm.felix5337/cnf/local/org.apache.felix.dependencymanager/org.apache.felix.dependencymanager-4.3.0.jar
8
1
1472250914355
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/Download/tmp/dm.felix5337/cnf/local/org.apache.felix.dependencymanager/org.apache.felix.dependencymanager-4.3.0.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle4/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
4
reference:file:/home/nxuser/Download/tmp/dm.felix5337/cnf/local/org.apache.felix.dependencymanager.runtime/org.apache.felix.dependencymanager.runtime-4.0.3.jar
8
1
1472250914358
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/Download/tmp/dm.felix5337/cnf/local/org.apache.felix.dependencymanager.runtime/org.apache.felix.dependencymanager.runtime-4.0.3.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle5/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
reference:file:/home/nxuser/Download/tmp/dm.felix5337/cnf/local/org.apache.felix.dependencymanager.shell/org.apache.felix.dependencymanager.shell-4.0.4.jar
8
1
1472250914360
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/Download/tmp/dm.felix5337/cnf/local/org.apache.felix.dependencymanager.shell/org.apache.felix.dependencymanager.shell-4.0.4.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle6/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
6
reference:file:/home/nxuser/.bnd/shacache/shas/3E9A0E1A5A31D00D2FEB164A2DE3B10CF8063E68/org.apache.felix.gogo.command-0.16.0.jar
8
1
1472250914365
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/.bnd/shacache/shas/3E9A0E1A5A31D00D2FEB164A2DE3B10CF8063E68/org.apache.felix.gogo.command-0.16.0.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle7/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
7
reference:file:/home/nxuser/.bnd/shacache/shas/729FA8EACCF8D39AB5C9D0AA72A81A71A51EEC32/org.apache.felix.gogo.runtime-0.16.2.jar
8
1
1472250914368
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/.bnd/shacache/shas/729FA8EACCF8D39AB5C9D0AA72A81A71A51EEC32/org.apache.felix.gogo.runtime-0.16.2.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle8/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
8
reference:file:/home/nxuser/.bnd/shacache/shas/22C48992149AC6E41D2F8F646C0441E057BB4BCC/org.apache.felix.gogo.shell-0.12.0.jar
8
1
1472250914371
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/.bnd/shacache/shas/22C48992149AC6E41D2F8F646C0441E057BB4BCC/org.apache.felix.gogo.shell-0.12.0.jar
6 changes: 6 additions & 0 deletions catchall.withannotation/generated/fw/bundle9/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
9
reference:file:/home/nxuser/.bnd/shacache/shas/E98972F46B0EBF8BE4A10F9C10F0471528DB54D1/org.apache.felix.metatype-1.1.2.jar
8
1
1472250914373
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/.bnd/shacache/shas/E98972F46B0EBF8BE4A10F9C10F0471528DB54D1/org.apache.felix.metatype-1.1.2.jar
Empty file.
30 changes: 30 additions & 0 deletions catchall.withannotation/launch.bndrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#-runfw: org.apache.felix.framework;version=5
#-runee: JavaSE-1.7

-runsystemcapabilities: ${native_capability}

-resolve.effective: active;skip:="osgi.service"

-runbundles: \
catchall.withannotation;version=snapshot,\
org.apache.felix.configadmin;version='[1.8.8,1.8.9)',\
org.apache.felix.dependencymanager;version='[4.3.0,4.3.1)',\
org.apache.felix.dependencymanager.runtime;version='[4.0.3,4.0.4)',\
org.apache.felix.dependencymanager.shell;version='[4.0.4,4.0.5)',\
org.apache.felix.gogo.command;version='[0.16.0,0.16.1)',\
org.apache.felix.gogo.runtime;version='[0.16.2,0.16.3)',\
org.apache.felix.gogo.shell;version='[0.12.0,0.12.1)',\
org.apache.felix.metatype;version='[1.1.2,1.1.3)',\
service.v1;version=snapshot,\
service.v2;version=snapshot

-runrequires: \
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\
osgi.identity;filter:='(osgi.identity=service.v1)',\
osgi.identity;filter:='(osgi.identity=service.v2)',\
osgi.identity;filter:='(osgi.identity=catchall.withannotation)',\
osgi.identity;filter:='(&(osgi.identity=org.apache.felix.dependencymanager.runtime)(version>=4.0.3))',\
osgi.identity;filter:='(&(osgi.identity=org.apache.felix.dependencymanager.shell)(version>=4.0.4))'
-runfw: org.apache.felix.framework;version='[5.4.0,5.4.0]'
-runee: JavaSE-1.8
16 changes: 16 additions & 0 deletions catchall.withannotation/src/catchall/withannotation/CatchAll.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package catchall.withannotation;

import java.util.Map;

import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;

@Component
public class CatchAll {

@ServiceDependency(filter="(objectClass=*)", required = false)
void addService(Object service, Map<String, String> properties) {
System.out.println("Got service " + service + " with properties: " + properties);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package catchall.withannotation;

import static org.junit.Assert.*;

import org.junit.Test;

public class ExampleTest {

@Test
public void test() {
fail("Not yet implemented");
}

}
8 changes: 8 additions & 0 deletions catchall.withapi/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin" path="src"/>
<classpathentry kind="src" output="bin_test" path="test"/>
<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="output" path="bin"/>
</classpath>
23 changes: 23 additions & 0 deletions catchall.withapi/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>catchall.withapi</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<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>
</natures>
</projectDescription>
5 changes: 5 additions & 0 deletions catchall.withapi/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/catchall/withapi/Activator.java=UTF-8
encoding//test/catchall/withapi/ExampleTest.java=UTF-8
encoding/bnd.bnd=UTF-8
encoding/launch.bndrun=UTF-8
11 changes: 11 additions & 0 deletions catchall.withapi/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
1 change: 1 addition & 0 deletions catchall.withapi/bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/catchall/
1 change: 1 addition & 0 deletions catchall.withapi/bin_test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/catchall/
15 changes: 15 additions & 0 deletions catchall.withapi/bnd.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-buildpath: \
osgi.annotation;version=6.0.1,\
osgi.core;version=6.0,\
osgi.cmpn;version=6.0,\
org.apache.felix.dependencymanager

-testpath: \
${junit}

javac.source: 1.8
javac.target: 1.8

Bundle-Version: 0.0.0.${tstamp}
Private-Package: catchall.withapi
Bundle-Activator: catchall.withapi.Activator
3 changes: 3 additions & 0 deletions catchall.withapi/generated/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.index
/buildfiles
/catchall.withapi.jar
1 change: 1 addition & 0 deletions catchall.withapi/generated/fw/bundle0/bundle.id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
6 changes: 6 additions & 0 deletions catchall.withapi/generated/fw/bundle1/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1
reference:file:/home/nxuser/Download/tmp/dm.felix5337/catchall.withapi/generated/catchall.withapi.jar
8
1
1472250899421
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/Download/tmp/dm.felix5337/catchall.withapi/generated/catchall.withapi.jar
6 changes: 6 additions & 0 deletions catchall.withapi/generated/fw/bundle10/bundle.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
10
reference:file:/home/nxuser/Download/tmp/dm.felix5337/service.v2/generated/service.v2.jar
8
1
1472250899463
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference:file:/home/nxuser/Download/tmp/dm.felix5337/service.v2/generated/service.v2.jar
Loading

0 comments on commit f1590bf

Please sign in to comment.