Top Banner
1

Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

Jul 07, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Connect OSGi and SpringCarsten Ziegeler, Adobe OSGi Community Event 2019

Page 2: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Carsten Ziegeler

Principal Scientist @ Adobe Member of the Apache Software Foundation PMC Member of Apache Felix and Sling OSGi Expert Groups and Board member

2

Page 3: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Modularity

Page 4: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Todays Software

Complex Software Systems Cloud Microservices (Desktop)

Page 5: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Software-ICs

ModulesAPI

Requirements / Capabilities

Page 6: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Modularity Is Key

Complex software systems Sustainable Software Extensibility Interchangeability Reuse / Consistency

Page 7: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Modularity in Java

Page 8: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Modularity with Java === OSGi

Modules Requirements

Capabilities

Semantic Versioning

Service Registry Extensions (Compendium) IoC Container (Declarative Services)

Page 9: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Spring

Page 10: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Spring

Core: Popular IoC container Dozens of extensions Tooling Spring Boot

Page 11: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Core ConceptsSpring OSGi

Modules Jar based === classpath hell Bundles incl class loading

Static Dynamic

Services IoC Container Service Registry

Hierarchy Flat

„Static“ Dynamic

Name based Interface + property based

(Auto) Wiring

Separate IoC Container(s) with(auto) wiring

Page 12: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Use Case

Page 13: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Reuse / Consistency

Web Framework (OSGi) Apache Sling

Set of libraries (Spring) Authentication

Monitoring

Storage connectors

Page 14: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

OSGi FrameworkSpring Boot

Architecture

Jetty

Libraries + Beans

Http Service

Apache Sling

Application CodeFeature Model

Bundles+Config

Config(jars)

OSGiConnect

Page 15: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Connect

Page 16: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Reboot OSGi Connect (RFP 196 / RFC 243)

Connect OSGi to the „outside“ Popular Application Frameworks JPMS JARs on the classpath Native compilation

16

Page 17: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Demo

Page 18: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Modularity is Key

Modularity in Java === OSGi Metadata Buildtime vs Runtime

New possibilities with OSGi Connect Pick and choose

Dynamic vs static

Watch https://github.com/osgi/design/tree/master/rfcs/rfc0243

Page 19: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Q & A

Page 20: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Page 21: Connect OSGi and Spring · © 2019 Adobe. All Rights Reserved. Adobe Confidential. Modularity with Java === OSGi