My presentation from ApacheCon Europe 2009 in Amsterdam. It's a introduction into the core concepts of OSGi and provides at the same time usefull information for getting started.
Soccnx III - Using Social Controls in XPagesLetsConnect
Speakers: Martin Donnelly & Tony McGuckin
There is a lot of talk about "social" these days - social applications, social business, social media, social services and so on. This session uses a definition of "social" in the context of IBM Domino XPages, custom application development and IBM Domino/IBM XWork Server. It describes new social requirements, maps them to technologies and shows how the XPages Extension Library helps you create powerful social solutions to integrate with IBM Connections and other social providers within your custom application development. People are connected more than ever, blurring the line between business and private life. For example often employees have Twitter accounts that they use to tweet both private and business messages. Many employees use their private smartphones to access business applications and data. Furthermore, information is scattered more than ever, within enterprises and in public social networks, within on premise systems and on the cloud. The corporate inbox is no longer only the mail inbox, new notifications also come in via IBM Connections, Facebook, Google+, Twitter, LinkedIn, etc! The XPages Extension Library provides utilities that make integration of Social APIs really easy, including a new storage facility for OAuth application and consumer tokens. IBM Domino XPages is on the fast track to help make your applications social. Participate in this session to see the latest contributions to the XPages Extension Library for Social Business. XPages is ready today, are you?
Soccnx III - Using Social Controls in XPagesLetsConnect
Speakers: Martin Donnelly & Tony McGuckin
There is a lot of talk about "social" these days - social applications, social business, social media, social services and so on. This session uses a definition of "social" in the context of IBM Domino XPages, custom application development and IBM Domino/IBM XWork Server. It describes new social requirements, maps them to technologies and shows how the XPages Extension Library helps you create powerful social solutions to integrate with IBM Connections and other social providers within your custom application development. People are connected more than ever, blurring the line between business and private life. For example often employees have Twitter accounts that they use to tweet both private and business messages. Many employees use their private smartphones to access business applications and data. Furthermore, information is scattered more than ever, within enterprises and in public social networks, within on premise systems and on the cloud. The corporate inbox is no longer only the mail inbox, new notifications also come in via IBM Connections, Facebook, Google+, Twitter, LinkedIn, etc! The XPages Extension Library provides utilities that make integration of Social APIs really easy, including a new storage facility for OAuth application and consumer tokens. IBM Domino XPages is on the fast track to help make your applications social. Participate in this session to see the latest contributions to the XPages Extension Library for Social Business. XPages is ready today, are you?
Monitoring OSGi Applications with the Web ConsoleCarsten Ziegeler
Presentation from the OSGi Community Event / EclipseCon Europe 2013
This session introduces the latest version of the famous Apache Felix web console which allows to monitor and inspect OSGi web applications through the browser. The web console is based on a flexible plugin mechanism to add custom information and functionality. Learn how to write your own extensions and how to leverage the available functionality for monitoring and troubleshooting OSGi installations.
Use Case: Building OSGi Enterprise Applications (QCon 14)Carsten Ziegeler
Use Case presentation from QCon 14. It presents the migration of Adobe's Experience Manager (formerly Communique) to OSGi. Common pitfalls and solutions are presented based on open source solutions from the Apache Software Foundation
Presentation from OSGi Community Event / EclipseCon Europe 2013
One of the major topics the OSGi alliance is working on is a proposal for distributed eventing especially in the cloud. This session starts with an overview of the current state in the alliance and then shows already available solutions from the Apache Sling open source project. This includes distributing events through event admin and controlled processing of events by exactly one processor in distributed installations. The current implementations will be set in context to the ongoing activations in the alliance.
The Apache Felix Web Console has been created out of a need to remotely administer an OSGi Framework. This administration includes maintenance of bundles, editing Configuration, and introspecting the system in terms of identifying services and Declarative Services components. In addition the Web Console offers a plugin-model for it to be easily extended.
An overview of Domino 8.5 XPages, the new RAD (rapid application development) environment for developing Domino web applications. This covers what is XPages, XPages Basics, XPages Advanced Development, and XPages futures. This session was given by Philippe Riand of IBM and John Head of PSC Group, LLC.
MarvinSketch and MarvinView: Tips And Tricks: US UGM 2008ChemAxon
This general presentation on Marvin will summarize the features, and detail the latest additions and improvements. The most important and newest features will be demonstrated, providing tips and tricks for their quicker and easier usage. The list of potential future features will also be presented, including the 'traditional' voting session. For latest developments see: http://www.chemaxon.com/product/marvin_land.html
OpenGL - point & line design
introduce the construction of displayers (CRT, Flat-panel, LCD, PDP, projector...)
those render is based on graphic skills (point & line)
EffectiveUI Senior Software Architect RJ Owen’s presentation from Flash Camp Denver, October 2010. It covers the basics of Adobe Flex framework, how to slice frames, Flex 4 component theory and life-cycle.
EffectiveUI Senior Software Architect RJ Owen’s presentation from Flash Camp Denver, October 2010. Covers the basics of Adobe Flex framework, how to slice frames, Flex 4 component theory and life-cycle.
Monitoring OSGi Applications with the Web ConsoleCarsten Ziegeler
Presentation from the OSGi Community Event / EclipseCon Europe 2013
This session introduces the latest version of the famous Apache Felix web console which allows to monitor and inspect OSGi web applications through the browser. The web console is based on a flexible plugin mechanism to add custom information and functionality. Learn how to write your own extensions and how to leverage the available functionality for monitoring and troubleshooting OSGi installations.
Use Case: Building OSGi Enterprise Applications (QCon 14)Carsten Ziegeler
Use Case presentation from QCon 14. It presents the migration of Adobe's Experience Manager (formerly Communique) to OSGi. Common pitfalls and solutions are presented based on open source solutions from the Apache Software Foundation
Presentation from OSGi Community Event / EclipseCon Europe 2013
One of the major topics the OSGi alliance is working on is a proposal for distributed eventing especially in the cloud. This session starts with an overview of the current state in the alliance and then shows already available solutions from the Apache Sling open source project. This includes distributing events through event admin and controlled processing of events by exactly one processor in distributed installations. The current implementations will be set in context to the ongoing activations in the alliance.
The Apache Felix Web Console has been created out of a need to remotely administer an OSGi Framework. This administration includes maintenance of bundles, editing Configuration, and introspecting the system in terms of identifying services and Declarative Services components. In addition the Web Console offers a plugin-model for it to be easily extended.
An overview of Domino 8.5 XPages, the new RAD (rapid application development) environment for developing Domino web applications. This covers what is XPages, XPages Basics, XPages Advanced Development, and XPages futures. This session was given by Philippe Riand of IBM and John Head of PSC Group, LLC.
MarvinSketch and MarvinView: Tips And Tricks: US UGM 2008ChemAxon
This general presentation on Marvin will summarize the features, and detail the latest additions and improvements. The most important and newest features will be demonstrated, providing tips and tricks for their quicker and easier usage. The list of potential future features will also be presented, including the 'traditional' voting session. For latest developments see: http://www.chemaxon.com/product/marvin_land.html
OpenGL - point & line design
introduce the construction of displayers (CRT, Flat-panel, LCD, PDP, projector...)
those render is based on graphic skills (point & line)
EffectiveUI Senior Software Architect RJ Owen’s presentation from Flash Camp Denver, October 2010. It covers the basics of Adobe Flex framework, how to slice frames, Flex 4 component theory and life-cycle.
EffectiveUI Senior Software Architect RJ Owen’s presentation from Flash Camp Denver, October 2010. Covers the basics of Adobe Flex framework, how to slice frames, Flex 4 component theory and life-cycle.
UI5con 2018: UI5 Evolution - The Core ChangesAndreas_Ecker
Join UI5 on its journey to evolve into a state-of-the-art Universal JavaScript Framework. While keeping the enterprise-proven qualities you see how fundamental changes are applied to the Core of and throughout the framework.
Featuring a layered architecture, Asynchronous Module Definition (AMD), clear dependencies, new module loaders, async variants replacing sync API, and more. Learn how you benefit from the modularization of UI5 and its complementary build and development tooling.
Understand the paradigm shift introduced by UI5 Evolution, embrace the new capabilities and leverage them for your current and future projects.
New Features regarding the Main Theme in APEX 19.1 and 19.2 New Features regarding Template Options, Theme Roller and Icons.
Presentation was held at the DOAG conference 2019 in nuremberg.
Presentation from OSGi Community Event / EclipseCon Europe 2013
Together with David Bosschaert
Carsten and David will look at new and updated OSGi specs that are in the works. Developing components has never been easier. Learn more about the new Prototype Service Factory, OSGi/CDI integration and the improved annotation support for Declarative Services.
Many people are realizing that OSGi is a great foundation technology for fluid cloud-computing architectures where the deployments change dynamically and applications don't simply scale by duplicating the entire VMs but by providing extra capacity exactly to those components that need it. Work is being done to create standards that facilitate such a portable OSGi cloud in ‘Cloud Ecosystems’ and the REST API specs. Learn more about these and other upcoming specs during this talk.
Presentation from the ApacheCon EU 2008 in Amsterdam.
JCR In Action - Content-based Applications with Apache Jackrabbit.
The Java Content Repository API (JCR) is the ideal solution to store hierarchical structured content and develop content-oriented applications. To demonstrate the basic architecture of such applications, an example content management application will be developed during the session. Basic techniques will be explained including navigation, searching and observations by using the Apache Jackrabbit project.
Presentation from the ApacheCon EU 2008 in Amsterdam.
The SCR plugin for Maven from the Apache Felix project is a simple but powerful tool. In just 15min you'll learn how to develop services in Java to be used in an OSGi environment and how to package and deploy them. You should have knowledge about component oriented development for Java; the talk will also cover the bare minimum OSGi knowledge, but this is not an OSGi introduction.
1. OSGi
Embrace Change
A Developer's Quickstart
Carsten Ziegeler
cziegeler@apache.org
2. About
• Member of the ASF
– Sling, Felix, Cocoon, Portals, Sanselan,
Excalibur, Incubator
– PMC: Felix, Portals, Cocoon, Incubator,
Excalibur (Chair)
• RnD Team at Day Software
• Article/Book Author, Technical Reviewer
• JSR 286 Spec Group (Portlet API 2.0)
2
3. Agenda
1 Motivation
2 And Action...
3 Why OSGi?
4 Apache Felix
5-7 Bundles, Services, Dynamics
8 Famous Final Words
3
5. Motivation
• Modularity is key
– Manage growing complexity
– Support dynamic extensibility
• No solution in standard Java
– OSGi: tried and trusted
• Embrace change – Embrace OSGi
– Only a few concepts – easy to get started
5
7. Paint Program
• Swing-based paint program
• Interface SimpleShape for drawing
– Different implementations
– Each shape has name and icon properties
– Available shapes are displayed in tool bar
• Select shape and then select location
– Shapes can be dragged, but not resized
• Support dynamic deployment of shapes
7
8. Shape Abstraction
• Conceptual SimpleShape interface
public interface SimpleShape
{
/**
* Method to draw the shape of the service.
* @param g2 The graphics object used for
* painting.
* @param p The position to paint the shape.
**/
public void draw(Graphics2D g2, Point p);
}
8
11. High-Level Architecture
Best practice – Try to
centralize interaction
with OSGi API * that
so
1 1 1
Shape Drawing componentsDefault
other
Tracker Frame POJOs...only Shape
remain
Shape Tracker will 1
1 1
interact with OSGi API.
1 * 1
Shape Simple
Component Shape
11
12. High-Level Architecture
1 1 1 *
Shape Drawing Default
Tracker Frame Shape
1 1 1
1 * 1
Main application
window – gets
Shape Simple
dynamically injected
Component Shape
with available shapes
from the Shape
Tracker.
12
14. High-Level Architecture
Injected “proxied” shape
1 1 1 *
implementation to hide
Shape Drawing Default
aspects of dynamism
Tracker Frame Shape
and provide a default
implementation. 1
1 1
1 * 1
Shape Simple
Actual shape
Component Shape
implementation.
14
15. High-Level Architecture
Component that draws the
shape in parent frame; looks
up shape via Drawing 1
1 1 *
Shape Drawing Frame Default
Tracker Frame Shape
rather than having a direct
reference.
1 1 1
1 * 1
Shape Simple
Component Shape
15
19. Class Path Hell
• What libs are used? Versions?
• Which jar is used? Version?
• No difference between private and public
classes
19
20. Java's Shortcomings
• Simplistic version handling
– “First” class from class path
– JAR files assume backwards compatibility at
best
• Implicit dependencies
– Dependencies are implicit in class path
ordering
– JAR files add improvements for extensions,
but cannot control visibility
20
21. Java's Shortcomings
• Split packages by default
– Class path approach searches until it finds,
which leads to shadowing or version mixing
• Limited scoping mechanisms
– No module access modifier
– Impossible to declare all private stuff as
private
• Missing module concept
– Classes are too fine grained, packages are
too simplistic, class loaders are too low level
• No deployment/lifecycle support
21
22. Java Dynamism Limitations
• Low-level support for dynamics
– Class loaders are complicated to use and
error prone
• Support for dynamics is still purely
manual
– Must be completely managed by the
programmer
– Leads to many ad hoc, incompatible
solutions
• Limited deployment support
22
23. OSGi Technology
• Adds modularity and dynamics
– Module concept
• Explicit sharing (importing and exporting)
– Automatic management of code
dependencies
• Enforces sophisticated consistency rules for class
loading
– Life-cycle management
• Manages dynamic deployment and configuration
• Service Registry
– Publish/find/bind
23
25. OSGi Alliance
• Industry consortium
• OSGi Service Platform specification
– Framework specification for hosting
dynamically downloadable services
– Standard service specifications
• Several expert groups define the
specifications
– Core Platform Expert Group (CPEG)
– Mobile Expert Group (MEG)
– Vehicle Expert Group (VEG)
– Enterprise Expert Group (EEG)
25
26. Apache Felix
• Top-level project (March 2007)
• Healthy and diverse community
• OSGi R4 (R4.1) implementation
– Framework (frequent releases)
– Services (continued development)
• Log, Package Admin, Event Admin,
Configuration Admin, Declarative Services,
Meta Type, Deployment Admin (and more)
– Moving towards upcoming R4.2
• Tools
– Maven Plugins, Web Console, iPojo
26
27. Apache Felix
• Growing community
– Several code grants and contributions
– Various (Apache) projects use Felix / have
expressed interest in Felix and/or OSGi
• e.g., ServiceMix, Directory, Sling, Tuscany
• Roadmap
– Continue toward R4 and R4.1 compliance
• some parts consider pre R4.2 already
27
29. OSGi Architectural Overview
Bundle
k
or
ew
ma
Fr
OSGi
Java
Operating System
Driver Driver Driver
Hardware
29
30. OSGi Framework Layering
L3 – Provides a publish/find/bind service model to
SERVICE MODEL decouple bundles
L2 - Manages the life cycle of bundle in a bundle
repository without requiring the VM be restarted
LIFECYCLE
L1 - Creates the concept of modules (aka. bundles)
that use classes from each other in a controlled way
MODULE according to system and bundle constraints
Execution L0 -
•OSGi Minimum Execution Environment
Environment
CDC •CDC/Foundation
CDC •JavaSE
30
31. OSGi Framework
• Component-oriented framework
• Module concept: Bundles
– Separate class loader -> graph
– Package sharing and version management
– Life-cycle management and notification
• Dynamic!
– Install, update, and uninstall at runtime
• Runs multiple applications and services in
a single VM
31
32. OSGi Modularity
• Explicit code boundaries and
dependencies
– Package imports and exports
• Multi-version support
– Version ranges for dependencies
• Class space is managed by OSGi
• Managed life cycle
– Dynamic install, update, uninstall
32
33. OSGi Modularity - Example
• Dynamic module deployment and
dependency resolution
Provided package
existing
bundle
OSGi framework
33
34. OSGi Modularity - Example
• Dynamic module deployment and
dependency resolution
existing
bundle
install
bundle.jar
OSGi framework
34
35. OSGi Modularity - Example
• Dynamic module deployment and
dependency resolution
existing
resolve bundle
bundle
OSGi framework
35
37. Creating a Bundle
• Plain old JAR with additional metadata in
the manifest
– Bundle identifier, version, exports, imports
• Tools
– Text editor (Manifest)
– Eclipse (PDE)
– Bundle packaging tools
• BND from Peter Kriens
• Apache Felix maven-bundle-plugin based on
BND
37
38. Maven is Your Friend
• Apache Felix Maven Bundle Plugin
• Creates metadata based on POM
– Automatically: import packages
– Manually: export and private packages
• Analyses classes for consistency
• Allows to include dependencies
• Creates final bundle JAR file
38
43. Be Modular!
• Create clean package spaces
– public vs private
• Provide Bundles
– Add manifest information
• Think about dependencies
– Additional bundle vs include
– Optional
– Version ranges
• Benefits even without OSGi
43
45. OSGi Services (1/3)
• Service-oriented architecture
– Publish/find/bind
– Possible to use modules without services
Service
Registry
Find
Publish
Service
Description
Service
Service
Requester
Provider Interact
45
46. OSGi Services (2/3)
• An OSGi application is...
– A collection of bundles that interact via
service interfaces
– Bundles may be independently developed
and deployed
– Bundles and their associated services may
appear or disappear at any time
• Resulting application follows a Service-
Oriented Component Model approach
46
47. OSGi Services (3/3)
• Dynamic service lookup
Provided service
Provided package
existing
bundle
component
OSGi framework
47
51. OSGi Services (3/3)
• Dynamic service lookup
manual service
dependency resolution
existing
bundle
component
OSGi framework
51
52. OSGi Services Advantages
• Lightweight services
– Lookup is based on interface name
– Direct method invocation
• Good design practice
– Separates interface from implementation
– Enables reuse, substitutability, loose coupling,
and late binding
52
53. OSGi Services Advantages
• Dynamic
– Loose coupling and late binding
• Application's configuration is simply the set of
deployed bundles
– Deploy only the bundles that you need
53
54. OSGi Services Issues
• More sophisticated, but more complicated
– Requires a different way of thinking
• Things might appear/disappear at any moment
– Must manually resolve and track services
• There is help
– Service Tracker
• Still somewhat of a manual approach
– Declarative Services, Spring DM, iPOJO
• Sophisticated service-oriented component
frameworks
• Automated dependency injection and more
• More modern, POJO-oriented approaches
54
56. Everything is a Bundle
• How to structure bundles?
– API vs implementation bundle
– Fine-grained vs coarse-grained
– No “One Size Fits All”
• Simple Rules
– Stable code vs changing code
– Optional parts
56
57. Third Party Libraries
• Use as bundles
– Project delivers already a bundle
• Apache Commons, Apache Sling etc.
– Use special bundle repositories
• Felix Commons, Spring etc.
• But check included metadata!
– Create your own wrapper
• Easy with the Felix maven bundle plugin
• Include in your bundle
– Again: easy with the Felix maven bundle
plugin
57
58. Everything is Dynamic
• Bundles can come and go!
– Packages
– Services
• Services can come and go!
• Be prepaired!
– Application code must handle dynamics!
58
59. Dynamic Services
• OSGi Declarative Services Specification
– XML Configuration
• Contained in bundle
• Manifest entry pointing to config(s)
– Publishing services
– Consuming services
• Policy (static,dynamic), cardinality (0..1, 1..1, 0..n)
– Default configuration
– Service Lifecycle management
• Various Implementations
– Apache Felix SCR
59
64. Declarative Services
• Reads XML configs on bundle start
• Registers services
• Keeps track of dependencies
– Starts/stops services
• Invokes optional activation and
deactivation method
– Provides access to configuration
• Caution: A service is by default only
started if someone else uses it!
– Immediate flag forces a service start
64
66. Config Admin and Metatype
• OSGi Config Admin
– Configuration Manager
– Persistence storage
API to retrieve/update/remove configs
–
– Works with Declarative Services
• OSGi Metatype Service
– Description of bundle metadata
– Description of service configurations
• Various Implementations
– Apache Felix
66
67. Maven SCR Plugin
• Combines everything (DS, ConfigAdmin,
Metatype, Maven)
• Annotation-based (works for 1.4+)
• Annotate components
– Properties with default values
– Service providers
– Services references (policy and cardinality)
• Generates DS XML
• Generates Metatype config
• Generates Java code
67
71. Service Whiteboard Pattern
• Clients register a service interface
• Service tracker for registered services
• Simple, more robust, leverages the OSGi
service model
• Service whiteboard pattern
– It is an Inversion of Control pattern
71
72. Externder Model
• Bundles contain manifest entries
– Like available service classes
• Custom bundle tracker
– Keeps track of bundles
– Specifically, STARTED and STOPPED events
– Checks bundles manifest data
• Creates/removes services
72
74. Conclusion
• Modulary and dynamics are required by
todays applications
• OSGi technology addresses Java's
limitations in these areas
– Available today and growing in importance
• Development is straightforward and
provides immediate benefits
• Apache Felix is ready when you are!
74
75. Suggestions for Development
• Think about modularity!
– Clean package space
• Think about dynamics!
• Consider OSGi
• Check out the spec and other projects
• Minimize dependencies to OSGi
– but only if it makes sense
75
76. Suggestions for Using OSGi
• Think about dynamics
– Optional bundles
– Optional services
– Handle these cases
• Use your preferred logging library
– LogManager takes care
• Use available tooling
• Be part of the community!
76
77. Check It Out
• Read the OSGi spec
– Framework
– Config Admin, Metatype, Declarative
Services
– Deployment Admin, OBR
• Download Apache Felix
– Try tutorials and samples
• Download Apache Sling :)
• Explore the web – embrace OSGi
77