OSGi experiments

1,508 views

Published on

Introduction to OSGi, modularity & proof of concept in Apache Karaf with Hibernate persitsence

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,508
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
15
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

OSGi experiments

  1. 1. OSGi ExperimentsLadislav Gažo / gazo@seges.sk / @ladislavGazo
  2. 2. 2 | Internal use onlyRestart container
  3. 3. 3 | Internal use onlyTomcat......Pleeeenty of projects=Long time
  4. 4. 4 | Internal use onlySomething 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. 5 | Internal use onlyOSGi• 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. 6 | Internal use onlyEclipse EquinoxApache FelixOracle GlassfishEclipse VirgoApache Karaf
  7. 7. 7 | Internal use onlyChallenges• which runtime to choose• how to properly structure• inter/intra moduledependencies• 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. 8 | Internal use onlyLayers & Bundle & Lifecycle
  9. 9. 9 | Internal use onlyKaraf PoC - https://github.com/lgazo/karaf-pocfis-database fis-persistenceunitfis-database customer-domain event-domainevent-servicefis-shell fis-webotherapp-persistenceunitotherapp-database order-domainFeatures• independent domain modules,orchestrated persistence units• multiple DBs• service separated from view/accessmodules• multiple versions of a bundle
  10. 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>
  11. 11. 11 | Internal use onlyInteresting commands• ./karaf debug• bundle:watch• log:tail• bundle:list• feature:repo-add + feature:install• install -s wrap:mvn:postgresql/postgresql/9.1-901-1.jdbc4• bundle:tree-show
  12. 12. 12 | Internal use onlyNotable buzzwords + properties• Blueprint• Whiteboard• Apache Aries, EclipseGemini• Distributed OSGi• Pax• SSH console, web console• Features• Language agnostic – bundlescan be in Java, Scala,Groovy,...• HttpService, Configurationservice, Activator, Logging
  13. 13. 13 | Internal use onlyThank you for your patiencegazo@seges.sk@ladislavGazo
  14. 14. 14 | Internal use onlyLinks• Karaf PoC - https://github.com/lgazo/karaf-poc• Apache Karaf – http://karaf.apache.org• Apache Aries - http://aries.apache.org/• Hibernate OSGi - https://github.com/brmeyer/HibernateOSGi

×