Osgi

346 views

Published on

Published in: Technology, Self Improvement
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
346
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Osgi

  1. 1. by Filip Spiridonov
  2. 2.   Is a standard for modularity in Java  Module’s metadata is in META-INF/MANIFEST.MF OSGi jar META-INF/ MANIFEST.MF
  3. 3.  OSGi container openmrs.war openmrs-api.jar openmrs-web.jar openmrs- webapp.jar dependency1.jar dependencyN.jar module1.jar moduleN.jar tomcat.jar Project’s idea
  4. 4.   Place metadata config declarations to webapp.bnd  Use maven-bundle-plugin to add manifest file to openmrs.war  Run this mega bundle inside an OSGi container Step 1 – Mega bundle
  5. 5.  OSGi container openmrs-api.jar dependency1.jar dependencyN.jar tomcat.jar Step 2 – Api to OSGi
  6. 6.   Understand dependencies  Create openmrs-api.jar with manifest  Extract dependency libs to separate bundles  Explicitly share spring services and validators (META-INF/spring/*.xml) Step 2 - algorithm
  7. 7.  OSGi container openmrs-api.jar dependency1.jar dependencyN.jar tomcat.jar openmrs-web.jar Step 3 – Web to OSGi
  8. 8.   Create openmrs-web.jar with manifest  Extract dependency libs to separate bundles  Import shared spring services and validators Step 3 - algorithm
  9. 9.  OSGi container openmrs-api.jar dependency1.jar dependencyN.jar tomcat.jar openmrs-web.jar openmrs- webapp.jar Step 4 – webapp to OSGi
  10. 10.   Webapp depends only on api and web  web.xml is modified to not load spring contexts (Each bundle creates it’s own context and can share some beans with others) Step 4 – algorithm
  11. 11.  Creating execution plan for Virgo OSGi server <plan …> <artifact type="bundle" name="com.springsource.net.sf.cglib"/> <artifact type="bundle" name="com.springsource.antlr"/> <artifact type="bundle" name="com.springsource.com.thoughtworks.xstream"/> <artifact type="bundle" name="com.springsource.org.apache.commons.beanutils"/> <artifact type="bundle" name="com.springsource.org.dom4j"/> <artifact type="bundle" name="com.springsource.org.xmlpull"/> <artifact type="bundle" name="org.apache.commons.cli"/> <artifact type="bundle" name="org.apache.commons.collections"/> … <artifact type="bundle" name="org.openmrs.api.openmrs-api"/> <artifact type="bundle" name="org.openmrs.api.openmrs-web"/> <artifact type="bundle" name="org.openmrs.api.openmrs-webapp"/> … </plan> Step 5 – Virgo plan
  12. 12.  Result
  13. 13.  Running bundles
  14. 14.   Server github repo: https://github.com/NameFILIP/openmrs-virgo- server.git - (to run: “bin/startup.sh”)  Source github repo: https://github.com/NameFILIP/openmrs- core/tree/OSGi Thank you

×