This tiny project contains a Felix-driven OSGI container and a bundle implementing a serviceListener. The container will start each installed bundle and list it's registered services.
mvn clean package; java -jar application/target/application-1.0-SNAPSHOT-jar-with-dependencies.jar
Starting OSGI...
Hello world!
Bundle: org.apache.felix.framework
Registered services:
[org.osgi.service.resolver.Resolver]
[org.osgi.service.packageadmin.PackageAdmin]
[org.osgi.service.startlevel.StartLevel]
[org.osgi.service.condition.Condition]
Bundle: org.example.demo-service
Stopping...
Goodbye, cruel world