moving the guidewire platform to osgi - paul d'albora
TRANSCRIPT
![Page 1: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/1.jpg)
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Moving the Guidewire platform to OSGi
A case study
Paul D’AlboraGuidewire Software
[email protected] 2012
![Page 2: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/2.jpg)
2
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Agenda• Introduction to the Guidewire platform
• Motivation for moving to OSGi
• Challenges
• Where we are and where we’re going
• Q & (hopefully) A
![Page 3: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/3.jpg)
3
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
The Guidewire Platform – Basics• Supports core system software for the global
property/casualty insurance industry
• Core services: ORM layer, web UI framework, business rules, workflow, automated upgrade, I18N, customer plugins, messaging and web services integration
• High degree of configurability
• Supports multiple JEE containers
![Page 4: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/4.jpg)
4
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
The Guidewire Platform – Pressures• Constantly adding and improving features for
applications
• Must not break existing customers
• Large code base developed over ten years
• Large and growing development team
• All of which can lead to …
![Page 5: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/5.jpg)
5
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
![Page 6: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/6.jpg)
6
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
![Page 7: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/7.jpg)
7
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Goals• Test components in isolation
• Reduce learning curve
• Contain maintenance costs
• Release components independently
![Page 8: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/8.jpg)
8
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
OSGi• Module system
• Versioning
• Manageability
• Mature, well-defined specifications
• Robust community
• Services!
![Page 9: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/9.jpg)
9
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Givens• Application must be delivered as a JEE application
(EAR/WAR)
• Code divided into coarse-grained “modules” forming a DAG of compile-time dependencies
• Non-Eclipse IDE (no PDE)
• Custom build system
![Page 10: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/10.jpg)
10
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Step 1
![Page 11: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/11.jpg)
11
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Plan• Run Equinox embedded in JEE container using
servlet bridge
• Define a bundle for each existing code “module”
• Replace/Convert 3rd-party jars with OSGi equivalents
• Get automated tests running in framework
• DON’T try to modularize yet
![Page 12: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/12.jpg)
12
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Roadblocks
![Page 13: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/13.jpg)
13
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Problem: Split Packages• Same package exists in multiple modules
• Framework binds to one of them, causing the other “parts” of the package to effectively disappear
• Typical for platform and one or more applications to define classes in the same package
• This is pervasive in our code
![Page 14: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/14.jpg)
14
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Solution: Fragments• Define an empty “root” bundle
• Every bundle is a fragment of root- Fragment-Host: com.guidewire.root
• Simulates one bundle
• More closely represents original, non-modular, global classpath environment
![Page 15: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/15.jpg)
15
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Problem: 3rd-party libraries• Lots of them (~102)
• Signed jars
• Classpath assumptions
![Page 16: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/16.jpg)
16
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Solution: Varied• Public OSGi bundle repositories– Eclipse Orbit– SpringSource
• BND– For signed jars, embed jar within jar and use Bundle-
ClassPath– Can combine related jars to deal with split packages
• TCCL to work around classpath assumptions
• Newer jars being packaged as OSGi bundles
![Page 17: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/17.jpg)
17
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Problem: Servlets• No longer registered in web.xml (just the servlet
bridge)
• How to register platform and application servlets with HttpService
• Ordering requirements (<load-on-startup>)
![Page 18: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/18.jpg)
18
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Solution: Components• Felix Http Whiteboard
• Declarative Services with Bnd- @Component(provide=Servlet.class, properties="alias=/path")
• For ordering-dependent servlets, register in order with HttpService- Component with @Reference to HttpService
![Page 19: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/19.jpg)
19
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Practical Tips• Learn and use BND
• Learn the classloading flow chart (R4.2 Spec, Fig 3.19)– Turn off osgi.compatibility.bootdelegation, osgi.context.bootdelegation in Equinox
– No Require-Bundle
• Lean on automated tests
• Use the framework itself
![Page 20: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/20.jpg)
20
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Current Status• Applications and integration tests running successfully
in development
• Initial performance testing reveals no significant difference in response times or memory usage
• Rolled out to application teams with minimal disruption
![Page 21: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/21.jpg)
21
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Next Steps• Define candidate areas for modularization
• Use services to de-couple components
• Use services to replace ad hoc registries
• Educate developers about service-oriented programming
![Page 22: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/22.jpg)
22
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Example: Static Service Registry• Map of interface Class to implementation instance
• Initialized by bootstrap class
• Accessed via static methods
![Page 23: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/23.jpg)
23
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Static Service Registry – Code Sample 1
![Page 24: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/24.jpg)
24
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Static Service Registry – Code Sample 2
![Page 25: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/25.jpg)
25
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Static Service Registry – Code Sample 3
![Page 26: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/26.jpg)
26
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
Static Service Registry – Replacement
![Page 27: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/27.jpg)
Questions?
Feedback welcome.
![Page 28: Moving the Guidewire platform to OSGi - Paul D'Albora](https://reader036.vdocuments.net/reader036/viewer/2022062302/589dbe2c1a28abf7288b5eef/html5/thumbnails/28.jpg)
Give Feedback on the Sessions
1 Sign In: www.eclipsecon.org
2 Select Session Evaluate
3 Vote