OSGi & Spring combined

Similar documents
Spring and OSGi. Martin Lippert akquinet agile GmbH Bernd Kolb Gerd Wütherich

Spring Dynamic Modules

Modular Java Applications with Spring, dm Server and OSGi

OSGi on the Server. Martin Lippert (it-agile GmbH)

Patterns and Best Practices for Dynamic OSGi Applications

Patterns and Best Practices for dynamic OSGi Applications

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

Spring Framework 2.5: New and Notable. Ben Alex, Principal Software Engineer, SpringSource

Equinox Project Update

Breaking Apart the Monolith with Modularity and Microservices CON3127

Christopher Frost Virgo Committer Martin Lippert Lead, Spring Development Tools SpringSource, a division of VMware 3rd November 2011

Fast Track to Spring 3 and Spring MVC / Web Flow

OSGi In Action: Creating Modular Applications In Java By Richard Hall, Karl Pauls READ ONLINE

Modular Java EE in the cloud

Liberate your components with OSGi services

Contents at a Glance

OSGi Best Practices. Emily

Equinox OSGi: Pervasive Componentization

2017, IBM Corporation Liberty z/os Good Practices. WebSphere Liberty z/os Applications and Application Deployment

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

IBM. IBM WebSphere Application Server Migration Toolkit. WebSphere Application Server. Version 9.0 Release

Java EE 5 Development for WebSphere Application Server V7

SSC - Web development Model-View-Controller for Java Servlet

Java EE 6: Develop Web Applications with JSF

Create your own Carbon Component. Sameera Jayasoma Technical Lead and Product Manager of WSO2 Carbon

Running Spring-Based Applications on SAP NetWeaver Composition Environment 7.1 and MS SQL Server 2005

OSGi in WebSphere : The Story so far

Architecting Java solutions for CICS

SPRING MOCK TEST SPRING MOCK TEST I

Developing Applications with Java EE 6 on WebLogic Server 12c

Expeditor Client for Desktop. Web Container and Web Applications

ADVANCED JAVA TRAINING IN BANGALORE

com Spring + Spring-MVC + Spring-Boot + Design Pattern + XML + JMS Hibernate + Struts + Web Services = 8000/-

From the RCP Book To Reality. Jean-Michel Lemieux IBM Rational, Ottawa, Canada

Apache Felix. Richard S. Hall. A Standard Plugin Model for Apache. Atlanta, Georgia U.S.A. November 13th, 2007

"Charting the Course... WebSphere Portal 8 Development using Rational Application Developer 8.5. Course Summary

Contents. 1. JSF overview. 2. JSF example

Under the Paul Fremantle, CTO, WSO2

We are going to create a bundle that will watch for new MAC addresses that have not been seen before, and log the MAC and switch they were seen on.

CMP 436/774. Introduction to Java Enterprise Edition. Java Enterprise Edition

ISV Technical Executive Forum 2011

BEAWebLogic. Event Server. WebLogic Event Server Reference

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

Java J Course Outline

Oracle EXAM - 1Z Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam. Buy Full Product.

Migrating traditional Java EE applications to mobile

Spring Persistence. with Hibernate PAUL TEPPER FISHER BRIAN D. MURPHY

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

Il Mainframe e il paradigma dell enterprise mobility. Carlo Ferrarini zsystems Hybrid Cloud

ADVANCED JAVA COURSE CURRICULUM

Software Components and Distributed Systems

Spring & Hibernate. Knowledge of database. And basic Knowledge of web application development. Module 1: Spring Basics

Service Discovery and Remote Services with the Eclipse Communication Framework

OSGi. Building and Managing Pluggable Applications

EJB ENTERPRISE JAVA BEANS INTRODUCTION TO ENTERPRISE JAVA BEANS, JAVA'S SERVER SIDE COMPONENT TECHNOLOGY. EJB Enterprise Java

BEAWebLogic. Event Server. Creating WebLogic Event Server Applications

Using OSGi in Modular WebSphere Applications

Building the Enterprise

/ / JAVA TRAINING

Camel User Guide. Apache ServiceMix Version 4.5.0

An AspectJ-enabled Eclipse Runtime Engine - Demonstration at AOSD 04 - Martin Lippert

Peter Moskovits Principal Product Manager Oracle Corporation. Sue Vickers Group Manager Oracle Corporation

