modular java applications with osgi on apache karaf

18
Modular Applications with OSGi on Apache Karaf Ioan Eugen Stan @ieugen222 [email protected]

Upload: ioan-stan

Post on 13-Jul-2015

529 views

Category:

Software


3 download

TRANSCRIPT

Page 1: Modular Java applications with OSGi on Apache Karaf

Modular Applications with OSGi on Apache Karaf

Ioan Eugen Stan@ieugen222

[email protected]

Page 2: Modular Java applications with OSGi on Apache Karaf

About me● IT Consultant (Java, Architecture)● Open Source Hacker● Web: http://ieugen.ro/● http://github.com/ieugen● @ieugen222

Page 3: Modular Java applications with OSGi on Apache Karaf

Agenda● Problem statement● Short intro to OSGi● Apache Karaf and OSGi universe● Building an App

https://github.com/ieugen/java2days-2014-osgi-karaf

Page 4: Modular Java applications with OSGi on Apache Karaf

Modularity is a big issue● Deals with software complexity over

time● Jigsaw - Java started from JDK-7 (start

2009)● Has many aspects: deployment,

management, runtime

Page 5: Modular Java applications with OSGi on Apache Karaf

Why modularity?● Reduce complexity● Allow parallel development● Improve component re-usability● Upgrade proof systems

Page 6: Modular Java applications with OSGi on Apache Karaf

When Applications can Roam Freely, P. Kriens - http://slideplayer.us/slide/732791/

Page 7: Modular Java applications with OSGi on Apache Karaf

A solution for Java modularity?Jigsaw was delayed again (does not address dynamism)

Try OSGi – the de facto standard for Java modularity

Page 8: Modular Java applications with OSGi on Apache Karaf

OSGi – overview● Modular system for Java/JVM● Service platform● Dynamic component model

Page 9: Modular Java applications with OSGi on Apache Karaf

http://www.slideshare.net/mfrancis/osgi-technology-value-proposition-december-2013

Page 10: Modular Java applications with OSGi on Apache Karaf

OSGi Benefits● Reduced Complexity● Promotes Reuse● Real World – things appear/disappear● Dynamic updates

Page 11: Modular Java applications with OSGi on Apache Karaf

HardwareOperating SystemJava Virtual Machine

ModulesLife cycle

Service registryServices

Application / Bundles

Sec

uri

ty

http://en.wikipedia.org/wiki/OSGi

OSGi Service Gateway Architecture

Page 12: Modular Java applications with OSGi on Apache Karaf

http://en.wikipedia.org/wiki/OSGi

OSGi Architecture (2)

Bundle 1 Bundle 2 Bundle n

System Services

e.g. Java ME CDC, SE, EE

e.g. Windows, Linux VxWorks, QNX

C/C++

OSGi Framework

Java Runtime Environment

Operating System

Hardware

Driv

ers

Plat

form

Serv

er

JNI

Page 13: Modular Java applications with OSGi on Apache Karaf

Apache KarafApache Karaf is a small OSGi based runtime which provides a lightweight container onto which various components and applications can be deployed.

http://karaf.apache.org/

Page 14: Modular Java applications with OSGi on Apache Karaf

Karaf Architecture

Page 15: Modular Java applications with OSGi on Apache Karaf

Features● Hot deployment of bundles● Dynamic configuration● Provisioning of applications ● Native OS integration● Remote Access (SSH, Web)● ...

Page 16: Modular Java applications with OSGi on Apache Karaf

Projects● OPS4j - https://github.com/ops4j● OSGi JAX-RS Connector

https://github.com/hstaudacher/osgi-jax-rs-connector

Page 17: Modular Java applications with OSGi on Apache Karaf

Demo time

Page 18: Modular Java applications with OSGi on Apache Karaf

Thank you.Time for questions.