How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype •...

9
1 How we use OSGi to build Open Liberty Alasdair Nottingham - IBM

Transcript of How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype •...

Page 1: How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype • Declarative Services • Config Admin • Subsystem Features • Regions. 9 Things

1

How we use OSGi to build Open LibertyAlasdair Nottingham - IBM

Page 2: How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype • Declarative Services • Config Admin • Subsystem Features • Regions. 9 Things

2

Project goals

• Implement Java EE

• Small Footprint

• Start fast

• Composible

• Dynamic

• Easy to use

Page 3: How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype • Declarative Services • Config Admin • Subsystem Features • Regions. 9 Things

3

Fit-for-purpose server• You control which features are loaded into each server instance

Kernel

<feature>servlet-3.1</feature>

servlet-3.1

http-1.1 appmgr

<feature>jsf-2.2</feature>

jsp-2.3 jsf-2.2Java EE

Page 4: How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype • Declarative Services • Config Admin • Subsystem Features • Regions. 9 Things

4

Server configuration

<server><featureManager>

<feature>javaee-8.0</feature></featureManager>

<httpEndpoint id=“defaultHttpEndpoint” httpPort=“8080”/>

<webApplication location=“myWeb.war” contextRoot=“/”/></server>

Page 5: How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype • Declarative Services • Config Admin • Subsystem Features • Regions. 9 Things

5

Modularity - OSGi vs Java EE

Bundle A

Bundle B Bundle c

ear

jar jar

warjar jar

?

Page 6: How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype • Declarative Services • Config Admin • Subsystem Features • Regions. 9 Things

6

Java EE -> OSGi

ear

jar jar

warjar jar war

jar jar

Page 7: How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype • Declarative Services • Config Admin • Subsystem Features • Regions. 9 Things

7custom classloaders

Java EE on OSGi

Bundle A

Bundle B Bundle c

ear

jar jar

warjar jar

region

Gateway

Page 8: How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype • Declarative Services • Config Admin • Subsystem Features • Regions. 9 Things

8

Key OSGi Technologies

• Equinox (duh)

• Metatype

• Declarative Services

• Config Admin

• Subsystem Features

• Regions

Page 9: How we use OSGi to build Open Liberty · Key OSGi Technologies • Equinox (duh) • Metatype • Declarative Services • Config Admin • Subsystem Features • Regions. 9 Things

9

Things we learned• Shutdown is not as simple as stopping the framework

• Statics and service do not mix & match

• Use the build tools

• Very powerful for large complex software

• DS and ConfigAdmin together are brilliant

• High learning curve

• Java SE classloading assumptions don’t mix well in OSGi