SlideShare a Scribd company logo
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
OSGi R7 upcoming specifications
David Bosschaert & Carsten Ziegeler | Adobe
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Carsten Ziegeler
 RnD Adobe Research Switzerland
 Member of the Apache Software Foundation
 VP of Apache Felix and Sling
 OSGi Expert Groups and Board member
2
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
David Bosschaert
 Adobe R&D Ireland
 OSGi EEG co-chair
 Apache member and committer
 ISO JTC1 SC38 (Cloud Computing) Ireland committee member
3
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
OSGi Specification Process
 Requirements, Use Cases -> RFP
 Technical Specification -> RFC
 https://github.com/osgi/design
 Reference Implementation
 Conformance Test Suite
 Spec Chapter
4
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Converter
and Serialization Service
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Object Conversion
 Wouldn’t you like to convert anything to everything?
 Peter Kriens’ work in Bnd started it
 Convert
 Scalars, Collections, Arrays
 Interfaces, maps, DTOs, JavaBeans, Annotations
 Need predictable behaviour – as little implementation freedom as possible
 Can be customized
RFC 215 – Implementation in Apache Felix (/converter)
6
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Sample conversions
 Examples:
Converter c = new StandardConverter();
// Convert scalars
int i = c.convert("123").to(int.class);
UUID id = c.convert("067e6162-3b6f-4ae2-a171-2470b63dff00").to(UUID.class);
List<String> ls = Arrays.asList("978", "142", "-99");
short[] la = c.convert(ls).to(short[].class);
7
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Convert configuration data into typed information with defaults
Map<String, String> myMap = new HashMap<>();
myMap.put("refresh", "750");
myMap.put("other", "hello");
// Convert map structures
@interface MyAnnotation {
int refresh() default 500;
String temp() default "/tmp";
}
MyAnnotation myAnn = converter.convert(someMap).to(MyAnnotation.class)
int refresh = myAnn.refresh(); // 750
Strine temp = myAnn.temp(); // "/tmp"
8
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Customize your converter
The converter service itself always behaves the same
 Need customizations? Create a new converter: ConverterBuilder
 Change default behaviour of array to scalar conversion
 Convert char[] to String via adapter
// Default behaviour
String s = converter.convert(new char[] {‘h’, ‘i’}).to(String.class); // s = “h”
Converter c = converter.newConverterBuilder()
.rule(char[].class, String.class, MyCnv::caToString, MyCnv::stringToCA)
.build();
String s2 = c.convert(new char[] {‘h’, ‘i’}).to(String.class); // ss=“hi”
9
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Serialization service
 Take an object, turn it into a file/stream, and back
 with the help of the converter
 YAML, JSON, or your own format
 Serializations can be customized with the converter
