All Projects → bdelacretaz → Osgi For Mere Mortals

bdelacretaz / Osgi For Mere Mortals

Sample code for my "OSGi for mere mortals" presentation at ApacheCon NA 2011

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Osgi For Mere Mortals

Karaf Tutorial
Stars: ✭ 256 (+924%)
Mutual labels:  osgi, tutorial
Algolia Swift Demo
iOS instant search tutorial
Stars: ✭ 23 (-8%)
Mutual labels:  tutorial
Gdmultiplayertutorial
Reference/companion material to a written tutorial teaching how to setup multiplayer game in Godot
Stars: ✭ 18 (-28%)
Mutual labels:  tutorial
Spark Scala Tutorial
A free tutorial for Apache Spark.
Stars: ✭ 907 (+3528%)
Mutual labels:  tutorial
Aws Lambda Workshop
Some incremental examples suitable to host an AWS Lambda Functions workshop
Stars: ✭ 18 (-28%)
Mutual labels:  tutorial
Tic Tac Toe
An example tutorial built with git-tutor https://github.com/lesnitsky/git-tutor
Stars: ✭ 22 (-12%)
Mutual labels:  tutorial
Marksheet
Free tutorial to learn HTML and CSS
Stars: ✭ 893 (+3472%)
Mutual labels:  tutorial
R Notes
Notes for using R language to do data mining and machine learning (Chinese)
Stars: ✭ 25 (+0%)
Mutual labels:  tutorial
Har Keras Coreml
Human Activity Recognition (HAR) with Keras and CoreML
Stars: ✭ 23 (-8%)
Mutual labels:  tutorial
Docker Tutorial
Docker 基本教學 - 從無到有 Docker-Beginners-Guide 教你用 Docker 建立 Django + PostgreSQL 📝
Stars: ✭ 906 (+3524%)
Mutual labels:  tutorial
Machinelearningstocks
Using python and scikit-learn to make stock predictions
Stars: ✭ 897 (+3488%)
Mutual labels:  tutorial
Django Beginners Guide
A Complete Beginner's Guide to Django - Code Samples
Stars: ✭ 902 (+3508%)
Mutual labels:  tutorial
Synthetic Programming
Synthetic Programming code from tutorials and other videos
Stars: ✭ 21 (-16%)
Mutual labels:  tutorial
Vst24 Hello World
This project contains a "Hello World" style application for building a VST 2.4 plugin
Stars: ✭ 18 (-28%)
Mutual labels:  tutorial
Python Introducing Pandas
Introduction to pandas Treehouse course
Stars: ✭ 24 (-4%)
Mutual labels:  tutorial
Intro Starwars App
Repositório responsável pela artigo escrito no dev.to AQUI em como desenvolver a intro do Star Wars com Node.js & Express.js.
Stars: ✭ 18 (-28%)
Mutual labels:  tutorial
Dig Into Apollo
Apollo notes (Apollo学习笔记) - Apollo learning notes for beginners.
Stars: ✭ 903 (+3512%)
Mutual labels:  tutorial
Adonis Tdd Tutorial Demo
Stars: ✭ 22 (-12%)
Mutual labels:  tutorial
Haxejs
Documentation about using JavaScript with Haxe
Stars: ✭ 25 (+0%)
Mutual labels:  tutorial
Elm Cheat Sheet
An overview of Elm syntax and features
Stars: ✭ 928 (+3612%)
Mutual labels:  tutorial

OSGi for mere mortals

This is the code of my "OSGi for mere mortals" presentation at ApacheCon NA 2011, EU 2012 and EU 2014.

It's a minimal standalone RESTful server built from scratch using OSGi Declarative Services, meant to demonstrate that OSGi is not only for superhuman guru programmers.

This example demonstrates the complete lifecycle of an OSGi application, from starting the framework and installing the required bundles to running the app itself.

It also demonstrates the svelteness of the OSGi framework and core services: the total size of the build-time dependencies (jar files) is around 3 megabytes and additional runtime baggage amounts to ten OSGi bundles (also jar files) representing about 2 megabytes more, including all runtime features like the OSGi web console, interactive OSGi shell, the OSGi configuration mechanism and front-end and the servlet engine. Startup time is around 300 msec on my laptop.

The Maven build is also a useful example of how to create OSGi bundles in a simple way.

The slides at http://www.slideshare.net/bdelacretaz/osgi-for-mere-mortals should help you walk through the code.

How to build and start

To build the runnable jar, run mvn clean install at the top of the source code tree (using Apache Maven 3.0.3 or later).

You can then start the server from the launcher subfolder by running

java -jar target/osgi-for-mere-mortals-launcher-0.0.1-SNAPSHOT.jar

(or whatever the name of that jar file is).

The OSGi console shown in the slides is at http://localhost:8080/system/console - use admin/admin to log in.

How to use the server

The server doesn't do much, that's not the point, the goal is just to demonstrate how it is assembled.

You can store data via HTTP POST requests:

$ date | curl -X POST -D - http://localhost:8080/store/testing
HTTP/1.1 201 Created
Location: /store/testing
Content-Type: text/plain; charset=utf-8
Content-Length: 149
Server: Jetty(6.1.x)

Stored at /store/testing
StoredBy:ch.x42.osgi.samples.osgi101.app.servlets.StorageServlet
StoredAt:Fri Nov 14 17:03:36 CET 2014

And retrieve it via HTTP GET:

curl http://localhost:8080/store/testing
StoredBy:ch.x42.osgi.samples.osgi101.app.servlets.StorageServlet
StoredAt:Fri Nov 14 17:03:36 CET 2014
Path:/store/testing 
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].