-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The service needs to be immediate
- Loading branch information
Showing
22 changed files
with
280 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?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/test-classes" path="src/test/java"> | ||
<attributes> | ||
<attribute name="test" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>biz.aQute.aggregate.test</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
5
biz.aQute.aggregate.test/.settings/org.eclipse.core.resources.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
eclipse.preferences.version=1 | ||
encoding/.classpath=UTF-8 | ||
encoding//src/test/java/biz/aQute/aggregate/test/AggregateTest.java=UTF-8 | ||
encoding/<project>=UTF-8 | ||
encoding/bnd.bnd=UTF-8 |
12 changes: 12 additions & 0 deletions
12
biz.aQute.aggregate.test/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
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.release=enabled | ||
org.eclipse.jdt.core.compiler.source=1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-includepackage: biz.aQute.aggregate.test.b1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-includepackage: biz.aQute.aggregate.test.b2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-includepackage: biz.aQute.aggregate.test.b3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# biz.aQute.aggregate.test PROVIDER BUNDLE | ||
# | ||
|
||
-buildpath: \ | ||
osgi.annotation,\ | ||
org.osgi.service.component.annotations,\ | ||
org.osgi.framework,\ | ||
org.osgi.resource,\ | ||
slf4j.api,\ | ||
biz.aQute.api.aggregate,\ | ||
biz.aQute.osgi.diverse.util;version=snapshot | ||
|
||
-testpath: \ | ||
biz.aQute.wrapper.junit,\ | ||
biz.aQute.wrapper.hamcrest,\ | ||
org.assertj.core,\ | ||
biz.aQute.launchpad,\ | ||
org.osgi.util.tracker,\ | ||
org.osgi.dto,\ | ||
org.awaitility,\ | ||
slf4j.simple | ||
|
||
-sub: *.bnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-includepackage: biz.aQute.aggregate.test |
5 changes: 5 additions & 0 deletions
5
biz.aQute.aggregate.test/src/main/java/biz/aQute/aggregate/test/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package biz.aQute.aggregate.test; | ||
|
||
public interface Foo { | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
biz.aQute.aggregate.test/src/main/java/biz/aQute/aggregate/test/Server.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package biz.aQute.aggregate.test; | ||
|
||
import org.osgi.service.component.annotations.Activate; | ||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Deactivate; | ||
import org.osgi.service.component.annotations.Reference; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import biz.aQute.aggregate.api.Aggregate; | ||
import biz.aQute.osgi.service.util.ObjectClass; | ||
|
||
@Component | ||
public class Server { | ||
Logger logger = LoggerFactory.getLogger(Server.class); | ||
|
||
@Activate | ||
public Server() { | ||
logger.info("activated {}", guard.getServices()); | ||
} | ||
|
||
@Deactivate | ||
public void deactivate() { | ||
logger.info("deactivated {}", guard.getServices()); | ||
} | ||
|
||
@ObjectClass | ||
interface AgFoo extends Aggregate<Foo> { | ||
} | ||
|
||
@Reference | ||
AgFoo guard; | ||
} |
10 changes: 10 additions & 0 deletions
10
biz.aQute.aggregate.test/src/main/java/biz/aQute/aggregate/test/b1/B1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package biz.aQute.aggregate.test.b1; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
|
||
import biz.aQute.aggregate.test.Foo; | ||
|
||
@Component(immediate=true) | ||
public class B1 implements Foo { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
biz.aQute.aggregate.test/src/main/java/biz/aQute/aggregate/test/b2/B3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package biz.aQute.aggregate.test.b2; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
|
||
import biz.aQute.aggregate.test.Foo; | ||
|
||
@Component(immediate=true) | ||
public class B3 implements Foo { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
biz.aQute.aggregate.test/src/main/java/biz/aQute/aggregate/test/b3/B2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package biz.aQute.aggregate.test.b3; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
|
||
import biz.aQute.aggregate.test.Foo; | ||
|
||
@Component(immediate=true) | ||
public class B2 implements Foo { | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
biz.aQute.aggregate.test/src/main/java/biz/aQute/aggregate/test/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@org.osgi.annotation.bundle.Export | ||
@Version("1.0.0") | ||
package biz.aQute.aggregate.test; | ||
|
||
import org.osgi.annotation.versioning.Version; | ||
|
||
/** | ||
* An API to do thread based stuff | ||
*/ |
34 changes: 34 additions & 0 deletions
34
biz.aQute.aggregate.test/src/test/java/biz/aQute/aggregate/test/AggregateTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package biz.aQute.aggregate.test; | ||
|
||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import org.osgi.framework.Constants; | ||
|
||
import aQute.launchpad.Launchpad; | ||
import aQute.launchpad.LaunchpadBuilder; | ||
import biz.aQute.aggregate.api.Aggregate; | ||
|
||
public class AggregateTest { | ||
static { | ||
System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "debug"); | ||
} | ||
|
||
static LaunchpadBuilder builder = new LaunchpadBuilder().nostart() | ||
.bndrun("test.bndrun") | ||
.set(Constants.FRAMEWORK_BEGINNING_STARTLEVEL, "2"); | ||
|
||
interface T1Agg extends Aggregate<String> {} | ||
|
||
|
||
@Ignore | ||
@Test | ||
public void simple() throws Exception { | ||
try (Launchpad lp = builder.create()) { | ||
lp.start(); | ||
|
||
System.out.println(); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
-runpath: slf4j.simple, slf4j.api | ||
-resolve: cache | ||
-runfw: org.apache.felix.framework;version='[6.0.2,6.0.2]' | ||
-runee: JavaSE-1.8 | ||
-runrequires: \ | ||
osgi.identity;filter:='(osgi.identity=org.apache.felix.scr)',\ | ||
osgi.identity;filter:='(osgi.identity=org.apache.felix.webconsole.plugins.scriptconsole)',\ | ||
osgi.identity;filter:='(osgi.identity=org.apache.felix.log)',\ | ||
osgi.identity;filter:='(osgi.identity=biz.aQute.aggregate.provider)',\ | ||
osgi.identity;filter:='(osgi.identity=biz.aQute.aggregate.test.b1)',\ | ||
osgi.identity;filter:='(osgi.identity=biz.aQute.aggregate.test.b2)',\ | ||
osgi.identity;filter:='(osgi.identity=biz.aQute.aggregate.test.b3)',\ | ||
osgi.identity;filter:='(osgi.identity=biz.aQute.aggregate.test.main)',\ | ||
osgi.identity;filter:='(osgi.identity=biz.aQute.gogo.commands.provider)' | ||
-runbundles: \ | ||
org.apache.commons.fileupload;version='[1.3.2,1.3.3)',\ | ||
org.apache.commons.io;version='[2.5.0,2.5.1)',\ | ||
org.apache.felix.configadmin;version='[1.9.12,1.9.13)',\ | ||
org.apache.felix.gogo.command;version='[1.1.0,1.1.1)',\ | ||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\ | ||
org.apache.felix.log;version='[1.2.4,1.2.5)',\ | ||
org.apache.felix.scr;version='[2.1.30,2.1.31)',\ | ||
org.apache.felix.webconsole;version='[4.3.8,4.3.9)',\ | ||
org.apache.felix.webconsole.plugins.scriptconsole;version='[1.0.2,1.0.3)',\ | ||
org.json;version='[1.0.0,1.0.1)',\ | ||
org.osgi.service.http;version='[1.2.1,1.2.2)',\ | ||
org.osgi.util.function;version='[1.1.0,1.1.1)',\ | ||
org.osgi.util.promise;version='[1.1.1,1.1.2)',\ | ||
biz.aQute.aggregate.provider;version=snapshot,\ | ||
biz.aQute.aggregate.test.b1;version=snapshot,\ | ||
biz.aQute.aggregate.test.b2;version=snapshot,\ | ||
biz.aQute.aggregate.test.b3;version=snapshot,\ | ||
biz.aQute.aggregate.test.main;version=snapshot,\ | ||
biz.aQute.api.aggregate;version=snapshot,\ | ||
biz.aQute.osgi.diverse.util;version=snapshot,\ | ||
org.apache.felix.gogo.runtime;version='[1.1.2,1.1.3)',\ | ||
org.apache.felix.gogo.shell;version='[1.1.2,1.1.3)' |
21 changes: 21 additions & 0 deletions
21
...ute.osgi.diverse.util/src/main/java/biz/aQute/osgi/service/util/AddServiceCapability.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package biz.aQute.osgi.service.util; | ||
|
||
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.Attribute; | ||
import org.osgi.annotation.bundle.Capability; | ||
|
||
/** | ||
* Add a service capability to the bundle | ||
* | ||
*/ | ||
@Capability(namespace = "osgi.service", effective = "active") | ||
@Retention(RetentionPolicy.CLASS) | ||
@Target(ElementType.TYPE) | ||
public @interface AddServiceCapability { | ||
@Attribute("objectClass") | ||
Class<?>[] value(); | ||
} |
17 changes: 17 additions & 0 deletions
17
biz.aQute.osgi.diverse.util/src/main/java/biz/aQute/osgi/service/util/ObjectClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package biz.aQute.osgi.service.util; | ||
|
||
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; | ||
|
||
/** | ||
* Add the marked type as a service capability | ||
* | ||
*/ | ||
@Capability(namespace = "osgi.service", effective = "active", attribute = "objectClass=${@class}") | ||
@Retention(RetentionPolicy.CLASS) | ||
@Target(ElementType.TYPE) | ||
public @interface ObjectClass {} |
9 changes: 9 additions & 0 deletions
9
biz.aQute.osgi.diverse.util/src/main/java/biz/aQute/osgi/service/util/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@org.osgi.annotation.bundle.Export | ||
@Version("1.0.0") | ||
package biz.aQute.osgi.service.util; | ||
|
||
import org.osgi.annotation.versioning.Version; | ||
|
||
/** | ||
* An API to do thread based stuff | ||
*/ |