balconies, patios, terraces, and bridges. architectural approaches for moving legacy java...
DESCRIPTION
OSGi is a great platform for building new applications, but what if you have 250.000 lines of legacy Java code that uses custom classloaders, dynamic invocation, and complex resource loading techniques? There are many approaches to moving such a product to OSGi. This talk will explore the approaches Software AG evaluated while moving their flagship integration platform from plain old Java to OSGi as well as challenges encountered as part of the move.TRANSCRIPT
![Page 1: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/1.jpg)
COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved
Bridges, Foundations, and Duplexes:
Architectural Approaches to OSGi
adoption Tim Bond
Principal Security Architect
Software AG
21 Sept 2011
OSGi Alliance Marketing © 2008-2010 .
All Rights Reserved
Page 1
![Page 2: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/2.jpg)
COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved
Agenda
• OSGi evolution @ Software AG
• Architecture approaches
• Challenges
• Tooling
![Page 3: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/3.jpg)
OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 3
Company profile
• Founded in 1969
• ADABAS / Natural / Tamino
• Acquired webMethods in 2007
• Acquired IDS Scheer in 2009
• Achieved 1B Euro in 2010
• Acquired Terracotta in 2011
![Page 4: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/4.jpg)
So why a common platform?
![Page 5: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/5.jpg)
…many issues
![Page 6: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/6.jpg)
Why a common platform?
Platform evolved over time and via acquisitions
6 runtime servers + more embedded runtimes
5 different startup scripts
3 SOAP stacks
5 logging components
4 web containers
hundreds of third party libraries
etc.
![Page 7: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/7.jpg)
Big picture
• webMethods history here
webMethods
Integration Server My webMethods
Process Engine
Rules Engine
Task Engine
Assets
Assets webMethods Broker
Assets
CentraSite
Asset
Management
Governance
Mediator
EntireX Broker
Assets
ApplinX Server
Assets
Optimize
Assets
Analytics
Cognos
![Page 8: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/8.jpg)
Why a common platform (& OSGi!)
Common startup scripts
Common Configuration
Deployment
Shared services
Shared components
Build system
Flexible architecture
![Page 9: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/9.jpg)
Integration Server
ESB Integration Server
Protocol &
Transport
SOAP XML
HTTP/S JMS
EDI Flat File
FTP/S SMTP/POP3
Service
Infrastructure
Auditing Security
Threading Caching
Validation Transactions
Statistics Logging
Server Core
Package Manager
Admin Services
PKG Process Engine
PKG Task Services
PKG Rule Engine
PKG
Business Services
PKG
Technical Services
PKG
Process Models
PKG
.NET
PKG
Adapter
PKG
Tomcat
PKG
![Page 10: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/10.jpg)
Architecture approaches
• Balcony (application package)
• Duplex (side-by-side)
• Bridge (fun with classloaders)
![Page 11: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/11.jpg)
Balcony
Run OSGi as
application
package
![Page 12: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/12.jpg)
“Balcony”
IS server core
Pa
cka
ge
ma
na
ge
r
Se
rvic
e r
eg
istr
y
Sch
ed
ule
r
Use
rMa
na
ge
r
Ad
ap
ter
RT
Etc
.
Etc
.
IS launcher
JVM
Wm
Ro
ot
Wm
Pu
blic
OSGi framework
Lo
gg
ing
svc
De
plo
ym
en
t a
ge
nt
Co
nfig
ag
en
t
Se
rvle
t
Service layer
WmOSGI
![Page 13: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/13.jpg)
Problems with balcony
Quick win
Good for development
but . . . .
Does not help create a platform
Does not solve library complexity
![Page 14: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/14.jpg)
Rebuild foundation?
![Page 15: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/15.jpg)
Proxy bundle
Equinox launcher
JVM
Wm
Ro
ot
Wm
Pu
blic
OSGi framework
Lo
gg
ing
svc
De
plo
ym
en
t a
ge
nt
Co
nfig
ag
en
t
Se
rvle
t
IS server core
Pa
cka
ge
ma
na
ge
r
Se
rvic
e r
eg
istr
y
Sch
ed
ule
r
Use
rMa
na
ge
r
AR
T
Etc
.
Etc
.
WS library Security
![Page 16: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/16.jpg)
Foundation
• Worked (mostly)
• But . . . • How to move forward?
• Significant packaging changes
• Difficult to patch due to “fat jar” issue (more on that later)
![Page 17: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/17.jpg)
Lo
gg
ing
svc
De
plo
ym
en
t a
ge
nt
Co
nfig
ag
en
t
Se
rvle
t
equinox OSGi + custom hooks
JVM / service
Wm
Ro
ot
Wm
Pu
blic
Service layer
IS server core
Pa
cka
ge
ma
na
ge
r
Se
rvic
e r
eg
istr
y
Sch
ed
ule
r
Use
rMa
na
ge
r
AR
T
Etc
.
Etc
.
IS proxy bundle / classloader bridge
Duplex
![Page 18: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/18.jpg)
Integration Server OSGI Bundles
Service bridge in practice
Event Server
SQL
Query
Event
Input
Service
jms.send
Source
Adapter
Sink
Adapter
JMS
Trigger
Broker
local call
(XML+topic)
Call jms.send
via InvokeManager (XML)
Source
Adapter
Dis-
patcher JMS
Trigger SQL
Query
Sink
Adapter
JMSDestination JMSConnection
Alias
Adapter
Relational
Client
Group
OSGi
Adapter
![Page 19: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/19.jpg)
Issues / Challenges / Struggles
• “Common lib”
• Import-Dynamic:* and Buddy classloading
• Fat JARs
• Build systems
• Preserving legacy behaviour
![Page 20: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/20.jpg)
Common lib
• Multiple products install and share single directory of
third party and internal jar files
• Who uses what?
• What version is it?
• Can I update it?
• While running?
• Need repository!
![Page 21: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/21.jpg)
The fat jar
• Legacy code “solution”
• Wrap everything up, export all packages
• There’s even an eclipse plugin . . .
• Masks modularity issues
![Page 22: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/22.jpg)
Class and resource loading
Legacy libraries (internal and external) aren’t designed
with modularity in mind. Require code changes
Solutions:
Pass around ClassLoader or use TCCL
Buddy-Classloader
DynamicImport-Package: *
Boot delegation
![Page 23: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/23.jpg)
Build / dependency systems
• Ant (6.000 line build files)
• Many factions solutions • PDE/Eclipse
• maven
• ivy
• bnd + bndtools
• With different views on Compile vs Test vs Runtime
• Moving to “build-by-convention” approach with
artifactory/jenkins/gradle/bnd
![Page 24: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/24.jpg)
Tooling
• jaranalyzer (kirkk.com)
• Lattix
• Structure 101
• OpenGrok (source code search)
![Page 25: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/25.jpg)
Jaranalyzer custom output
![Page 26: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/26.jpg)
Package level deps with Lattix
![Page 27: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/27.jpg)
![Page 28: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/28.jpg)
![Page 29: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/29.jpg)
Source code search
![Page 30: Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving legacy Java applications to OSGi - Tim Bond](https://reader036.vdocuments.net/reader036/viewer/2022062513/55798f7ad8b42ae72b8b4a80/html5/thumbnails/30.jpg)
Thank you . . .