Skip to content
Browse files

add feature subsystem

  • Loading branch information...
1 parent 23c10ad commit e23dbc7dcee80a5cf28b59a6977a4113b2271a5b Glyn Normington committed Oct 18, 2012
View
1 .gitignore
@@ -1,3 +1,4 @@
work
serviceability
+stage
View
3 hello.application.esa/OSGI-INF/SUBSYSTEM.MF
@@ -0,0 +1,3 @@
+Subsystem-SymbolicName: hello.application.subsystem
+Subsystem-Type: osgi.subsystem.application
+Subsystem-Content: hello
View
BIN hello.application.esa/hello.jar
Binary file not shown.
View
BIN hello.driver.jar
Binary file not shown.
View
BIN hello.driver/bin/demo/driver/HelloDriver.class
Binary file not shown.
View
24 hello.driver/src/demo/driver/HelloDriver.java
@@ -14,21 +14,33 @@
private Subsystem rootSubsystem;
- private Subsystem helloSubsystem;
+ private Subsystem helloApplicationSubsystem;
+
+ private Subsystem helloFeatureSubsystem;
@Override
public void start(BundleContext bc) throws Exception {
this.sr = bc.getServiceReference(Subsystem.class);
this.rootSubsystem = bc.getService(this.sr);
- this.helloSubsystem = this.rootSubsystem.install(new File("hello.esa").toURI().toString());
- this.helloSubsystem.start();
+ this.helloApplicationSubsystem = deploySubsystem("hello.application.esa");
+ this.helloFeatureSubsystem = deploySubsystem("hello.feature.esa");
+ }
+
+ private Subsystem deploySubsystem(String subsystemDirectoryName) {
+ Subsystem helloSubsystem = this.rootSubsystem.install(new File(subsystemDirectoryName).toURI().toString());
+ helloSubsystem.start();
+ return helloSubsystem;
}
@Override
public void stop(BundleContext bc) throws Exception {
- if (this.helloSubsystem != null) {
- this.helloSubsystem.stop();
- this.helloSubsystem = null;
+ if (this.helloApplicationSubsystem != null) {
+ this.helloApplicationSubsystem.uninstall();
+ this.helloApplicationSubsystem = null;
+ }
+ if (this.helloFeatureSubsystem != null) {
+ this.helloFeatureSubsystem.uninstall();
+ this.helloFeatureSubsystem = null;
}
if (this.sr != null) {
bc.ungetService(this.sr);
View
3 hello.feature.esa/OSGI-INF/SUBSYSTEM.MF
@@ -0,0 +1,3 @@
+Subsystem-SymbolicName: hello.feature.subsystem
+Subsystem-Type: osgi.subsystem.feature
+Subsystem-Content: hello
View
BIN hello.feature.esa/hello.jar
Binary file not shown.

0 comments on commit e23dbc7

Please sign in to comment.
Something went wrong with that request. Please try again.