SlideShare uma empresa Scribd logo
1 de 31

Server-side OSGi with
Apache Sling
Felix Meschberger
Day Management AG
124
2

About Felix Meschberger
> Senior Developer, Day Management AG
> fmeschbe@day.com
> http://blog.meschberger.ch
> VP Apache Sling
> Apache Felix
> Apache Jackrabbit
3

Agenda
> Apache Sling
> Why OSGi ?
> What parts of OSGi ?
> Advantages and Problems
> Demo
4

Apache Sling
> REST based web framework
> Content-driven (JCR, JSR-170/283)
> Powered by OSGi
> Scripting inside (Java Scripting, JSR-223)
> Apache Open Source Projekt (http://sling.apache.org)
5

Sling Architecture
OSGi Framework
Felix
Web Console
WebDAV
Server
browserfilesystemdebuggerHTTP
JSR-170/283 API
JCR
repository
resource
resolution
servlet
resolution
standard
servlets
custom
servlets
JSR223
Scripting
JSP
javascript
etc.
6

Sling URL Decomposition
/content/cars/audi/s4.details.html
7

Sling is RESTful
> URLs map to Resources
– Items in the JCR Repository
– Files in the Filesystem
– Content of Bundles
> HTTP Methods map to Script Names
– e.g. cars/POST.jsp
– GET for reading only
– Dilution: POST allowed for any changes (Create, Update, Delete)
> Content Negotiation
– Request URL extension
– Accept request header currently ignored
8

Sling is Object Oriented Web
> Resources are the Object
> Resources maintained in Resource Tree
> Resources accessed by path in the Resource Tree
> Request Method, Extension and Selectors define „Method“ to call
> Resources are typed:
– Resource Type
– Resource Super Type
– „Root Type“: sling/servlet/default
9

Functionality Out-Of-the-Box
> Default Implementations for GET
– Plain Text
– JSON
– XML
> Default Implementation for POST
– Create, Update, Modify content
– Extensible
10

Sling in Action
> Day Communiqué 5 (http://www.day.com/cq5)
> Sakai 3 (http://www.sakaiproject.org)
> Tuberculosis Project
> Idium Web (http://www.idium.no/no/idium_web)
http://cwiki.apache.org/SLING/who-is-using-sling-.html
11

Agenda
> Apache Sling
> Why OSGi ?
> What parts of OSGi ?
> Advantages and Problems
> Demo
12

Requirements for Sling
> Modular and Extensible System
> Declared Dependencies
> Intermodule Communication
> Lightweight Framework
13

Variants
> Do It Yourself
– Well, don't we have other problems to solve ? ;-)
> Spring (before Spring DM)
– First Favourite due to declarative nature
– Systems not really dynamic
– Static application descriptor
> OSGi
– Perfect match to all requirements
14

Agenda
> Apache Sling
> Why OSGi ?
> What parts of OSGi ?
> Advantages and Problems
> Demo
15

OSGi Elements Used
> Framework
> Configuration Admin Service
> Meta Type Service
> Declarative Services
> Event Admin Service
> Log Service
> HTTP Service
16

Launching Sling
> Standalone or Web Application
> Small Footprint Launcher (~30K)
> Framework in its own ClassLoader
> Restart of Framework
> Update of Framework
> Application is Container Agnostic
– Interaction only within the OSGi Framework
– Http Service implementation is the key
17

Configuration Admin Service
> Provides an API to manage Configurations
> Provides functionality to pass configuration to consumers
> Hides persistance problems
> Uses in Sling
– Web Console configuraition editor
– JCR Install updates through repository
18

Metatype Service
> Descriptor to generate GUI for Configuration Management
> Use in Sling
– Descriptor generated by Maven SCR Plugin
– Configuration Admin GUI in Web Console supports Metatype Service
descriptors
19

Declarative Services
> Replace boiler-plate code by descriptors
– Service Registration
– Configuration support
– Service Access
> Dependency Injection
> One of many OSGi Core Extensions:
– Apache Felix Dependency Manager (Predecessor)
– Apache Felix iPOJO (Successor)
– Blueprint (OSGi Compendium Specification R 4.2)
– Peaberry
20

Event Admin Service
> Whiteboard Pattern oriented eventing
> Support for synchronous and asynchronous events
> Uses in Sling
– Base Mechnism to implement Job Scheduling
– Extended to allow for event distribution in Cluster
21

Log Service
> Sling's own implementation
> Based on SLF4J API
> Provides
– OSGi LogService
– SLF4J Logging
– Commons Logging
– Log4F Logging
> Dynamically Configurable (by Configuration Admin Service)
> Log Levels and Log Format per Logger
> Multiple Log Files with size and time rotation
22

Http Service
> Registering Servlets (and Resources) dynamically
> Real Implementation
– Includes Servlet Container
> Bridged Implementation
– Used for Web Application Launcher
– Bridges Servlet Container to OSGi
> Implementation transparent to registered Servlets
23

Extensions
> Apache Felix Web Console
– Extensible Web Based Management
– Jquery UI Based (as of Version 3.0)
> Maven SCR Plugin
– Generates
 Declarative Services Descriptors
 Metatype Service Descriptors
– Supports
 JavaDoc Tags (@scr.component, etc.)
 Java 5 Annotations (@Component, etc.)
> JCR Install
– Deploy Bundles via JCR Repository
– Deploy Configuration Admin configurations via JCR Repository
24

Agenda
> Apache Sling
> Why OSGi ?
> What parts of OSGi ?
> Advantages and Problems
> Demo
25

Advantages
> Declared Dependencies
> Better Isolution through explicit exports and private classes
> Classloader Isolation
> Extensibility built-in, not built-atop
> Dynamism
26

Problems
> Steep Learning Curve
– OSGi Specifications Themselves
– Modularization vs. Monolithic
> Uptime vs. Startup Time
> Legacy Specs und ClassLoader
– JDBC, XML, etc.
> Scripting und ClassLoader
– BundleClassLoaderProxy approach
> Application Packaging
– CRX Content Packages (Day proprietary)
– Karaf features (Sling provides feature.xml)
27

Agenda
> Apache Sling
> Why OSGi ?
> What parts of OSGi ?
> Advantages and Problems
> Demo
29

Links
> Apache Sling – The JCR (Web) Application Framework
http://sling.apache.org
> Apache Felix – OSGi Framework and Compendium Service implementations
http://felix.apache.org
> Apache Jackrabbit – The JCR (JSR-170/283) Reference Implementation
http://jackrabbit.apache.org
> Day Developer's Home
http://dev.day.com
30

Questions
31

Thank you very much !

Felix Meschberger http://www.day.com
Day Management AG fmeschbe@day.com

Mais conteúdo relacionado

Mais procurados

플랫폼 통합을 위한 Client Module 개발 & 배포
플랫폼 통합을 위한 Client Module 개발 & 배포플랫폼 통합을 위한 Client Module 개발 & 배포
플랫폼 통합을 위한 Client Module 개발 & 배포흥래 김
 
Introduction to Wildfly 8 - Marchioni
Introduction to Wildfly 8 -  MarchioniIntroduction to Wildfly 8 -  Marchioni
Introduction to Wildfly 8 - MarchioniCodemotion
 
점진적인 레거시 웹 애플리케이션 개선 과정
점진적인 레거시 웹 애플리케이션 개선 과정점진적인 레거시 웹 애플리케이션 개선 과정
점진적인 레거시 웹 애플리케이션 개선 과정Arawn Park
 
ColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionSaravanaMuthu Jayaraj
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Coremohamed elshafey
 
.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQAvijit Shaw
 
OWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIISOWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIISBilal Haidar
 
Introduction in the play framework
Introduction in the play frameworkIntroduction in the play framework
Introduction in the play frameworkAlexander Reelsen
 
Unpacking .NET Core | EastBanc Technologies
Unpacking .NET Core | EastBanc TechnologiesUnpacking .NET Core | EastBanc Technologies
Unpacking .NET Core | EastBanc TechnologiesEastBanc Tachnologies
 
Owin from spec to application
Owin from spec to applicationOwin from spec to application
Owin from spec to applicationdamian-h
 
Instruction on creating a cluster on jboss eap environment
Instruction on creating a cluster on jboss eap environmentInstruction on creating a cluster on jboss eap environment
Instruction on creating a cluster on jboss eap environmentMadhusudan Pisipati
 
OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)Folio3 Software
 

Mais procurados (20)

플랫폼 통합을 위한 Client Module 개발 & 배포
플랫폼 통합을 위한 Client Module 개발 & 배포플랫폼 통합을 위한 Client Module 개발 & 배포
플랫폼 통합을 위한 Client Module 개발 & 배포
 
This is how we REST
This is how we RESTThis is how we REST
This is how we REST
 
Introduction to Wildfly 8 - Marchioni
Introduction to Wildfly 8 -  MarchioniIntroduction to Wildfly 8 -  Marchioni
Introduction to Wildfly 8 - Marchioni
 
점진적인 레거시 웹 애플리케이션 개선 과정
점진적인 레거시 웹 애플리케이션 개선 과정점진적인 레거시 웹 애플리케이션 개선 과정
점진적인 레거시 웹 애플리케이션 개선 과정
 
ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013
 
ColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introduction
 
JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...
JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...
JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
Introduction to OWIN
Introduction to OWINIntroduction to OWIN
Introduction to OWIN
 
.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ
 
Spring Boot Update
Spring Boot UpdateSpring Boot Update
Spring Boot Update
 
OWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIISOWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIIS
 
Introduction in the play framework
Introduction in the play frameworkIntroduction in the play framework
Introduction in the play framework
 
Unpacking .NET Core | EastBanc Technologies
Unpacking .NET Core | EastBanc TechnologiesUnpacking .NET Core | EastBanc Technologies
Unpacking .NET Core | EastBanc Technologies
 
Owin from spec to application
Owin from spec to applicationOwin from spec to application
Owin from spec to application
 
ASP.NET: Present and future
ASP.NET: Present and futureASP.NET: Present and future
ASP.NET: Present and future
 
Os Mcmahan
Os McmahanOs Mcmahan
Os Mcmahan
 
Instruction on creating a cluster on jboss eap environment
Instruction on creating a cluster on jboss eap environmentInstruction on creating a cluster on jboss eap environment
Instruction on creating a cluster on jboss eap environment
 
OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)
 
Fuse technology-2015
Fuse technology-2015Fuse technology-2015
Fuse technology-2015
 

Semelhante a Server-side OSGi with Apache Sling (Jazoon 2010)

Server-side OSGi with Apache Sling (OSGiDevCon 2011)
Server-side OSGi with Apache Sling (OSGiDevCon 2011)Server-side OSGi with Apache Sling (OSGiDevCon 2011)
Server-side OSGi with Apache Sling (OSGiDevCon 2011)Felix Meschberger
 
Spring_Boot_Microservices-5_Day_Session.pptx
Spring_Boot_Microservices-5_Day_Session.pptxSpring_Boot_Microservices-5_Day_Session.pptx
Spring_Boot_Microservices-5_Day_Session.pptxPrabhakaran Ravichandran
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology StackEberhard Wolff
 
Serverless API with Azure Functions
Serverless API with Azure FunctionsServerless API with Azure Functions
Serverless API with Azure FunctionsAnalben Mehta
 
Using Apache as an Application Server
Using Apache as an Application ServerUsing Apache as an Application Server
Using Apache as an Application ServerPhil Windley
 
Apache Stratos Hangout VI
Apache Stratos Hangout VIApache Stratos Hangout VI
Apache Stratos Hangout VIpradeepfn
 
The Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET EcosystemThe Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET EcosystemJames Avery
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
Nanoservices and Microservices with Java
Nanoservices and Microservices with JavaNanoservices and Microservices with Java
Nanoservices and Microservices with JavaEberhard Wolff
 
"Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?""Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?"Volker Linz
 
JSS build and deployment
JSS build and deploymentJSS build and deployment
JSS build and deploymentDavid Szöke
 
A Tour of Google Cloud Platform
A Tour of Google Cloud PlatformA Tour of Google Cloud Platform
A Tour of Google Cloud PlatformColin Su
 
Clojure Web Development
Clojure Web DevelopmentClojure Web Development
Clojure Web DevelopmentHong Jiang
 
SoftLayer-Extending Plesk Functionality
SoftLayer-Extending Plesk FunctionalitySoftLayer-Extending Plesk Functionality
SoftLayer-Extending Plesk Functionalitywebhostingguy
 
SpringOne Tour: Spring Boot 3 and Beyond
SpringOne Tour: Spring Boot 3 and BeyondSpringOne Tour: Spring Boot 3 and Beyond
SpringOne Tour: Spring Boot 3 and BeyondVMware Tanzu
 
Java on Windows Azure (Cloud Computing Expo 2010)
Java on Windows Azure (Cloud Computing Expo 2010)Java on Windows Azure (Cloud Computing Expo 2010)
Java on Windows Azure (Cloud Computing Expo 2010)David Chou
 

Semelhante a Server-side OSGi with Apache Sling (Jazoon 2010) (20)

Server-side OSGi with Apache Sling (OSGiDevCon 2011)
Server-side OSGi with Apache Sling (OSGiDevCon 2011)Server-side OSGi with Apache Sling (OSGiDevCon 2011)
Server-side OSGi with Apache Sling (OSGiDevCon 2011)
 
Oracle API Gateway
Oracle API GatewayOracle API Gateway
Oracle API Gateway
 
Spring_Boot_Microservices-5_Day_Session.pptx
Spring_Boot_Microservices-5_Day_Session.pptxSpring_Boot_Microservices-5_Day_Session.pptx
Spring_Boot_Microservices-5_Day_Session.pptx
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology Stack
 
Serverless API with Azure Functions
Serverless API with Azure FunctionsServerless API with Azure Functions
Serverless API with Azure Functions
 
Using Apache as an Application Server
Using Apache as an Application ServerUsing Apache as an Application Server
Using Apache as an Application Server
 
Apache Stratos Hangout VI
Apache Stratos Hangout VIApache Stratos Hangout VI
Apache Stratos Hangout VI
 
Cloud APIs Overview Tucker
Cloud APIs Overview   TuckerCloud APIs Overview   Tucker
Cloud APIs Overview Tucker
 
The Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET EcosystemThe Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET Ecosystem
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
Nanoservices and Microservices with Java
Nanoservices and Microservices with JavaNanoservices and Microservices with Java
Nanoservices and Microservices with Java
 
"Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?""Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?"
 
JSS build and deployment
JSS build and deploymentJSS build and deployment
JSS build and deployment
 
A Tour of Google Cloud Platform
A Tour of Google Cloud PlatformA Tour of Google Cloud Platform
A Tour of Google Cloud Platform
 
Clojure Web Development
Clojure Web DevelopmentClojure Web Development
Clojure Web Development
 
SoftLayer-Extending Plesk Functionality
SoftLayer-Extending Plesk FunctionalitySoftLayer-Extending Plesk Functionality
SoftLayer-Extending Plesk Functionality
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
SpringOne Tour: Spring Boot 3 and Beyond
SpringOne Tour: Spring Boot 3 and BeyondSpringOne Tour: Spring Boot 3 and Beyond
SpringOne Tour: Spring Boot 3 and Beyond
 
Java on Windows Azure (Cloud Computing Expo 2010)
Java on Windows Azure (Cloud Computing Expo 2010)Java on Windows Azure (Cloud Computing Expo 2010)
Java on Windows Azure (Cloud Computing Expo 2010)
 

Último

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Último (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Server-side OSGi with Apache Sling (Jazoon 2010)

  • 1.  Server-side OSGi with Apache Sling Felix Meschberger Day Management AG 124
  • 2. 2  About Felix Meschberger > Senior Developer, Day Management AG > fmeschbe@day.com > http://blog.meschberger.ch > VP Apache Sling > Apache Felix > Apache Jackrabbit
  • 3. 3  Agenda > Apache Sling > Why OSGi ? > What parts of OSGi ? > Advantages and Problems > Demo
  • 4. 4  Apache Sling > REST based web framework > Content-driven (JCR, JSR-170/283) > Powered by OSGi > Scripting inside (Java Scripting, JSR-223) > Apache Open Source Projekt (http://sling.apache.org)
  • 5. 5  Sling Architecture OSGi Framework Felix Web Console WebDAV Server browserfilesystemdebuggerHTTP JSR-170/283 API JCR repository resource resolution servlet resolution standard servlets custom servlets JSR223 Scripting JSP javascript etc.
  • 7. 7  Sling is RESTful > URLs map to Resources – Items in the JCR Repository – Files in the Filesystem – Content of Bundles > HTTP Methods map to Script Names – e.g. cars/POST.jsp – GET for reading only – Dilution: POST allowed for any changes (Create, Update, Delete) > Content Negotiation – Request URL extension – Accept request header currently ignored
  • 8. 8  Sling is Object Oriented Web > Resources are the Object > Resources maintained in Resource Tree > Resources accessed by path in the Resource Tree > Request Method, Extension and Selectors define „Method“ to call > Resources are typed: – Resource Type – Resource Super Type – „Root Type“: sling/servlet/default
  • 9. 9  Functionality Out-Of-the-Box > Default Implementations for GET – Plain Text – JSON – XML > Default Implementation for POST – Create, Update, Modify content – Extensible
  • 10. 10  Sling in Action > Day Communiqué 5 (http://www.day.com/cq5) > Sakai 3 (http://www.sakaiproject.org) > Tuberculosis Project > Idium Web (http://www.idium.no/no/idium_web) http://cwiki.apache.org/SLING/who-is-using-sling-.html
  • 11. 11  Agenda > Apache Sling > Why OSGi ? > What parts of OSGi ? > Advantages and Problems > Demo
  • 12. 12  Requirements for Sling > Modular and Extensible System > Declared Dependencies > Intermodule Communication > Lightweight Framework
  • 13. 13  Variants > Do It Yourself – Well, don't we have other problems to solve ? ;-) > Spring (before Spring DM) – First Favourite due to declarative nature – Systems not really dynamic – Static application descriptor > OSGi – Perfect match to all requirements
  • 14. 14  Agenda > Apache Sling > Why OSGi ? > What parts of OSGi ? > Advantages and Problems > Demo
  • 15. 15  OSGi Elements Used > Framework > Configuration Admin Service > Meta Type Service > Declarative Services > Event Admin Service > Log Service > HTTP Service
  • 16. 16  Launching Sling > Standalone or Web Application > Small Footprint Launcher (~30K) > Framework in its own ClassLoader > Restart of Framework > Update of Framework > Application is Container Agnostic – Interaction only within the OSGi Framework – Http Service implementation is the key
  • 17. 17  Configuration Admin Service > Provides an API to manage Configurations > Provides functionality to pass configuration to consumers > Hides persistance problems > Uses in Sling – Web Console configuraition editor – JCR Install updates through repository
  • 18. 18  Metatype Service > Descriptor to generate GUI for Configuration Management > Use in Sling – Descriptor generated by Maven SCR Plugin – Configuration Admin GUI in Web Console supports Metatype Service descriptors
  • 19. 19  Declarative Services > Replace boiler-plate code by descriptors – Service Registration – Configuration support – Service Access > Dependency Injection > One of many OSGi Core Extensions: – Apache Felix Dependency Manager (Predecessor) – Apache Felix iPOJO (Successor) – Blueprint (OSGi Compendium Specification R 4.2) – Peaberry
  • 20. 20  Event Admin Service > Whiteboard Pattern oriented eventing > Support for synchronous and asynchronous events > Uses in Sling – Base Mechnism to implement Job Scheduling – Extended to allow for event distribution in Cluster
  • 21. 21  Log Service > Sling's own implementation > Based on SLF4J API > Provides – OSGi LogService – SLF4J Logging – Commons Logging – Log4F Logging > Dynamically Configurable (by Configuration Admin Service) > Log Levels and Log Format per Logger > Multiple Log Files with size and time rotation
  • 22. 22  Http Service > Registering Servlets (and Resources) dynamically > Real Implementation – Includes Servlet Container > Bridged Implementation – Used for Web Application Launcher – Bridges Servlet Container to OSGi > Implementation transparent to registered Servlets
  • 23. 23  Extensions > Apache Felix Web Console – Extensible Web Based Management – Jquery UI Based (as of Version 3.0) > Maven SCR Plugin – Generates  Declarative Services Descriptors  Metatype Service Descriptors – Supports  JavaDoc Tags (@scr.component, etc.)  Java 5 Annotations (@Component, etc.) > JCR Install – Deploy Bundles via JCR Repository – Deploy Configuration Admin configurations via JCR Repository
  • 24. 24  Agenda > Apache Sling > Why OSGi ? > What parts of OSGi ? > Advantages and Problems > Demo
  • 25. 25  Advantages > Declared Dependencies > Better Isolution through explicit exports and private classes > Classloader Isolation > Extensibility built-in, not built-atop > Dynamism
  • 26. 26  Problems > Steep Learning Curve – OSGi Specifications Themselves – Modularization vs. Monolithic > Uptime vs. Startup Time > Legacy Specs und ClassLoader – JDBC, XML, etc. > Scripting und ClassLoader – BundleClassLoaderProxy approach > Application Packaging – CRX Content Packages (Day proprietary) – Karaf features (Sling provides feature.xml)
  • 27. 27  Agenda > Apache Sling > Why OSGi ? > What parts of OSGi ? > Advantages and Problems > Demo
  • 28. 29  Links > Apache Sling – The JCR (Web) Application Framework http://sling.apache.org > Apache Felix – OSGi Framework and Compendium Service implementations http://felix.apache.org > Apache Jackrabbit – The JCR (JSR-170/283) Reference Implementation http://jackrabbit.apache.org > Day Developer's Home http://dev.day.com
  • 31.  Felix Meschberger http://www.day.com Day Management AG fmeschbe@day.com