Server-side OSGi with Apache Sling (OSGiDevCon 2011)

  • 3,689 views
Uploaded on

Apache Sling is an innovative REST based Web Framework which has been developped from the ground up as an OSGi based server side application. After a short introduction to Sling itself I will also …

Apache Sling is an innovative REST based Web Framework which has been developped from the ground up as an OSGi based server side application. After a short introduction to Sling itself I will also show why OSGi has been chosen as the basis for the application.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
3,689
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
154
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Server Side OSGi with Apache Sling Felix Meschberger | Sr. Computer Scientist, Adobe Systems
  • 2. About Felix Meschberger
    • Senior Computer Scientist
    • 3. fmeschbe@adobe.com
    • 4. http://blog.meschberger.ch
    • 5. OSGi Implementations @ Apache Felix
      • Declarative Services
      • 6. Configuration Admin
      • 7. Metatype Services
    • VP Apache Sling
    • 8. OSGi Alliance Supporter
  • 9. Agenda
      • Apache Sling
      • 10. Why OSGi ?
      • 11. What parts of OSGi ?
      • 12. Advantages and Problems
  • 13. Apache Sling
      • REST based web framework
      • 14. Content-driven (JCR, JSR-170/283)
      • 15. Powered by OSGi
      • 16. Scripting inside (Java Scripting, JSR-223)
      • 17. Apache Open Source Projekt (http://sling.apache.org)
  • 18. Sling Architecture OSGi Framework Felix Web Console WebDAV Server browser filesystem debugger HTTP JSR-170/283 API JCR repository resource resolution servlet resolution standard servlets custom servlets JSR223 Scripting JSP javascript etc.
  • 19. Sling is RESTful
      • URLs map to Resources
        • Items in the JCR Repository
        • 20. Files in the Filesystem
        • 21. Content of Bundles
      • HTTP Methods map to Script Names
        • e.g. cars/POST.jsp
        • 22. GET for reading only
        • 23. Dilution: POST allowed for any changes (Create, Update, Delete)
      • Content Negotiation
        • Request URL extension
        • 24. Accept request header currently ignored
  • 25. Sling URL Decomposition /content/cars/audi/s4.details.html
  • 26. Sling is Object Oriented Web
      • Resources are the Object
      • 27. Resources maintained in Resource Tree
      • 28. Resources accessed by path in the Resource Tree
      • 29. Request Method, Extension and Selectors define „Method“ to call
      • 30. Resources are typed:
        • Resource Type
        • 31. Resource Super Type
        • 32. „Root Type“: sling/servlet/default
  • 33. Functionality Out-Of-the-Box
      • Default Implementations for GET
      • Default Implementation for POST
        • Create, Update, Modify content
        • 36. Extensible
  • 37. Sling in Action
      • Day Communiqué 5 (http://www.day.com/cq5)
      • 38. Sakai 3 (http://www.sakaiproject.org)
      • 39. Tuberculosis Project
      • 40. Idium Web (http://www.idium.no/no/idium_web)
      • 41. http://cwiki.apache.org/SLING/who-is-using-sling-.html
  • 42. Agenda
      • Apache Sling
      • 43. Why OSGi ?
      • 44. What parts of OSGi ?
      • 45. Advantages and Problems
  • 46. Requirements for Sling
      • Modular and Extensible System
      • 47. Declared Dependencies
      • 48. Intermodule Communication
      • 49. Lightweight Framework
  • 50. Variants
      • Do It Yourself
        • Well, don't we have other problems to solve ? ;-)
      • Spring (before Spring DM)
        • First Favourite due to declarative nature
        • 51. Systems not really dynamic
        • 52. Static application descriptor
      • OSGi
        • Perfect match to all requirements
  • 53. Agenda
      • Apache Sling
      • 54. Why OSGi ?
      • 55. What parts of OSGi ?
      • 56. Advantages and Problems
  • 57. OSGi Elements Used
  • 64. Launching Sling
      • Standalone or Web Application
      • 65. Small Footprint Launcher (~30K)
      • 66. Framework in its own ClassLoader
      • 67. Restart of Framework
      • 68. Update of Framework
      • 69. Application is Container Agnostic
        • Interaction only within the OSGi Framework
        • 70. Http Service implementation is the key
  • 71. Configuration Admin Service
      • Provides an API to manage Configurations
      • 72. Provides functionality to pass configuration to consumers
      • 73. Hides persistance problems
      • 74. Uses in Sling
        • Web Console configuration editor
        • 75. JCR Install updates through repository
  • 76. Metatype Service
      • Descriptor to generate GUI for Configuration Management
      • 77. Use in Sling
        • Descriptor generated by Maven SCR Plugin
        • 78. Configuration Admin GUI in Web Console supports Metatype Service descriptors
  • 79. Declarative Services
      • Replace boiler-plate code by descriptors
        • Service Registration
        • 80. Configuration support
        • 81. Service Access
      • Dependency Injection
      • 82. One of many OSGi Core Extensions:
        • Apache Felix Dependency Manager (Predecessor)
        • 83. Apache Felix iPOJO (Successor)
        • 84. Blueprint (OSGi Compendium Specification R 4.2)
        • 85. Peaberry
  • 86. Event Admin Service
      • Whiteboard Pattern oriented eventing
      • 87. Support for synchronous and asynchronous events
      • 88. Uses in Sling
        • Base Mechnism to implement Job Scheduling
        • 89. Extended to allow for event distribution in Cluster
  • 90. Log Service
      • Sling's own implementation
      • 91. Based on SLF4J API
      • 92. Provides
      • Dynamically Configurable (by Configuration Admin Service)
      • 96. Log Levels and Log Format per Logger
      • 97. Multiple Log Files with size and time rotation
  • 98. Http Service
      • Registering Servlets (and Resources) dynamically
      • 99. Real Implementation
        • Includes Servlet Container
      • Bridged Implementation
        • Used for Web Application Launcher
        • 100. Bridges Servlet Container to OSGi
      • Implementation transparent to registered Servlets
  • 101. Extensions
      • Apache Felix Web Console
        • Extensible Web Based Management
        • 102. JQuery UI Based (as of Version 3.0)
      • Maven SCR Plugin (Apache Felix)
        • Generates
          • Declarative Services Descriptors
          • 103. Metatype Service Descriptors
        • Supports
          • JavaDoc Tags (@scr.component, etc.)
          • 104. Java 5 Annotations (@Component, etc.)
      • JCR Install (Apache Sling)
        • Deploy Bundles via JCR Repository
        • 105. Deploy Configuration Admin configurations via JCR Repository
  • 106. Agenda
  • 110. Advantages
      • Declared Dependencies
      • 111. Better Isolation through explicit exports and private classes
      • 112. Classloader Isolation
      • 113. Extensibility built-in, not built-ontop
      • 114. Dynamism
  • 115. Problems
      • Steep Learning Curve
        • OSGi Specifications Themselves
        • 116. Modularization vs. Monolithic
      • Uptime vs. Startup Time
      • 117. Legacy Specs and ClassLoader
        • JDBC, XML, etc.
      • Scripting und ClassLoader
        • BundleClassLoaderProxy approach
      • Application Packaging
        • CRX Content Packages (Adobe proprietary)
        • 118. Karaf features (Sling provides feature.xml)
  • 119. Links
      • Apache Sling The JCR (Web) Application Framework
      • 120. http://sling.apache.org
      • 121. Apache Felix OSGi Framework and Compendium Service implementations
      • 122. http://felix.apache.org
      • 123. Apache Jackrabbit The JCR (JSR-170/283) Reference Implementation
      • 124. http://jackrabbit.apache.org
      • 125. Day Developer's Home
      • 126. http://dev.day.com
  • 127. Questions
  • 128. Thank you very much !
  • 129.