This document discusses combining OSGI modularity with Java EE functionality using Apache Karaf. It provides an overview of OSGI and modularity concepts. It then discusses how the Apache Karaf container can be used to build modular applications and how features like JPA, EJB, and CDI can be incorporated through projects like Aries and OpenEJB. An example architecture is shown using Karaf with Java EE components like JPA and EJB. The presentation concludes that Karaf allows leveraging both OSGI and Java EE technologies for modular application development.
In this document
Powered by AI
Overview of Karaf, introduction of speakers Charles Moulliard and Romain Manni-Bucau with their backgrounds.
Definition of modularity, history of OSGI, lifecycle of bundles, and key OSGI architecture concepts.
Detailed features of Apache Karaf, Jigsaw project enhancements, and commands for module management.
Introduction to OSGI EE, its role in extending modularity, services, architecture examples involving JPA.
Overview of Java EE specifications, key JSRs, concepts associated with transactions, and resource management.
Combining Java EE with OSGI in Karaf to create modular applications and a demonstration of implementations.
Open floor for questions regarding the integration and features of Karaf with Java EE.
Speaker : RomainManni-Bucau
● Java and JavaEE developer
● Participates to Apache OpenEJB & TomEE
since 2011
● His professional area is particularly linked to
banks and insurances
● His development environment mainly
consists of Open Source & Apache projects
(TomEE, Karaf, ...)
●
What does modularitymeans ?
● Open Standard Gateway Initiative exists
since 1999
● Initially conceived to create dynamic
environments for the “home gateway”
● Lead by Telco, IT vendors
● Class-loading isolation
● Dependency control, versioning
7.
What does modularitymeans ?
● Function → Class
● Class → Interface
● Classes → Jar
● Jar → Bundle (a Module)
● Bundle has a lifecycle !
Apache Karaf
● Birthdate - 16th of June 2010
● Platform running on OSGI (Apache Felix, Eclipse
Equinox)
● Provides a lightweight container where
● Applications, Integration projects
● Web Service, JMS Brokers
● Java applications
can be deployed
● Used by ServiceMix, Geronimo projects
Java Jigsaw vision
● Jigsaw project seems like
Loch Ness Monster
● Announced since Java SE 7
& now -> Java SE 9
in 2015
● Faced to issues
(backward compatibility)
21.
Java Jigsaw vision
● CLASSPATH death
● New Class format
● Static linkage (<= Java card – 1996)
● Byte code verification step moved to speed
process
● JDK will have a system module library in
which the platform modules are installed
OSGI EE
● OSGI is not only a specification defining a
“modular” architecture
● Embrace EE world
● Provide support for Java standards :
– JPA, JNDI, Web (HTTP), JTA, JDBC
– Soon CDI, EJB
26.
OSGI EE
● Implemented by Apache Aries
● But also OPS4J - Pax
27.
What is OSGIEE ?
● OSGI services (Java Interfaces)
● JPA, JTA OSGI containers
● Web OSGI container
● Blueprint (IoC) to configure services, beans and
access services
● But also
– JNDI (wrapper)
– SpiFly (Java ServiceLoader – static/dynamic)
– Applications isolation (EBA)
What is OSGIEE ?
● A typical architecture
Apache Karaf
Java Service Java DAO
Blueprint Blueprint
OSGI Services
JPA Tx
<bean id="conferenceService"
DB class="org.apache.conf2012.service.impl.ConferenceService">
<property name="conferenceDAO">
<reference interface="org.apache.conf2012.service.ConferenceDAO"/>
</property>
</bean>
30.
What is OSGIEE ?
● Architecture enriched with Web layer
Apache Karaf
Java DAO Java Service Web
Blueprint Blueprint Blueprint
OSGI Services
JPA Tx
DB
Simply HTML artifacts,
web framework
31.
What is OSGIEE ?
● Using Camel for Integration
Apache Karaf
File, WS, Rest,
JMS
Java DAO Java Service
Camel
Blueprint Blueprint
OSGI Services
JPA Tx Bean
DB from(“file://apacheCon2012”)
.unmarshall(“csv”)
.beanRef(“insertConference”);
Java EE onKaraf
● What is required
– A Karaf runtime
– Features (= provisioning)
– New Karaf command (optional)
● Follow Java EE specs & development
guidelines
43.
Karaf plus EE
● Features →
Java EE api + OpenEJB + OpenWebbeans +
OpenJPA
● Turn on your Karaf into Java EE world :
CDI + EJB3 + JPA + JTA + ...
● Karaf EE = Combine multi-lightweight
containers of Karaf with Java EE world
● Allow to develop modular projects
● Capitalize your Java EE knowledge
● Convergence between, best of both
technologies OSGI & Java EE
52.
Questions
@cmoulliard
@rmannibucau
Karaf with EE
http://repo1.maven.org/maven2/org/apache
/openejb/apache-karafee/
https://github.com/cmoulliard/apachecon-
2012/tree/master/karafee