Leverage Rational Application Developer v8 to develop Java EE6 application and test with WebSphere Application Server v8

Copyright Oracle Corporation and VMware Inc, Enterprise Modules Project (Gemini) Proposal

Integration Developer Version 7.0 Version 7.0. Installation Guide

Component Oriented Development in OSGi with Declarative Services, Spring Dynamic Modules and Apache ipojo

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

WebSphere Application Server Support for OSGi Applications

Carsten Ziegeler

JVA-163. Enterprise JavaBeans

Wiring Your Web Application with Open Source Java

Creating an application with the Virgo Web Server

Java Enterprise Edition

Enterprise Architectures

Agenda. Why OSGi. What is OSGi. How OSGi Works. Apache projects related to OSGi Progress Software Corporation. All rights reserved.

JBoss World 2009 Marius Bogoevici

J2EE - Version: 25. Developing Enterprise Applications with J2EE Enterprise Technologies

Creating an application with dm Server

WebSphere Application Server What s new in WAS V7.0 for Developers

Java Spring Hibernate Interview Questions And Answers For

Equinox Framework: How to get Hooked

Java Platform, Enterprise Edition 6 with Extensible GlassFish Application Server v3

OSGi. Building LinkedIn's Next Generation Architecture with OSGI

Building LinkedIn's Next Generation Architecture with OSGI

7. Component Models. Distributed Systems Prof. Dr. Alexander Schill

Deccansoft Software Services. J2EE Syllabus


IBD Intergiciels et Bases de Données

Spring framework was initially written by Rod Johnson and was first released under the Apache 2.0 license in June 2003.

<Insert Picture Here> Productive JavaEE 5.0 Development

Spring Framework 2.0 New Persistence Features. Thomas Risberg

Leverage Rational Application Developer v8 to develop OSGi application and test with Websphere Application Server v8

2005, Cornell University

Chapter 1 Introducing EJB 1. What is Java EE Introduction to EJB...5 Need of EJB...6 Types of Enterprise Beans...7

Enterprise Development

Fast Track to Java EE 5 with Servlets, JSP & JDBC

IBM. Java Applications in CICS. CICS Transaction Server for z/os Version 4 Release 2 SC

Snowdrop 1.0 User Guide

"Web Age Speaks!" Webinar Series

Spring 2.0 and Beyond

Transcription:

OSGi & Spring combined Using Spring together with Eclipse Equinox Bernd Kolb b.kolb@kolbware.de http://www.kolbware.de Gerd Wütherich gerd@wuetherich.de http://www.wuetherich.de Martin Lippert lippert@acm.org Copyright 2007 by Bernd Kolb; -1-made available under the 2007 EPL Bernd v1.0 Kolb

C O N T E N T S What is OSGi Where does OSGi come from What is Spring Why this combination Problems An Example Conclusion -2-

Woher kommt OSGi OSGi-Alliance: http://www.osgi.org/ org/ Developed since 1999 Originally for Embedded-Systems Now: Also used for enterprise and server-side side systems Applications based on a OSGi-Framework: Eclipse, IBM-Websphere Application-Server, Lotus, Adobe BEA Oracle -3-

C O N T E N T S What is OSGi Where does OSGi come from What is Spring Why this combination Problems An Example Conclusion -4-

What is OSGi - I A dynamic, service oriented module system for Java Source: OSGi.org A module system for Java which defines Modules (aka Bundles ), Visibility of Packages (public-api vs. private-api) Dependencies between Bundles Version of a Bundle. -5-

What is OSGi - II A dynamic, service oriented module system for Java Source: OSGi.org Bundles can be dynamically installed, started, stopped uninstalled and refreshed during runtime. -6-

What is OSGi - III A dynamic, service oriented module system for Java Source: OSGi.org Bundles can dynamically publish services Bundles can search for services in a global service repository and use them The runtime provides support for (de-)registration of services while the system is up and running -7-

C O N T E N T S What is OSGi Where does OSGi come from What is Spring Why this combination Problems An Example Conclusion -8-

Was ist Spring de-facto standard for Java EE Applications Simple programming model (POJOs) Inversion of Control / Dependency Injection AOP using different implementations Many technology abstractions and helpers Simple and technology independent d development of enterprise applications -9-

