modular java applications with osgi on apache karaf
TRANSCRIPT
About me● IT Consultant (Java, Architecture)● Open Source Hacker● Web: http://ieugen.ro/● http://github.com/ieugen● @ieugen222
Agenda● Problem statement● Short intro to OSGi● Apache Karaf and OSGi universe● Building an App
https://github.com/ieugen/java2days-2014-osgi-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
Why modularity?● Reduce complexity● Allow parallel development● Improve component re-usability● Upgrade proof systems
When Applications can Roam Freely, P. Kriens - http://slideplayer.us/slide/732791/
A solution for Java modularity?Jigsaw was delayed again (does not address dynamism)
Try OSGi – the de facto standard for Java modularity
OSGi – overview● Modular system for Java/JVM● Service platform● Dynamic component model
http://www.slideshare.net/mfrancis/osgi-technology-value-proposition-december-2013
OSGi Benefits● Reduced Complexity● Promotes Reuse● Real World – things appear/disappear● Dynamic updates
HardwareOperating SystemJava Virtual Machine
ModulesLife cycle
Service registryServices
Application / Bundles
Sec
uri
ty
http://en.wikipedia.org/wiki/OSGi
OSGi Service Gateway Architecture
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
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/
Karaf Architecture
Features● Hot deployment of bundles● Dynamic configuration● Provisioning of applications ● Native OS integration● Remote Access (SSH, Web)● ...
Projects● OPS4j - https://github.com/ops4j● OSGi JAX-RS Connector
https://github.com/hstaudacher/osgi-jax-rs-connector
Demo time
Thank you.Time for questions.