3. 3 | Internal use only
Tomcat
.
.
.
.
.
.
Pleeeenty of projects
=
Long time
4. 4 | Internal use only
Something was wrong
• start-up time long
• hot redeploy is fail
• restart takes long
• multiple wars? maybe
• JRebel? maybe
• one big bunch of bitter jars?
• YES – this needs a solution
5. 5 | Internal use only
OSGi
• old Alliance
• different class loading
– dependency hell no more
• modules a.k.a. bundles
• redeploy
• not clear what to choose
• but still small enough
6. 6 | Internal use only
Eclipse Equinox
Apache Felix
Oracle Glassfish
Eclipse Virgo
Apache Karaf
7. 7 | Internal use only
Challenges
• which runtime to choose
• how to properly structure
• inter/intra module
dependencies
• deployment model
• redeployment in dev
• database access
• Karaf
• Maven already helped a lot
• Blueprint, CDI
– optionally Spring, Guice
• e.g. from local m2 repo
• bundle:watch
• ehm... Hibernate is hard
8. 8 | Internal use only
Layers & Bundle & Lifecycle
9. 9 | Internal use only
Karaf PoC - https://github.com/lgazo/karaf-poc
fis-database fis-persistenceunitfis-database customer-domain event-domain
event-service
fis-shell fis-web
otherapp-persistenceunitotherapp-database order-domain
Features
• independent domain modules,
orchestrated persistence units
• multiple DBs
• service separated from view/access
modules
• multiple versions of a bundle
10. 10 | Internal use only
<packaging>bundle</packaging>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>