Skip to main content
OSGI with Apache Karaf
Introduction Gerald Preissler
Talend Professional Services
Consultant & Architect Talend ESB CXF
Camel
Karaf
ActiveMQ
Talend Open Studio [email_address] Document Identifier
Agenda Why OSGI?
What is Apache Karaf?
How can I develop for Apache Karaf?
What are the advanced features?
What is coming? Document Identifier
Why OSGI? Component-based modularity
SOA in the small
Standard services Document Identifier
Component-based modularity An individual component is a bundle A bundle is a jar file with additional metadata Imports Exports Dependency management is enabled through metadata Imports Exports Bundle lifecycle is controlled by the OSGI container Classloading environments are separated between bundles Multiple bundles can be combined into a feature Feature Document Identifier Bundle Classes & Ressources Metadata Classes & Ressources Metadata
Component-based modularity Metadata is located in MANIFEST.MF Can be created manually Peter Krien's bnd tools and derived utilities provide a convenient way to create it automagically Manifest­Version: 1.0 Bundle­ManifestVersion: 2 Bundle­Version: 2.1.6 Bundle­Name: Talend Logger Bundle­SymbolicName: t_logger Export­Package: org.talend.osgi.logger;version=2.1 Import­Package: org.apache.log4j;version=”[1.2,2)” Private­Package: org.talend.osgi.logger.internal Document Identifier
SOA in the small ● OSGi Service Registry allows a bundle to expose or use  services ● A service is specified by an interface ● A provider  bundle registers an interface implementation Service Registry Bundle Bundle register get listen ● A consumer bundle searches and uses a service Document Identifier B A Interface Impl Interface