10
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Example JSON Serializer
@Reference(target="(osgi.mimetype=application/json)")
Serializer jsonSerializer;
public void someMethod() {
Map m = … some map …;
String s = jsonSerializer.serialize(m).toString();
MyBean someBean = … some Java Bean …;
String s2 = jsonSerializer.serialize(someBean).toString();
// and deserialize back
MyBean recreated = jsonSerializer.deserialize(MyBean.class).from(s2);
11
{"prop1": "val1",
"prop2": 42,
"nested":
{"really": true}
}
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Config Admin and Configurator
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
OSGi Configurations
 Configuration Admin Improvements
 Alias for factory configurations
 Optimized change handling
 Revived ConfigurationPlugin
13
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Factory Configuration Alias
14
Configuration
Admin
Factor
y
Cfg
create
PID?
Factory PID
Configuration
Admin
Factor
y
Cfg
create
PID=Factory PID#alias
Factory PID
Alias
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Configuration Handling
15
Configuration
Admin
Cfg
update
Components
Managed
Service
Listeners
Changed?
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Configuration Admin Plugins
16
Configuration
Admin
Component
Plugin
Plugin
Plugin
Plugin
Cfg Cfg‘
prop=${database.url
}
prop=myserver:987
7
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Reusable Configuration Format I
configurations:
- my.special.component:
some_prop: 42
and_another: "some string"
- and.a.factory.cmp#foo
...
- and.a.factory.cmp#bar
...
17
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Reusable Configuration Format II
configurations:
- my.special.component:
some_prop: 42
and_another: "some string"
:configurator:environments:
- dev
- test
18
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
OSGi Configurator
 Configurations as bundle resources
 Environment support
 Binaries
 State handling and ranking
19
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Cluster Information
previously known as Cloud Ecosystems
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Cluster Information
OSGi frameworks running in a distributed environment
 Cloud
 IoT
 <buzzword xyz in the future>
Many frameworks
 New ones appearing
 … and disappearing
 Other entities too, like databases
21
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Cluster Information
Discovery of OSGi frameworks in a distributed environment
 Find out what is available
 get notifications of changes
 Provision your application within the given resources
 Also: non-OSGi frameworks (e.g. Database)
 Monitor your application
 Make changes if needed
RFC 183 – Implementation in Eclipse Concierge
22
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Cluster Information
FrameworkNodeStatus service provides metadata
 Java version
 OSGi version
 OS version
 IP address
 Physical location (country, ISO 3166)
 Metrics
 tags / other / custom
 Provisioning API (install/start/stop/uninstall bundles etc…)
23
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Declarative Service updates
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Declarative Service Updates
 Field Injection of activation objects
 Constructor injection
 Nicer property handling
25
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Activation Objects
26
@Component
public class MyComponent {
public @interface Config {
int easy_max() default 10;
int medium_max() default 50;
int hard_max() default 100;
}
@Activate
private BundleContext bundleContext;
@Activate
private Config config;
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Constructor Injection
27
@Component
public class MyComponent {
@Activate
public MyComponent(
BundleContext bundleContext,
@Reference EventAdmin eventAdmin,
Config config,
@Reference List<Receivers> receivers) {
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Component Properties pre R7
28
@Component(service = ServletContextHelper.class,
property = {
HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=" + AppServletContext.NAME,
HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH + "=/guessinggame"
}
)
public class AppServletContext extends ServletContextHelper {
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Custom Annotations
29
@ComponentPropertyType
public @interface ServletContext {
String osgi_http_whiteboard_context_name();
String osgi_http_whiteboard_context_path();
}
@Component(service = ServletContextHelper.class)
@ServletContext(
osgi_http_whiteboard_context_name = AppServletContext.NAME,
osgi_http_whiteboard_context_path = "/guessinggame“
)
public class AppServletContext extends ServletContextHelper {
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Push Streams
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Push Streams
Like Java 8 streams, but data is pushed
For event-based data, which may or may not be infinite
 Async processing and buffering
 Supports back pressure
 Mapping, filtering, flat-mapping
 Coalescing and windowing
 Merging and splitting
Example:
 Humidity reader/processor stream
 sends an alarm when over 90%
RFC 216 – Implementation will be in Apache Aries
31
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Asynchronous Push Streams example
PushStreamProvider psp = new PushStreamProvider();
try (SimplePushEventSource<Long> ses = psp.createSimpleEventSource(Long.class)) {
ses.connectPromise().then(p -> {
long counter = 0;
while (counter < Long.MAX_VALUE && ses.isConnected()) {
ses.publish(++counter);
Thread.sleep(100);
System.out.println("Published: " + counter);
}
return null;
});
psp.createStream(ses).
filter(l -> l % 2L == 0).
forEach(f -> System.out.println("Consumed even: " + f));
32
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Additional OSGi R7 work
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
And much more...
 Service Decorations
 Http Whiteboard Update
 Transaction Control
 JPA Updates
 Remote Service Intents
34
© 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
R7 Early Spec Draft Available
 https://www.osgi.org/developer/specifications/drafts/
35
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler

More Related Content

PDF
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...
PDF
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
PDF
OSGi Best Practices – Learn how to prevent common mistakes and build robust, ...
PDF
OSGi toolchain from the ground up - Matteo Rulli
PDF
Eclipse + Maven + OSGi has never been so easy - Atllia Kiss
PPTX
Taming startup dynamics - Magnus Jungsbluth & Domagoj Cosic
PPTX
Microservices and OSGi: Better together?
PDF
Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
OSGi Best Practices – Learn how to prevent common mistakes and build robust, ...
OSGi toolchain from the ground up - Matteo Rulli
Eclipse + Maven + OSGi has never been so easy - Atllia Kiss
Taming startup dynamics - Magnus Jungsbluth & Domagoj Cosic
Microservices and OSGi: Better together?
Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

What's hot (20)

PDF
Cloud Foundry vs Docker vs Kubernetes - http://bit.ly/2rzUM2U
PPTX
A year with Cloud Foundry and BOSH
PPT
Apache Aries: A blueprint for developing with OSGi and JEE
PDF
Modular Java applications with OSGi on Apache Karaf
PDF
Introduction to MANTL Data Platform
PDF
Crafting a New Enterprise App Platform with Cloud Foundry, Kubernetes, Istio,...
PDF
Cloud standards interoperability: status update on OCCI and CDMI implementations
PDF
HPE & Cloud Foundry @ CF Summit Berlin 2015
PPTX
Routeサービスを使ったCloud FoundryアプリのAPI管理
PPTX
Oracle OCI APIs and SDK
PPTX
Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy
PDF
Connect Your Functions with RSocket
PPTX
Everyday life with Cloud Foundry in a big organization (Cloud Foundry Days To...
PPT
The Web on OSGi: Here's How
PDF
Introducing Spring Cloud Gateway and API Hub for VMware Tanzu
PDF
D-DAY 2015 Paas ORACLE
PDF
CoreOS 101 - EMC World 2015
PDF
Lattice: A Cloud-Native Platform for Your Spring Applications
PDF
OSGi DevCon 2009 Review
PDF
Karaf ee-apachecon eu-2012
Cloud Foundry vs Docker vs Kubernetes - http://bit.ly/2rzUM2U
A year with Cloud Foundry and BOSH
Apache Aries: A blueprint for developing with OSGi and JEE
Modular Java applications with OSGi on Apache Karaf
Introduction to MANTL Data Platform
Crafting a New Enterprise App Platform with Cloud Foundry, Kubernetes, Istio,...
Cloud standards interoperability: status update on OCCI and CDMI implementations
HPE & Cloud Foundry @ CF Summit Berlin 2015
Routeサービスを使ったCloud FoundryアプリのAPI管理
Oracle OCI APIs and SDK
Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy
Connect Your Functions with RSocket
Everyday life with Cloud Foundry in a big organization (Cloud Foundry Days To...
The Web on OSGi: Here's How
Introducing Spring Cloud Gateway and API Hub for VMware Tanzu
D-DAY 2015 Paas ORACLE
CoreOS 101 - EMC World 2015
Lattice: A Cloud-Native Platform for Your Spring Applications
OSGi DevCon 2009 Review
Karaf ee-apachecon eu-2012
Ad

Viewers also liked (17)

PPTX
How the Bosch Group is making use of OSGi for IoT - Kai Hackbarth
PDF
Java 7 Modularity: a View from the Gallery
PPT
It's beautiful enRoute - Paul Fraser
PDF
Moved to https://slidr.io/azzazzel/osgi-fundamentals
PDF
Moved to https://slidr.io/azzazzel/osgi-for-outsiders
PDF
OSGi & Java in Industrial IoT - More than a Solid Trend - Essential to Scale ...
PDF
Reactive Architectures
PDF
Why OSGi?
PDF
Protobuf & Code Generation + Go-Kit
PDF
OSGi Blueprint Services
PDF
Reactive Programming in Spring 5
PDF
"PostgreSQL для разработчиков приложений", Павел Лузанов, (Постгрес Профессио...
PDF
"Производительность MySQL: что нового?"
PPTX
"Великолепный API без Rest", Констатин Якушев (Badoo)
PPTX
Thrift vs Protocol Buffers vs Avro - Biased Comparison
PPTX
Salesforce Spring 17 Release Overview
PPTX
Reversing Google Protobuf protocol
How the Bosch Group is making use of OSGi for IoT - Kai Hackbarth
Java 7 Modularity: a View from the Gallery
It's beautiful enRoute - Paul Fraser
Moved to https://slidr.io/azzazzel/osgi-fundamentals
Moved to https://slidr.io/azzazzel/osgi-for-outsiders
OSGi & Java in Industrial IoT - More than a Solid Trend - Essential to Scale ...
Reactive Architectures
Why OSGi?
Protobuf & Code Generation + Go-Kit
OSGi Blueprint Services
Reactive Programming in Spring 5
"PostgreSQL для разработчиков приложений", Павел Лузанов, (Постгрес Профессио...
"Производительность MySQL: что нового?"
"Великолепный API без Rest", Констатин Якушев (Badoo)
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Salesforce Spring 17 Release Overview
Reversing Google Protobuf protocol
Ad

Similar to New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler (19)

PDF
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
PDF
BeJUG Meetup - What's coming in the OSGi R7 Specification
PDF
Maximize the power of OSGi in AEM
PPTX
REST Development made Easy with ColdFusion Aether
PDF
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
PPTX
Sst hackathon express
PDF
20200803 - Serverless with AWS @ HELTECH
PDF
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
PDF
Open Architecture in the Adobe Marketing Cloud - Summit 2014
PDF
Developer Insights for Application Upgrade to ColdFusion 2016
PDF
Parse cloud code
PDF
Spring Cloud Function & Project riff #jsug
PDF
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
PDF
Genomics on aws-webinar-april2018
PDF
Continuous Integration and Continuous Delivery for your serverless apps - Seb...
PPTX
AWS DevDay Cologne - Automating building blocks choices you will face with co...
PDF
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
PDF
S903 palla
PPTX
AWS DevDay Vienna - Automating building blocks choices you will face with con...
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
BeJUG Meetup - What's coming in the OSGi R7 Specification
Maximize the power of OSGi in AEM
REST Development made Easy with ColdFusion Aether
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
Sst hackathon express
20200803 - Serverless with AWS @ HELTECH
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
Open Architecture in the Adobe Marketing Cloud - Summit 2014
Developer Insights for Application Upgrade to ColdFusion 2016
Parse cloud code
Spring Cloud Function & Project riff #jsug
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Genomics on aws-webinar-april2018
Continuous Integration and Continuous Delivery for your serverless apps - Seb...
AWS DevDay Cologne - Automating building blocks choices you will face with co...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
S903 palla
AWS DevDay Vienna - Automating building blocks choices you will face with con...

More from mfrancis (20)

PDF
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
PDF
OSGi and Java 9+ - BJ Hargrave (IBM)
PDF
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
PDF
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
PDF
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
PDF
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
PDF
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
PDF
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
PDF
OSGi CDI Integration Specification - Ray Augé (Liferay)
PDF
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
PDF
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
PDF
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
PDF
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
PDF
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
PDF
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
PDF
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
PDF
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
PDF
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
PDF
How to connect your OSGi application - Dirk Fauth (Bosch)
PDF
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
OSGi and Java 9+ - BJ Hargrave (IBM)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
OSGi CDI Integration Specification - Ray Augé (Liferay)
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
How to connect your OSGi application - Dirk Fauth (Bosch)
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Tartificialntelligence_presentation.pptx
PDF
project resource management chapter-09.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Chapter 5: Probability Theory and Statistics
Programs and apps: productivity, graphics, security and other tools
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Building Integrated photovoltaic BIPV_UPV.pdf
MIND Revenue Release Quarter 2 2025 Press Release
SOPHOS-XG Firewall Administrator PPT.pptx
cloud_computing_Infrastucture_as_cloud_p
A comparative analysis of optical character recognition models for extracting...
Tartificialntelligence_presentation.pptx
project resource management chapter-09.pdf
1. Introduction to Computer Programming.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Group 1 Presentation -Planning and Decision Making .pptx
Hindi spoken digit analysis for native and non-native speakers
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Encapsulation theory and applications.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Zenith AI: Advanced Artificial Intelligence
Chapter 5: Probability Theory and Statistics

New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler

  • 1. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. OSGi R7 upcoming specifications David Bosschaert & Carsten Ziegeler | Adobe
  • 2. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Carsten Ziegeler  RnD Adobe Research Switzerland  Member of the Apache Software Foundation  VP of Apache Felix and Sling  OSGi Expert Groups and Board member 2
  • 3. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. David Bosschaert  Adobe R&D Ireland  OSGi EEG co-chair  Apache member and committer  ISO JTC1 SC38 (Cloud Computing) Ireland committee member 3
  • 4. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. OSGi Specification Process  Requirements, Use Cases -> RFP  Technical Specification -> RFC  https://github.com/osgi/design  Reference Implementation  Conformance Test Suite  Spec Chapter 4
  • 5. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Converter and Serialization Service
  • 6. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Object Conversion  Wouldn’t you like to convert anything to everything?  Peter Kriens’ work in Bnd started it  Convert  Scalars, Collections, Arrays  Interfaces, maps, DTOs, JavaBeans, Annotations  Need predictable behaviour – as little implementation freedom as possible  Can be customized RFC 215 – Implementation in Apache Felix (/converter) 6
  • 7. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Sample conversions  Examples: Converter c = new StandardConverter(); // Convert scalars int i = c.convert("123").to(int.class); UUID id = c.convert("067e6162-3b6f-4ae2-a171-2470b63dff00").to(UUID.class); List<String> ls = Arrays.asList("978", "142", "-99"); short[] la = c.convert(ls).to(short[].class); 7
  • 8. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Convert configuration data into typed information with defaults Map<String, String> myMap = new HashMap<>(); myMap.put("refresh", "750"); myMap.put("other", "hello"); // Convert map structures @interface MyAnnotation { int refresh() default 500; String temp() default "/tmp"; } MyAnnotation myAnn = converter.convert(someMap).to(MyAnnotation.class) int refresh = myAnn.refresh(); // 750 Strine temp = myAnn.temp(); // "/tmp" 8
  • 9. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Customize your converter The converter service itself always behaves the same  Need customizations? Create a new converter: ConverterBuilder  Change default behaviour of array to scalar conversion  Convert char[] to String via adapter // Default behaviour String s = converter.convert(new char[] {‘h’, ‘i’}).to(String.class); // s = “h” Converter c = converter.newConverterBuilder() .rule(char[].class, String.class, MyCnv::caToString, MyCnv::stringToCA) .build(); String s2 = c.convert(new char[] {‘h’, ‘i’}).to(String.class); // ss=“hi” 9
  • 10. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Serialization service  Take an object, turn it into a file/stream, and back  with the help of the converter  YAML, JSON, or your own format  Serializations can be customized with the converter 10
  • 11. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Example JSON Serializer @Reference(target="(osgi.mimetype=application/json)") Serializer jsonSerializer; public void someMethod() { Map m = … some map …; String s = jsonSerializer.serialize(m).toString(); MyBean someBean = … some Java Bean …; String s2 = jsonSerializer.serialize(someBean).toString(); // and deserialize back MyBean recreated = jsonSerializer.deserialize(MyBean.class).from(s2); 11 {"prop1": "val1", "prop2": 42, "nested": {"really": true} }
  • 12. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Config Admin and Configurator
  • 13. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. OSGi Configurations  Configuration Admin Improvements  Alias for factory configurations  Optimized change handling  Revived ConfigurationPlugin 13
  • 14. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Factory Configuration Alias 14 Configuration Admin Factor y Cfg create PID? Factory PID Configuration Admin Factor y Cfg create PID=Factory PID#alias Factory PID Alias
  • 15. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Configuration Handling 15 Configuration Admin Cfg update Components Managed Service Listeners Changed?
  • 16. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Configuration Admin Plugins 16 Configuration Admin Component Plugin Plugin Plugin Plugin Cfg Cfg‘ prop=${database.url } prop=myserver:987 7
  • 17. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Reusable Configuration Format I configurations: - my.special.component: some_prop: 42 and_another: "some string" - and.a.factory.cmp#foo ... - and.a.factory.cmp#bar ... 17
  • 18. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Reusable Configuration Format II configurations: - my.special.component: some_prop: 42 and_another: "some string" :configurator:environments: - dev - test 18
  • 19. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. OSGi Configurator  Configurations as bundle resources  Environment support  Binaries  State handling and ranking 19
  • 20. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Cluster Information previously known as Cloud Ecosystems
  • 21. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Cluster Information OSGi frameworks running in a distributed environment  Cloud  IoT  <buzzword xyz in the future> Many frameworks  New ones appearing  … and disappearing  Other entities too, like databases 21
  • 22. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Cluster Information Discovery of OSGi frameworks in a distributed environment  Find out what is available  get notifications of changes  Provision your application within the given resources  Also: non-OSGi frameworks (e.g. Database)  Monitor your application  Make changes if needed RFC 183 – Implementation in Eclipse Concierge 22
  • 23. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Cluster Information FrameworkNodeStatus service provides metadata  Java version  OSGi version  OS version  IP address  Physical location (country, ISO 3166)  Metrics  tags / other / custom  Provisioning API (install/start/stop/uninstall bundles etc…) 23
  • 24. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Declarative Service updates
  • 25. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Declarative Service Updates  Field Injection of activation objects  Constructor injection  Nicer property handling 25
  • 26. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Activation Objects 26 @Component public class MyComponent { public @interface Config { int easy_max() default 10; int medium_max() default 50; int hard_max() default 100; } @Activate private BundleContext bundleContext; @Activate private Config config;
  • 27. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Constructor Injection 27 @Component public class MyComponent { @Activate public MyComponent( BundleContext bundleContext, @Reference EventAdmin eventAdmin, Config config, @Reference List<Receivers> receivers) {
  • 28. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Component Properties pre R7 28 @Component(service = ServletContextHelper.class, property = { HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=" + AppServletContext.NAME, HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH + "=/guessinggame" } ) public class AppServletContext extends ServletContextHelper {
  • 29. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Custom Annotations 29 @ComponentPropertyType public @interface ServletContext { String osgi_http_whiteboard_context_name(); String osgi_http_whiteboard_context_path(); } @Component(service = ServletContextHelper.class) @ServletContext( osgi_http_whiteboard_context_name = AppServletContext.NAME, osgi_http_whiteboard_context_path = "/guessinggame“ ) public class AppServletContext extends ServletContextHelper {
  • 30. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Push Streams
  • 31. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Push Streams Like Java 8 streams, but data is pushed For event-based data, which may or may not be infinite  Async processing and buffering  Supports back pressure  Mapping, filtering, flat-mapping  Coalescing and windowing  Merging and splitting Example:  Humidity reader/processor stream  sends an alarm when over 90% RFC 216 – Implementation will be in Apache Aries 31
  • 32. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Asynchronous Push Streams example PushStreamProvider psp = new PushStreamProvider(); try (SimplePushEventSource<Long> ses = psp.createSimpleEventSource(Long.class)) { ses.connectPromise().then(p -> { long counter = 0; while (counter < Long.MAX_VALUE && ses.isConnected()) { ses.publish(++counter); Thread.sleep(100); System.out.println("Published: " + counter); } return null; }); psp.createStream(ses). filter(l -> l % 2L == 0). forEach(f -> System.out.println("Consumed even: " + f)); 32
  • 33. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Additional OSGi R7 work
  • 34. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. And much more...  Service Decorations  Http Whiteboard Update  Transaction Control  JPA Updates  Remote Service Intents 34
  • 35. © 2016 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. R7 Early Spec Draft Available  https://www.osgi.org/developer/specifications/drafts/ 35