Examples


        InputStream inputStream = bundle()
            .activator(HelloWorldActivator.class)
            .addClass(HelloWorld.class)
            .addClass(HelloWorldImpl.class)
            .addClass(DsService.class)
            .symbolicName("Hello World Bundle")
            .setHeader(Constants.EXPORT_PACKAGE, "")
            .setHeader(Constants.IMPORT_PACKAGE, "*")
            .build(bndBuilder());
  • Setting Bundle-Activator and Bundle-SymbolicName via dedicated methods

  • Adding a service with Declarative Services component annotations

  • Building with bnd builder


        InputStream inputStream = bundle()
            .addClass(HelloWorldActivator.class)
            .addClass(HelloWorld.class)
            .addClass(HelloWorldImpl.class)
            .setHeader(Constants.BUNDLE_SYMBOLICNAME, "Hello World Bundle")
            .setHeader(Constants.EXPORT_PACKAGE, "demo")
            .setHeader(Constants.IMPORT_PACKAGE, "demo")
            .setHeader(Constants.BUNDLE_ACTIVATOR, HelloWorldActivator.class.getName())
            .build(rawBuilder());
  • Setting Bundle-Activator and Bundle-SymbolicName manually

  • Building with raw builder