osgi web development in action

15
OSGi Web Development in Action Christian Baranowski, SEITENBAU Gmbh Event 2014

Upload: osgiusers

Post on 20-Jan-2015

356 views

Category:

Technology


6 download

DESCRIPTION

 

TRANSCRIPT

Page 1: OSGi Web Development in Action

OSGi Web Development in ActionChristian Baranowski, SEITENBAU Gmbh

Event 2014

Page 2: OSGi Web Development in Action

Welcome• Christian Baranowski • Software Developer @ SEITENBAU

• Software Engineering • Custom Software Solutions • E-Government Solutions • Identity Management and SSO Solutions • www.seitenbau.de

Page 3: OSGi Web Development in Action

BndtoolsEasy, powerful and productive way to develop OSGi applications. Based on bnd and Eclipse.

http://bndtools.org/

Page 4: OSGi Web Development in Action

enRoute Blog

• OSGi demo project by Peter Kriens https://github.com/osgi/osgi.enroute.blog/

• Step by step tutorial from Peter Kriens https://github.com/osgi/osgi.enroute.blog/blob/master/OSGi-enRoute-blog.pdf?raw=true

• Last OSGi Code Camp was based on this tutorial

Page 5: OSGi Web Development in Action

Simple Web App

aQute!webserver

HTTPService

Apache Felix HTTP osgi.simple.webapp

Extender����������� ������������������  static/*

aQute!Configurer

Apache Felix!Config Admin

Configuration����������� ������������������  Admin

Extender����������� ������������������  configuration/configuration.json����������� ������������������  

Page 6: OSGi Web Development in Action

X-Rays for OSGiSimple way to debug Services and Dynamic.

http://softwaresimplexity.blogspot.de/2012/05/x-rays-for-osgi.html

Page 7: OSGi Web Development in Action

Static Web Bundles

aQute!webserver

osgi.simple.webapp

Extender����������� ������������������  static/*

com.google.angularjs

com.twitter.bootstrap

Page 8: OSGi Web Development in Action

REST Todo Resource (Client)var todoApp = angular.module( 'todoApp', ['ngResource']);

!todoApp.factory( 'todoResource', ['$resource', function($resource) {

return $resource( '/rest/todos/:todoId', { todoId: '@todoId' }, {

archive: {

url: '/rest/archive',

method: 'DELETE',

params: {todoIds: '@todoIds'}

}

});

}]);

http://angularjs.org

Page 9: OSGi Web Development in Action

REST Todo Resource

osgi.simple.webapp

ResourceManagerHTTPService

Apache Felix HTTP

aQute!rest.srv

Whiteboard����������� ������������������  Pattern

Page 10: OSGi Web Development in Action

REST Todo Resource (Server)

Page 11: OSGi Web Development in Action

More Bundles

ResourceManagerHTTPService

Apache Felix HTTP

aQute!rest.srv

Whiteboard����������� ������������������  Pattern

osgi.simple.webapp.staticaQute!webserver

Extender����������� ������������������  static/*

osgi.simple.webapp.domain

osgi.simple.webapp.rest

Page 12: OSGi Web Development in Action

Bnd Command Line• bnd package web app.bndrun

• bnd run webapp.bndrun

• …

Page 13: OSGi Web Development in Action

Deploy into Servlet Container

Servlet Container (e.g. Jetty or Tomcat)

8080

HTTP

simple.war

OSGi Framework (e.g. Felix)

http.bridge

ResourceManager

HTTPService

aQute!rest.srv

ProxyServlet

osgi.simple.webapp

Page 14: OSGi Web Development in Action

More…

• More about simple OSGi based Web development see Peter Kriens enRoute Blog https://github.com/osgi/osgi.enroute.blog/

Testing OSGi Services

JPA and OSGi Web Apps

Page 15: OSGi Web Development in Action

Feedback@tux2323