C O N T E N T S What is OSGi Where does OSGi come from What is Spring Why this combination Problems An Example Conclusion -10-

Why this combination - I OSGi == Embedded? - Spring == Enterprise?? Goal: Using the benefits of the OSGi Service Platform without loosing the benefits of Spring Splitting up your application in Bundles to use Dependency Management Visibility Management Versions-Management Dynamic behavior Deploying Spring as Bundles -11-

Why this combination - II Boundary conditions Complexity It must still be as easy to use as Spring is POJO programming model Integration with the OSGi-Service-Model OSGi-Services as Beans and vice versa Testing Must be possible without an OSGi-Container If possible, no dependencies to the OSGi-APIs The enterprise features of Spring must still be available -12-

C O N T E N T S What is OSGi Where does OSGi come from What is Spring Why this combination Problems An Example Conclusion -13-

Problems in general Class loading Many 3rd-party libraries expect to see and work on a linear Java Class path No linear Class path in OSGi Using strategies to load Classes Buddy Class loading ContextClassLoader Dynamic behavior What to do if a part of my application is not available?? How to handle the different versions? Which 3rd-party libraries can I use? -14-

Problems in particular It is still pretty new stuff Broken builds Bugs Missing features Examples: Persistence layer: Class loading problems Problems with OSGi s dynamic behavior Web Not yet implemented Also some open questions -15-

C O N T E N T S What is OSGi Where does OSGi come from What is Spring Why this combination Problems An Example Conclusion -16-

Example I OSGi Spring Application(s) -17-

Example II Bundles and Spring Normal Spring-Apps: 1 ApplicationContext Spring-OSGi: One App == several Bundles One ApplicationContext per Bundle: Spring-OSGi creates and destroys the Context automatically whenever a bundle was (de-)activated Defining the ApplicationContext in META-INF/spring -18-

Example III Beans as OSGi Service Spring-Beans can be exported as an OSGi-ServiceService OSGi-Services are visible for all bundles <beans> <bean name="customerservice" class="de.example.customerservice.internal.customerserviceimpl" /> <osgi:service i id="customerserviceosgi" i i" ref="customerservice" interface="de.example.customerservice.customerservice" /> </beans> -19-

Example IV OSGi Service as Beans Using existing OSGi-Services within your Spring-Context <beans> <osgi:reference id="customerserviceosgi" i i" interface="de.example.customerservice.customerservice"/> <bean id="orderservice" class="de.example.orderservice.internal.orderserviceimpl"> <property name="customerservice"> <ref local="customerserviceosgi"/> </property> </bean> </beans> -20-

Example V jpetstore jpetstore is a Spring example 3 Layers ibatis RMI, HTTP, Hessian and Burlap for remoting JSPs and Spring- WebMVC -21-

Example VI jpetstore Architecture I Bundles and their dependencies Export:...dataaccess Internal:...internal.dataaccess...internal.dataaccess.ibatis...internal.dataaccess.ibatis.maps dataaccess import...dataaccess Export:...domain Export:...domain.logic...domain.logic.validator Internal:...domain.internal.logic domain.logic import...domain domain import...domain.logic...domain.logic.validator Export: Internal:...internal.web...internal.web.spring web -22-

Example VII jpetstore Architecture II Domain model and Database mapping Account mapped to Account 1 -account mapped to Order mapped to LineItem Order 1..* -items LineItem -quantity : int 1 -item mapped to Product CartItem -item 1 Item 0..* -cartitems -items 0..* Cart -product 1 Product -category 1 Category mapped to Item mapped to Category -23-

Example VIII jpetstore Architecture III Services dataaccess DataSource <<uses>> PropertyPlaceholder <<uses>> AccountDao CategoryDao ProductDao ItemDao OrderDao TransactionManager domain.logic <<uses>> <<AOP>> <<uses>> TransactionAdvice OrderValidator AccountValidator PetStore <<uses>> exporter web servlets <<uses>> httppetstore client client rmipetstore rmipetstore...controller -24-

C O N T E N T S What is OSGi Where does OSGi come from What is Spring Why this combination Problems An Example Conclusion -25-

Conclusion No OSGi-API used Visibility could be defined not only on package-level but also for Spring beans Dependency Injection Many other possibilities Service cardinalities Service-Listener Property-Placeholder -26-

Thank you for your attention Questions? -27-