This repository contains a collection of OSGi projects developed with Virgo:
- RAP example - packaged as Web Application Bundle
- RAP example - with OSGi integration via blueprint
- Blueprint - export embedded H2 DataSource via OSGi service
- Blueprint - consume the DataSource and provide some OSGi console commands
- Blueprint - dynamically update beans via OSGi Configuration Admin
Build com.eclipsesource.virgo.examples.rap.webbundle:
- cd com.eclipsesource.virgo.examples.parent
- mvn package
Copy the required RAP bundle to your virgo installation:
- cd com.eclipsesource.virgo.examples.rap.webbundle
- export VIRGO_HOME=enter-your-virgo-installation-directory-here
- mvn -f virgo-setup.xml dependency:copy
Then copy the generated webbundle from the Maven build folder target into the Virgo pickup folder.
Once deployed the sample is available at http://localhost:8080/helloworld/hello
For more information please refer to the RAP on Virgo tutorial: "Developing Web Application Bundles with RAP and Virgo" at http://eclipsesource.com/blogs/tutorials/developing-web-application-bundles-with-rap-and-virgo/
Build com.eclipsesource.virgo.examples.rap.blueprint:
- cd com.eclipsesource.virgo.examples.parent
- mvn package
Copy the required RAP bundle to your virgo installation:
- cd com.eclipsesource.virgo.examples.rap.blueprint
- export VIRGO_HOME=enter-your-virgo-installation-directory-here
- mvn -f virgo-setup.xml dependency:copy
Extend Virgo to provide an OSGi HttpService and the RAP OSGi integration:
Do this by providing the necessary bundles in the repository/usr folder of Virgo and then copy the rap.blueprint.plan into the Virgo pickup folder.
Necessary bundles are:
- org.eclipse.equinox.http.servlet
- org.eclipse.equinox.http.jetty
(Those are pre-packaged in the RAP target download or available directly from the Equinox project site.)
Then copy the generated bundle from the Maven build folder target into the Virgo pickup folder.
Once deployed the sample is available at http://localhost:8080/helloworld/hello
For more information please refer to the RAP on Virgo tutorial: "Developing Web Application Bundles with RAP and Virgo" at http://eclipsesource.com/blogs/tutorials/developing-web-application-bundles-with-rap-and-virgo/
Note: Jetty and the HttpService use the same port per default. So you have to configure either the HttpService or the default Jetty configuration.
Provide org.osgi.service.http.port=18080 or change the port in jetty/etc/jetty.xml.
Build com.eclipsesource.examples.virgo.rap.webbundle:
- cd com.eclipsesource.virgo.examples.parent
- mvn package
Copy the required H2 bundle to your virgo installation:
- cd com.eclipsesource.virgo.examples.blueprint.h2
- export VIRGO_HOME=enter-your-virgo-installation-directory-here
- mvn -f virgo-setup.xml dependency:copy
Then copy the generated OSGi bundles from the Maven build folders target into the Virgo pickup folder.
Now you have additional OSGi console commands.
For more information please refer to the blog post "How to create blueprints for your OSGi building blocks" at http://eclipsesource.com/blogs/2012/08/11/how-to-create-blueprints-for-your-osgi-building-blocks/
Drop com.eclipsesource.virgo.examples.blueprint.cm into the pickup of your Virgo server.
To trigger the dynamic change of the beans drop configurations into the pickup folder.
Use labX.properties to test autowire-on-update and labY.properties to test update-method approach.
labX.properties:
integer=42
labY.properties:
foo=bar