Git Product home page Git Product logo

rap-virgo-examples's Introduction

A collection of Virgo related examples

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

RAP helloworld packaged as Web Application Bundle (WAB)

Build com.eclipsesource.virgo.examples.rap.webbundle:

  1. cd com.eclipsesource.virgo.examples.parent
  2. mvn package

Copy the required RAP bundle to your virgo installation:

  1. cd com.eclipsesource.virgo.examples.rap.webbundle
  2. export VIRGO_HOME=enter-your-virgo-installation-directory-here
  3. 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/

RAP helloworld with OSGi integration via blueprint

Build com.eclipsesource.virgo.examples.rap.blueprint:

  1. cd com.eclipsesource.virgo.examples.parent
  2. mvn package

Copy the required RAP bundle to your virgo installation:

  1. cd com.eclipsesource.virgo.examples.rap.blueprint
  2. export VIRGO_HOME=enter-your-virgo-installation-directory-here
  3. 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:

  1. org.eclipse.equinox.http.servlet
  2. 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.

Blueprint example - OSGi building blocks

Build com.eclipsesource.examples.virgo.rap.webbundle:

  1. cd com.eclipsesource.virgo.examples.parent
  2. mvn package

Copy the required H2 bundle to your virgo installation:

  1. cd com.eclipsesource.virgo.examples.blueprint.h2
  2. export VIRGO_HOME=enter-your-virgo-installation-directory-here
  3. 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/

Blueprint example - Configuration Admin

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

rap-virgo-examples's People

Contributors

fwaibel avatar mknauer avatar

Watchers

James Cloos avatar Mikhail N avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.