SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
OSGi Best Practices

Emily Jiang

IBM

21st September 2011




  Page 1   COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved, © IBM Corp. 2011
                                                                               OSGi Alliance Marketing © 2008-2010 . 1
                                                                                                              Page
                                                                               All Rights Reserved
Legal

> IBM and WebSphere are trademarks or registered trademarks of
  International Business Machines Corp., registered in many jurisdictions
  worldwide.

> Java and all Java-based trademarks and logos are trademarks or
  registered trademarks of Oracle and/or its affiliates.

> OSGi and the OSGi logo are trademarks or registered trademarks of the
  OSGi Alliance

> Other product and service names might be trademarks of IBM or other
  companies. A current list of IBM trademarks is available on the Web at
  “Copyright and trademark information” at
  www.ibm.com/legal/copytrade.shtml
                                                                                                2




      Page 2   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,   21.09.11
               © IBM Corp. 2011
AGENDA

> Why OSGi?


> What is OSGi?


> How to best use OSGi?




                                                                                               3




     Page 3   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,   21.09.11
              © IBM Corp. 2011
Modularization in Java
                                                                                Jar
> Jars have no modularization
                                                                      Package
  characteristics
  – No “jar scoped” access modifiers.                                 Class
                                                                        Class
                                                                           Class

  – No means for a jar to declare its                                      Package

    dependencies.                                                           Class
                                                                              Class
  – No versioning.                                                               Class
                                                                                      Package


                                                                                      Class
                                                                                        Class
                                                                                           Class




    Page 4   OSGi Alliance © 2008-2011 . All Rights Reserved,   21.09.11
             © IBM Corp. 2011
Problems with Global Java ClassPath
              Java VM                  party                   common                  resolver          axis       xerces

                 rt                assetmaint                  catalina                 mail         ezmorph        xmlapis
Begin
                jce                 hhfacility                    base                  jenks         servlets      xmlrpc
Here
                jsse                    pos.                    datafile               jakarta          jetty     xmlgraphics

               plugin                content                     entity                 log4j           looks

         sunjce_prov.               manufact.                   widget                 httpunit         jdbm

               dnsns                 product                        …                   mx4j             bsf
                                                                                                                     Class
                 ..                       bi                      rome                  batik            bsh          Not
             marketing              workflow                     jpos18                  fop          velocity       Found
                                                                                                                   Exception
             workeffort           ecommerce                         jcl                tomcat     ws-commons

               ebay                    oagis                  barcode4j                  poi         geronimo

              minerva                     …                  freemarker                lucene                ..

              minilang            googlebase                   serializer               jdom             json

             accounting                order                    naming                 commons          xalan

              guiapp                    ofbiz                    jython                 derby          wsdl4j




    Page 5       OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,              21.09.11
                 © IBM Corp. 2011
webA.war


Problems with EARs/WARs
                                                                  WEB-INF/classes/servletA.class
                                                                  WEB-INF/lib/spring.jar
                                                                  WEB-INF/lib/commons-logging.jar
                                                                  WEB-INF/lib/junit.jar…
Enterprise Applications have isolated                                   webB.war
                                                                          WEB-INF/classes/servletB.class
classpaths but…                                                           WEB-INF/lib/spring.jar
                                                                          WEB-INF/lib/commons-logging.jar
                                                                          WEB-INF/lib/junit.jar…
                                                                                    webC.war
                                                                                     WEB-INF/classes/servletC.class
> No Sharing                                                                         WEB-INF/lib/spring.jar

  – Common libraries/frameworks in apps                                              WEB-INF/lib/commons-logging.jar
                                                                                     WEB-INF/lib/junit.jar…
     and memory


> Version conflicts                                                                                 plankton.v1


                                                                                                    plankton.v2




      Page 6   OSGi Alliance © 2008-2011 . All Rights Reserved,                    21.09.11
               © IBM Corp. 2011
AGENDA

> Why OSGi?


> What is OSGi?


> How to best use OSGi?




                                                                                               7




     Page 7   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,   21.09.11
              © IBM Corp. 2011
What is OSGi?
“The dynamic module system for Java”
> Mature 10-year old technology
> Governed by OSGi Alliance: http://www.osgi.org
> Used inside just about all Java-based middleware
   –   IBM WebSphere, Oracle WebLogic, Red Hat JBoss, Sun GlassFish, Paremus Service Fabric,
       Eclipse Platform, Apache Geronimo, (non-exhaustive list)
       http://www.osgi.org/wiki/uploads/News/2008_09_16_worldwide_market.pdf



               Package
                 Jar                                                                      Package
                                                                                            Jar
                                                               Explicit exports
                Clas
                 Clas                                                                      Clas
                                                                                            Clas
                  Clas                                                                       Clas
                 ss
               Package                                                                      ss
                                                                                          Package
                    s                                                                          s
                   Clas
                    Clas                                                                     Clas
                                                                                              Clas
                     Clas                                                                      Clas
                    ss                                                                        ss
                       s                            Explicit dependencies
                                                                                                 s

          Page 8    OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,   21.09.11
                    © IBM Corp. 2011
OSGi Bundles and Class Loading
    OSGi Bundle – A jar containing:
          Classes and resources.                                                                   Bundle
                                                                      Class Loading
          OSGi Bundle manifest.
                                                                          Each bundle has its own loader.
    What’s in the manifest:
                                                                          No flat or monolithic classpath.
          Bundle-Version: Multiple versions of
            bundles can live concurrently.                                Class sharing and visibility decided
                                                                             by declarative dependencies, not
          Import-Package: What packages
                                                                             by class loader hierarchies.
            from other bundles does this
            bundle depend upon?                                           OSGi framework works out the
                                                                            dependencies including versions.
          Export-Package: What packages
            from this bundle are visible and
            reusable outside of the bundle?
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MyService bundle
Bundle-SymbolicName: com.sample.myservice
Bundle-Version: 1.0.0
Bundle-Activator: com.sample.myservice.Activator
Import-Package: com.something.i.need;version="1.1.2"
Export-Package: com.myservice.api;version="1.0.0"




          Page 9   OSGi Alliance © 2008-2011 . All Rights Reserved,                   21.09.11
                   © IBM Corp. 2011
OSGi Bundle


Bundles have a dynamic
                                                                                     Bundle
lifecycle
Can come and go
independently




    Page 10   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,   21.09.11
              © IBM Corp. 2011
OSGi Service Registry
• Service
 • An object associated with a list of classes (usually interfaces) it
   provides
 • Dynamic (can come and go), framed by bundle lifecycle
 • Services are the primary means of collaboration between bundles.



                                                                  S




    Page 11   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,   21.09.11
              © IBM Corp. 2011
AGENDA

> Why OSGi?


> What is OSGi?


> How to best use OSGi?




                                                                                                12




     Page 12   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,   21.09.11
               © IBM Corp. 2011
BP1 - Use Import-Package not
    Require-Bundle

    Require-Bundle
     – Tightly coupled with a particular bundle with the specified symbolic name and
       version
     – High coupling between bundles                MANIFEST.MF

     – Import all packages                                        ...
                                                                  Require-Bundle: com.ibm.ws.service;bundle-version=2.0.0
     – Bundle version management


• Import-Package
     – Can wire to any bundles exporting the specified package
     – Loose coupling between bundles
     – Only import the package you need                           MANIFEST.MF
                                                                  ...
     – Package version management                                 Import-Package: com.ibm.ws.service.api;version=2.0.0




     Page 13   OSGi Alliance © 2008-2011 . All Rights Reserved,                       21.09.11
               © IBM Corp. 2011
BP2 - Avoid split packages
• Split package
   – A package is exported by two bundles at the same version and the set of
     classes provided by each bundle differs.


• Why?
   – Leads to the use of Require-Bundle, compromising the extent to which systems
     using the bundles can be extended and maintained.


• How?
   – Keep all of the classes from any one package in a single bundle




   Page 14   OSGi Alliance © 2008-2011 . All Rights Reserved,   21.09.11
             © IBM Corp. 2011
BP2 - Split Package examples

                      API A                                           Implementation C

               org.hal.api 1.0.0                                       org.hal.a 1.0.0




                       API B
                                                                                 Bundle C
                                                                     has to use 'Require-Bundle' to
                    org.hal.api 1.0.0                           ensure that it has classes from both parts
                                                                                 of the API

          Figure 1. Consumers of split packages need to use the Require-Bundle header




Page 15      OSGi Alliance © 2008-2011 . All Rights Reserved,                              21.09.11
             © IBM Corp. 2011
BP2 - Split Package
 examples


                  API A                                       Implementation C

                                                              org.hal.a 1.0.0
            org.hal.api 1.0.0




     Figure 2. A complete package exported from a single bundle maintains high bundle cohesion




Page 16    OSGi Alliance © 2008-2011 . All Rights Reserved,                      21.09.11
           © IBM Corp. 2011
BP3 - Version bundles and packages
•   What is semantic versioning?
     – Uses a major.minor.micro.qualifier numbering scheme
         • Major - Packages with versions that have different major parts are
            not compatible both for providers as well as consumers.
         • Minor – API enhancement, e.g. adding methods to an API
         • Micro – bug fixing
         • Qualifier – identifier such as timestamp
         • Example: 1.1.2.20101122am, 1.0.0, 2.0
     – Changes in major: a binary incompatible, minor: enhanced API, micro:
       no API changes

•   Why?
     – Clients can protect themselves against API changes that might break
       them.


     Page 17   OSGi Alliance © 2008-2011 . All Rights Reserved,   21.09.11
               © IBM Corp. 2011
BP3 - Version bundles and packages
examples
                                                               API A
                                                       org.hal.a 1.0.0
            Implementation A                                                         Client A

           Imports:                                                             Imports:
           org.hal.a [1.0, 1.1)                                                 org.hal.a [1.0, 2.0)
                                                               API B
                                                       org.hal.a 1.0.0



           Figure 3: A client and an implementation can use either of two equivalently versioned packages

              Implementation A                                  API A                 Client A

             Imports:                                                            Imports:
             org.hal.a [1.0, 1.1)                        org.hal.a 1.0.0         org.hal.a [1.0, 2.0)



              Implementation B                                  API B                 Client B
             Imports:                                                            Imports:
                                                        org.hal.a 1.1.0
             org.hal.a [1.1, 1.2)                                                org.hal.a [1.1, 2.0)

           Figure 4: How a client and implementation are affected differently by a minor API version change



 Page 18    OSGi Alliance © 2008-2011 . All Rights Reserved,                                 21.09.11
            © IBM Corp. 2011
BP3 - Version bundles and
packages examples

                   Implementation A                                                        Client A

                  Imports:                                    org.hal.a 1.0.0        Imports:
                  org.hal.a [1.0, 1.1)                                               org.hal.a [1.0, 2.0)
                                                                  API A


                  Implementation B                                API B                    Client B

                 Imports:                                                             Imports:
                 org.hal.a [2.0, 2.1)                         org.hal.a 2.0.0         org.hal.a [2.0, 3.0)




             Figure 5. How clients and implementations are similarly affected by a major API version change




 Page 19   OSGi Alliance © 2008-2011 . All Rights Reserved,                                21.09.11
           © IBM Corp. 2011
BP4 - Separate API from
 Implementations

• Why?
  – Great flexibility
  – Many implementation bundles → enable more services provided
  – Reduce package dependencies → reduce circular dependencies


• How?
  – Put API classes in one bundle
  – Put implementation classes in a separate bundle




  Page 20   OSGi Alliance © 2008-2011 . All Rights Reserved,   21.09.11
            © IBM Corp. 2011
BP4 - Separate API and
implementation examples

 API + Implementation                                               Client
      org.hal.myapi
                                                                 org.hal.b.client
     org.hal.a.impl



        Both API and
  implementation packages
      imported by client



Figure 6. Badly designed provider bundle where the API and implementation classes are in the same bundle




 Page 21      OSGi Alliance © 2008-2011 . All Rights Reserved,                              21.09.11
              © IBM Corp. 2011
BP5 - Share services not
   implementations
• Use the OSGi service registry to construct instances
• Why?
   – Able to obtain an instance of an implementation without knowing which one
   – Achieve a loosely coupling of client, API and implementation


• How?

   – Register an instance of the API interface in the OSGi service registry
   – Register an implementation of the OSGi ServiceFactory interface in the OSGi
     service registry.




    Page 22   OSGi Alliance © 2008-2011 . All Rights Reserved,   21.09.11
              © IBM Corp. 2011
BP4 & 5 - examples
                       API                                                   Client

               org.hal.myapi                                              org.hal.b.client




               Implementation

                org.hal.a.impl
                                                                   API and implementation
                                                                 packages in different bundles
                                                                   but still imported by client

          Figure 7. Badly designed provider bundles where the API and implementation classes have been separated




Page 23       OSGi Alliance © 2008-2011 . All Rights Reserved,                               21.09.11
              © IBM Corp. 2011
BP4 & 5 - examples

                        API                                                Client

                org.hal.myapi                                          org.hal.b.client




               Implementation

                 org.hal.a.impl
                                                                     Client and implementation in
                                                                separate bundles, both import API. Client
                                                                 uses implementation through a service
                                                                          defined by the API.


          Figure 8: Well designed provider bundles where the API and implementation classes have been separated




Page 24      OSGi Alliance © 2008-2011 . All Rights Reserved,                             21.09.11
             © IBM Corp. 2011
Using services can be hard!
private BundleContext ctx;                                              @Override
                                                                        public void serviceChanged(ServiceEvent event)
private AtomicReference<LogService> ls = new                            {
AtomicReference<LogService>();
                                                                        ServiceReference ref = event.getServiceReference();
private AtomicReference<ServiceReference> lr = new
AtomicReference<ServiceReference>();
                                                                        if (ls.get() == null && event.getType() ==
                                                                             ServiceEvent.REGISTERED) {
public void start(BundleContext ctx) throws
                                                                        ls.set((LogService) ctx.getService(ref));
InvalidSyntaxException
{                                                                       } else if (ls.get() != null && event.getType() ==
                                                                             ServiceEvent.UNREGISTERING &&
this.ctx = ctx;
                                                                        ref == lr.get()) {
ctx.addServiceListener(this,
                                                                        ref = ctx.getServiceReference(LogService.class.getName());
"(objectClass=org.osgi.service.log.LogService)");
                                                                        if (ref != null) {
ServiceReference ref =
ctx.getServiceReference(LogService.class.getName());                    ls.set((LogService) ctx.getService(ref));
if (ref != null) {                                                      lr.set(ref);
ls.set((LogService) ctx.getService(ref));                               }
lr.set(ref);                                                            }
}                                                                       }
}




       Page 25       OSGi Alliance © 2008-2011 . All Rights Reserved,                            21.09.11
                     © IBM Corp. 2011
BP6 - Use Blueprint
                                            dependencies injected
                publishes
                                                                           consumes
                 service
                                                                            service

                                                     OSGI-INF/blueprint/
 A static assembly and                                 blueprint.xml
    configuration of
 components (POJOs)
                                                  Blueprint bundle

• Specifies a Dependency Injection container, standardizing established
  Spring conventions
• Configuration and dependencies declared in XML “module blueprint”,
  which is a standardization of Spring “application context” XML.
    – Extended for OSGi: publishes and consumes components as OSGi services
• Simplifies unit test outside either Java EE or OSGi r/t.
• The Blueprint DI container can be a part of the server runtime
  (compared to the Spring container which is part of the application.)


      Page 26   OSGi Alliance © 2008-2011 . All Rights Reserved,               21.09.11
                © IBM Corp. 2011
BP6 - Blueprint service-bundle
     examples
Billing service bundle

<blueprint>
  <service ref=”service” interface =
        ”org.example.bill.BillingService” />
  <bean id=”service” scope=”prototype”
    class=”org.example.bill.impl.BillingServiceImpl” />                                  Billing
</blueprint>



                                                                   -“prototype” scope indicates a
                                                                   new instance is created by the
                                                                   container for each use.
public interface BillingService {                                  -“singleton” scope is the default.
    void bill(Order o);
}




      Page 27   OSGi Alliance © 2008-2011 . All Rights Reserved,       21.09.11
                © IBM Corp. 2011
BP6 - Blueprint client-bundle
    examples
e-Commerce bundle

<blueprint>
  <bean id=”shop” class=”org.example.ecomm.ShopImpl”>
    <property name=”billingService” ref=”billingService” />
  </bean>                                                                          e-Commerce
  <reference id=”billingService”
    interface=”org.example.bill.BillingService” />
</blueprint>



public class ShopImpl {                                           -injected service reference
                                                                  -service can change over time
private BillingService billingService;                            -can be temporarily absent
void setBillingService(BillingService srv) {
    billingService = srv;                                            without the bundle caring
    }                                                             -managed by Blueprint container

void process(Order o) {
    billingService.bill(o);
    }
}

     Page 28   OSGi Alliance © 2008-2011 . All Rights Reserved,      21.09.11
               © IBM Corp. 2011
BP7 – Make Bundles Loosely
Coupled & Highly Cohesive

                                               FileSystemAPI
                                                                              SomeotherAPI

                                                                                   TransactionsAPI
                 API                                      Implementation

                                                        org.hal.log.impl
            org.hal.log.api                              org.hal.log.impl
                                                         org.hal.fslog.impl             DBAPI


                                                                                  JPAAPI


                                      'Hairball' effect – one
                                    bundle has many package
                                          dependencies


Figure 9. Poorly purposed system where a single bundle provides multiple implementations of the same API



  Page 29      OSGi Alliance © 2008-2011 . All Rights Reserved,                         21.09.11
               © IBM Corp. 2011
BP7 – Make Bundles Loosely
Coupled & Highly Cohesive
                                                                  FileSystemAPI


                  API                                              Implementation

          org.hal.log.api                                        org.hal.fslog.impl


                                                                  Implementation
                                                                Implementation
                                                              Implementation
                                                                 org.hal.DBlog.impl
                                                               org.hal.DBlog.impl
                                                             org.hal.DBlog.impl
                                      DBAPI
                                     DBAPI
                                    DBAPI


 Figure 10. A well purposed system where each implementation of an API is provided by a separate bundle




Page 30   OSGi Alliance © 2008-2011 . All Rights Reserved,                            21.09.11
          © IBM Corp. 2011
Summary – OSGi Best Practices

>   BP1 - Use Import-Package instead of Require-Bundle
>   BP2 - Avoid split packages
>   BP3 - Version bundles and packages
>   BP4 - Separate API from implementations
>   BP5 - Share services not implementations
>   BP6 - Use Blueprint
>   BP7 - Make bundles loosely coupled & highly cohesive




       Page 31   OSGi Alliance © 2008-2011 . All Rights Reserved,   21.09.11
                 © IBM Corp. 2011
Quiz – What best practices are used?


                                                                        blog-api



Web application bundle

                             JNDI                                                                                EM
     WEB-INF/                              Blogging
                                                                                         Blog              META-INF/
      web.xml                              Service              OSGI-INF/blueprint/
                                                                                                         persistence.xml
                                                                  blueprint.xml       Persistence
                                                                                        Service
   blog-servlet                                                                                         OSGI-INF/blueprint/
                                                                       blog                               blueprint.xml

                                                                                                        blog-persistence




  Page 32       OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,          21.09.11
                © IBM Corp. 2011
Questions?


Page 33   OSGi Alliance © 2008-2011 . All Rights Reserved,   21.09.11
          © IBM Corp. 2011
Additional References
                                          OSGi Best Practices
www.ibm.com/developerworks/websphere/techjournal/1007_charters/1007_charters.html


                Enterprise OSGi YouTube Channel:
               www.youtube.com/user/EnterpriseOSGi


  For more information on Enterprise OSGi take a look at
                Enterprise OSGi in Action :
            http://www.manning.com/cummins




     Page 34   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved,   21.09.11
               © IBM Corp. 2011

Más contenido relacionado

La actualidad más candente

Create *real* modular Java applications - a brief introduction -
Create *real* modular Java applications - a brief introduction -Create *real* modular Java applications - a brief introduction -
Create *real* modular Java applications - a brief introduction -Jeffrey Groneberg
 
02.egovFrame Development Environment training book
02.egovFrame Development Environment training book02.egovFrame Development Environment training book
02.egovFrame Development Environment training bookChuong Nguyen
 
Beyond Continuous Delivery at Agile Tour Montreal 2012
Beyond Continuous Delivery at Agile Tour Montreal 2012Beyond Continuous Delivery at Agile Tour Montreal 2012
Beyond Continuous Delivery at Agile Tour Montreal 2012Chris Hilton
 
Understanding the nuts & bolts of Java EE 6
Understanding the nuts & bolts of Java EE 6Understanding the nuts & bolts of Java EE 6
Understanding the nuts & bolts of Java EE 6Arun Gupta
 
04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment Workshop04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment WorkshopChuong Nguyen
 
Introduction to OSGi
Introduction to OSGiIntroduction to OSGi
Introduction to OSGipradeepfn
 
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010Arun Gupta
 
Java Magazine May/June 2012
Java Magazine May/June 2012Java Magazine May/June 2012
Java Magazine May/June 2012Joel Lobo
 
The Java Ee 6 Platform Normandy Jug
The Java Ee 6 Platform Normandy JugThe Java Ee 6 Platform Normandy Jug
The Java Ee 6 Platform Normandy JugSaagie
 
JavaEE 6 and GlassFish v3 at SFJUG
JavaEE 6 and GlassFish v3 at SFJUGJavaEE 6 and GlassFish v3 at SFJUG
JavaEE 6 and GlassFish v3 at SFJUGMarakana Inc.
 
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 IndiaJava EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 IndiaArun Gupta
 
Glassfish Overview Fontys 20090520
Glassfish Overview Fontys 20090520Glassfish Overview Fontys 20090520
Glassfish Overview Fontys 20090520Eugene Bogaart
 
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your applicationjavablend
 
03.eGovFrame Runtime Environment Training Book Supplement
03.eGovFrame Runtime Environment Training Book Supplement03.eGovFrame Runtime Environment Training Book Supplement
03.eGovFrame Runtime Environment Training Book SupplementChuong Nguyen
 
PROSA - Eclipse Is Just What?
PROSA - Eclipse Is Just What?PROSA - Eclipse Is Just What?
PROSA - Eclipse Is Just What?Tonny Madsen
 
N(i)2 technical architecture 2.0 (v1 1)
N(i)2 technical architecture 2.0 (v1 1)N(i)2 technical architecture 2.0 (v1 1)
N(i)2 technical architecture 2.0 (v1 1)kvz
 
Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemTim Ellison
 
Java EE Technical Keynote - JavaOne India 2011
Java EE Technical Keynote - JavaOne India 2011Java EE Technical Keynote - JavaOne India 2011
Java EE Technical Keynote - JavaOne India 2011Arun Gupta
 

La actualidad más candente (18)

Create *real* modular Java applications - a brief introduction -
Create *real* modular Java applications - a brief introduction -Create *real* modular Java applications - a brief introduction -
Create *real* modular Java applications - a brief introduction -
 
02.egovFrame Development Environment training book
02.egovFrame Development Environment training book02.egovFrame Development Environment training book
02.egovFrame Development Environment training book
 
Beyond Continuous Delivery at Agile Tour Montreal 2012
Beyond Continuous Delivery at Agile Tour Montreal 2012Beyond Continuous Delivery at Agile Tour Montreal 2012
Beyond Continuous Delivery at Agile Tour Montreal 2012
 
Understanding the nuts & bolts of Java EE 6
Understanding the nuts & bolts of Java EE 6Understanding the nuts & bolts of Java EE 6
Understanding the nuts & bolts of Java EE 6
 
04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment Workshop04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment Workshop
 
Introduction to OSGi
Introduction to OSGiIntroduction to OSGi
Introduction to OSGi
 
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
 
Java Magazine May/June 2012
Java Magazine May/June 2012Java Magazine May/June 2012
Java Magazine May/June 2012
 
The Java Ee 6 Platform Normandy Jug
The Java Ee 6 Platform Normandy JugThe Java Ee 6 Platform Normandy Jug
The Java Ee 6 Platform Normandy Jug
 
JavaEE 6 and GlassFish v3 at SFJUG
JavaEE 6 and GlassFish v3 at SFJUGJavaEE 6 and GlassFish v3 at SFJUG
JavaEE 6 and GlassFish v3 at SFJUG
 
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 IndiaJava EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
 
Glassfish Overview Fontys 20090520
Glassfish Overview Fontys 20090520Glassfish Overview Fontys 20090520
Glassfish Overview Fontys 20090520
 
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
 
03.eGovFrame Runtime Environment Training Book Supplement
03.eGovFrame Runtime Environment Training Book Supplement03.eGovFrame Runtime Environment Training Book Supplement
03.eGovFrame Runtime Environment Training Book Supplement
 
PROSA - Eclipse Is Just What?
PROSA - Eclipse Is Just What?PROSA - Eclipse Is Just What?
PROSA - Eclipse Is Just What?
 
N(i)2 technical architecture 2.0 (v1 1)
N(i)2 technical architecture 2.0 (v1 1)N(i)2 technical architecture 2.0 (v1 1)
N(i)2 technical architecture 2.0 (v1 1)
 
Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module System
 
Java EE Technical Keynote - JavaOne India 2011
Java EE Technical Keynote - JavaOne India 2011Java EE Technical Keynote - JavaOne India 2011
Java EE Technical Keynote - JavaOne India 2011
 

Destacado

OSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo RulliOSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo Rullimfrancis
 
Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGiCarsten Ziegeler
 
Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010sullis
 
Distributed Eventing in OSGi - Carsten Ziegeler
Distributed Eventing in OSGi - Carsten ZiegelerDistributed Eventing in OSGi - Carsten Ziegeler
Distributed Eventing in OSGi - Carsten Ziegelermfrancis
 
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...mfrancis
 
Lean Microservices with OSGi - Christian Schneider
Lean Microservices with OSGi - Christian SchneiderLean Microservices with OSGi - Christian Schneider
Lean Microservices with OSGi - Christian Schneidermfrancis
 
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho DelchevWebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchevmfrancis
 
OSGi for outsiders - Milen Dyankov
OSGi for outsiders - Milen DyankovOSGi for outsiders - Milen Dyankov
OSGi for outsiders - Milen Dyankovmfrancis
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingBertrand Delacretaz
 
OSGi Specification Evolution - BJ Hargrave
OSGi Specification Evolution - BJ HargraveOSGi Specification Evolution - BJ Hargrave
OSGi Specification Evolution - BJ Hargravemfrancis
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Carsten Ziegeler
 
OSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingOSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingCarsten Ziegeler
 
Distributed Eventing in OSGi
Distributed Eventing in OSGiDistributed Eventing in OSGi
Distributed Eventing in OSGiCarsten Ziegeler
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleCarsten Ziegeler
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Yevgeniy Brikman
 

Destacado (17)

OSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo RulliOSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo Rulli
 
Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGi
 
Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010
 
Distributed Eventing in OSGi - Carsten Ziegeler
Distributed Eventing in OSGi - Carsten ZiegelerDistributed Eventing in OSGi - Carsten Ziegeler
Distributed Eventing in OSGi - Carsten Ziegeler
 
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
 
Lean Microservices with OSGi - Christian Schneider
Lean Microservices with OSGi - Christian SchneiderLean Microservices with OSGi - Christian Schneider
Lean Microservices with OSGi - Christian Schneider
 
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho DelchevWebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
 
OSGi for outsiders - Milen Dyankov
OSGi for outsiders - Milen DyankovOSGi for outsiders - Milen Dyankov
OSGi for outsiders - Milen Dyankov
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
 
Reactive applications
Reactive applicationsReactive applications
Reactive applications
 
OSGi Specification Evolution - BJ Hargrave
OSGi Specification Evolution - BJ HargraveOSGi Specification Evolution - BJ Hargrave
OSGi Specification Evolution - BJ Hargrave
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)
 
OSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingOSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache Sling
 
Distributed Eventing in OSGi
Distributed Eventing in OSGiDistributed Eventing in OSGi
Distributed Eventing in OSGi
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web Console
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
 
The AI Rush
The AI RushThe AI Rush
The AI Rush
 

Similar a OSGi Best Practices - Tim Ward

TDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationTDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationArun Gupta
 
OSGi Service Platform 4.2
OSGi Service Platform 4.2OSGi Service Platform 4.2
OSGi Service Platform 4.2Ilya Katsov
 
Modularity with OSGi
Modularity with OSGiModularity with OSGi
Modularity with OSGiPeter Kriens
 
Modularity with OSGi
Modularity with OSGiModularity with OSGi
Modularity with OSGiPeter Kriens
 
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph! ...
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph!  ...Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph!  ...
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph! ...mfrancis
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011Arun Gupta
 
Real world java_ee_patterns
Real world java_ee_patternsReal world java_ee_patterns
Real world java_ee_patternsAlassane Diallo
 
GR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting GrailsGR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting GrailsGR8Conf
 
Adopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf EuropeAdopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf EuropeKlausBaumecker
 
Monoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityMonoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityGraham Charters
 
Modular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim WardModular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim Wardmfrancis
 
OSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishOSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishArun Gupta
 
OSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishOSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishArun Gupta
 
Spark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopSpark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopArun Gupta
 
Modular Java EE in the Cloud
Modular Java EE in the CloudModular Java EE in the Cloud
Modular Java EE in the CloudBert Ertman
 
Bonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la productionBonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la productionCyrille Le Clerc
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overviewsbobde
 
Gemini WEB and Virgo
Gemini WEB and VirgoGemini WEB and Virgo
Gemini WEB and VirgoHristo Iliev
 
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010Arun Gupta
 

Similar a OSGi Best Practices - Tim Ward (20)

JavaOne 2010: OSGI Migrat
JavaOne 2010: OSGI MigratJavaOne 2010: OSGI Migrat
JavaOne 2010: OSGI Migrat
 
TDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationTDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE Application
 
OSGi Service Platform 4.2
OSGi Service Platform 4.2OSGi Service Platform 4.2
OSGi Service Platform 4.2
 
Modularity with OSGi
Modularity with OSGiModularity with OSGi
Modularity with OSGi
 
Modularity with OSGi
Modularity with OSGiModularity with OSGi
Modularity with OSGi
 
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph! ...
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph!  ...Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph!  ...
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph! ...
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
 
Real world java_ee_patterns
Real world java_ee_patternsReal world java_ee_patterns
Real world java_ee_patterns
 
GR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting GrailsGR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting Grails
 
Adopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf EuropeAdopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf Europe
 
Monoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityMonoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is Modularity
 
Modular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim WardModular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim Ward
 
OSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishOSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFish
 
OSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishOSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFish
 
Spark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopSpark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 Workshop
 
Modular Java EE in the Cloud
Modular Java EE in the CloudModular Java EE in the Cloud
Modular Java EE in the Cloud
 
Bonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la productionBonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la production
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
 
Gemini WEB and Virgo
Gemini WEB and VirgoGemini WEB and Virgo
Gemini WEB and Virgo
 
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
 

Más de mfrancis

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...mfrancis
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)mfrancis
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)mfrancis
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruumfrancis
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...mfrancis
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...mfrancis
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...mfrancis
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)mfrancis
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...mfrancis
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...mfrancis
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...mfrancis
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)mfrancis
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)mfrancis
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)mfrancis
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...mfrancis
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...mfrancis
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)mfrancis
 

Más de mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 

Último

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Último (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
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!
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

OSGi Best Practices - Tim Ward

  • 1. OSGi Best Practices Emily Jiang IBM 21st September 2011 Page 1 COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved, © IBM Corp. 2011 OSGi Alliance Marketing © 2008-2010 . 1 Page All Rights Reserved
  • 2. Legal > IBM and WebSphere are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. > Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates. > OSGi and the OSGi logo are trademarks or registered trademarks of the OSGi Alliance > Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml 2 Page 2 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 3. AGENDA > Why OSGi? > What is OSGi? > How to best use OSGi? 3 Page 3 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 4. Modularization in Java Jar > Jars have no modularization Package characteristics – No “jar scoped” access modifiers. Class Class Class – No means for a jar to declare its Package dependencies. Class Class – No versioning. Class Package Class Class Class Page 4 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 5. Problems with Global Java ClassPath Java VM party common resolver axis xerces rt assetmaint catalina mail ezmorph xmlapis Begin jce hhfacility base jenks servlets xmlrpc Here jsse pos. datafile jakarta jetty xmlgraphics plugin content entity log4j looks sunjce_prov. manufact. widget httpunit jdbm dnsns product … mx4j bsf Class .. bi rome batik bsh Not marketing workflow jpos18 fop velocity Found Exception workeffort ecommerce jcl tomcat ws-commons ebay oagis barcode4j poi geronimo minerva … freemarker lucene .. minilang googlebase serializer jdom json accounting order naming commons xalan guiapp ofbiz jython derby wsdl4j Page 5 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 6. webA.war Problems with EARs/WARs WEB-INF/classes/servletA.class WEB-INF/lib/spring.jar WEB-INF/lib/commons-logging.jar WEB-INF/lib/junit.jar… Enterprise Applications have isolated webB.war WEB-INF/classes/servletB.class classpaths but… WEB-INF/lib/spring.jar WEB-INF/lib/commons-logging.jar WEB-INF/lib/junit.jar… webC.war WEB-INF/classes/servletC.class > No Sharing WEB-INF/lib/spring.jar – Common libraries/frameworks in apps WEB-INF/lib/commons-logging.jar WEB-INF/lib/junit.jar… and memory > Version conflicts plankton.v1 plankton.v2 Page 6 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 7. AGENDA > Why OSGi? > What is OSGi? > How to best use OSGi? 7 Page 7 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 8. What is OSGi? “The dynamic module system for Java” > Mature 10-year old technology > Governed by OSGi Alliance: http://www.osgi.org > Used inside just about all Java-based middleware – IBM WebSphere, Oracle WebLogic, Red Hat JBoss, Sun GlassFish, Paremus Service Fabric, Eclipse Platform, Apache Geronimo, (non-exhaustive list) http://www.osgi.org/wiki/uploads/News/2008_09_16_worldwide_market.pdf Package Jar Package Jar Explicit exports Clas Clas Clas Clas Clas Clas ss Package ss Package s s Clas Clas Clas Clas Clas Clas ss ss s Explicit dependencies s Page 8 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 9. OSGi Bundles and Class Loading OSGi Bundle – A jar containing: Classes and resources. Bundle Class Loading OSGi Bundle manifest. Each bundle has its own loader. What’s in the manifest: No flat or monolithic classpath. Bundle-Version: Multiple versions of bundles can live concurrently. Class sharing and visibility decided by declarative dependencies, not Import-Package: What packages by class loader hierarchies. from other bundles does this bundle depend upon? OSGi framework works out the dependencies including versions. Export-Package: What packages from this bundle are visible and reusable outside of the bundle? Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: MyService bundle Bundle-SymbolicName: com.sample.myservice Bundle-Version: 1.0.0 Bundle-Activator: com.sample.myservice.Activator Import-Package: com.something.i.need;version="1.1.2" Export-Package: com.myservice.api;version="1.0.0" Page 9 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 10. OSGi Bundle Bundles have a dynamic Bundle lifecycle Can come and go independently Page 10 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 11. OSGi Service Registry • Service • An object associated with a list of classes (usually interfaces) it provides • Dynamic (can come and go), framed by bundle lifecycle • Services are the primary means of collaboration between bundles. S Page 11 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 12. AGENDA > Why OSGi? > What is OSGi? > How to best use OSGi? 12 Page 12 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 13. BP1 - Use Import-Package not Require-Bundle  Require-Bundle – Tightly coupled with a particular bundle with the specified symbolic name and version – High coupling between bundles MANIFEST.MF – Import all packages ... Require-Bundle: com.ibm.ws.service;bundle-version=2.0.0 – Bundle version management • Import-Package – Can wire to any bundles exporting the specified package – Loose coupling between bundles – Only import the package you need MANIFEST.MF ... – Package version management Import-Package: com.ibm.ws.service.api;version=2.0.0 Page 13 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 14. BP2 - Avoid split packages • Split package – A package is exported by two bundles at the same version and the set of classes provided by each bundle differs. • Why? – Leads to the use of Require-Bundle, compromising the extent to which systems using the bundles can be extended and maintained. • How? – Keep all of the classes from any one package in a single bundle Page 14 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 15. BP2 - Split Package examples API A Implementation C org.hal.api 1.0.0 org.hal.a 1.0.0 API B Bundle C has to use 'Require-Bundle' to org.hal.api 1.0.0 ensure that it has classes from both parts of the API Figure 1. Consumers of split packages need to use the Require-Bundle header Page 15 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 16. BP2 - Split Package examples API A Implementation C org.hal.a 1.0.0 org.hal.api 1.0.0 Figure 2. A complete package exported from a single bundle maintains high bundle cohesion Page 16 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 17. BP3 - Version bundles and packages • What is semantic versioning? – Uses a major.minor.micro.qualifier numbering scheme • Major - Packages with versions that have different major parts are not compatible both for providers as well as consumers. • Minor – API enhancement, e.g. adding methods to an API • Micro – bug fixing • Qualifier – identifier such as timestamp • Example: 1.1.2.20101122am, 1.0.0, 2.0 – Changes in major: a binary incompatible, minor: enhanced API, micro: no API changes • Why? – Clients can protect themselves against API changes that might break them. Page 17 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 18. BP3 - Version bundles and packages examples API A org.hal.a 1.0.0 Implementation A Client A Imports: Imports: org.hal.a [1.0, 1.1) org.hal.a [1.0, 2.0) API B org.hal.a 1.0.0 Figure 3: A client and an implementation can use either of two equivalently versioned packages Implementation A API A Client A Imports: Imports: org.hal.a [1.0, 1.1) org.hal.a 1.0.0 org.hal.a [1.0, 2.0) Implementation B API B Client B Imports: Imports: org.hal.a 1.1.0 org.hal.a [1.1, 1.2) org.hal.a [1.1, 2.0) Figure 4: How a client and implementation are affected differently by a minor API version change Page 18 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 19. BP3 - Version bundles and packages examples Implementation A Client A Imports: org.hal.a 1.0.0 Imports: org.hal.a [1.0, 1.1) org.hal.a [1.0, 2.0) API A Implementation B API B Client B Imports: Imports: org.hal.a [2.0, 2.1) org.hal.a 2.0.0 org.hal.a [2.0, 3.0) Figure 5. How clients and implementations are similarly affected by a major API version change Page 19 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 20. BP4 - Separate API from Implementations • Why? – Great flexibility – Many implementation bundles → enable more services provided – Reduce package dependencies → reduce circular dependencies • How? – Put API classes in one bundle – Put implementation classes in a separate bundle Page 20 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 21. BP4 - Separate API and implementation examples API + Implementation Client org.hal.myapi org.hal.b.client org.hal.a.impl Both API and implementation packages imported by client Figure 6. Badly designed provider bundle where the API and implementation classes are in the same bundle Page 21 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 22. BP5 - Share services not implementations • Use the OSGi service registry to construct instances • Why? – Able to obtain an instance of an implementation without knowing which one – Achieve a loosely coupling of client, API and implementation • How? – Register an instance of the API interface in the OSGi service registry – Register an implementation of the OSGi ServiceFactory interface in the OSGi service registry. Page 22 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 23. BP4 & 5 - examples API Client org.hal.myapi org.hal.b.client Implementation org.hal.a.impl API and implementation packages in different bundles but still imported by client Figure 7. Badly designed provider bundles where the API and implementation classes have been separated Page 23 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 24. BP4 & 5 - examples API Client org.hal.myapi org.hal.b.client Implementation org.hal.a.impl Client and implementation in separate bundles, both import API. Client uses implementation through a service defined by the API. Figure 8: Well designed provider bundles where the API and implementation classes have been separated Page 24 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 25. Using services can be hard! private BundleContext ctx; @Override public void serviceChanged(ServiceEvent event) private AtomicReference<LogService> ls = new { AtomicReference<LogService>(); ServiceReference ref = event.getServiceReference(); private AtomicReference<ServiceReference> lr = new AtomicReference<ServiceReference>(); if (ls.get() == null && event.getType() == ServiceEvent.REGISTERED) { public void start(BundleContext ctx) throws ls.set((LogService) ctx.getService(ref)); InvalidSyntaxException { } else if (ls.get() != null && event.getType() == ServiceEvent.UNREGISTERING && this.ctx = ctx; ref == lr.get()) { ctx.addServiceListener(this, ref = ctx.getServiceReference(LogService.class.getName()); "(objectClass=org.osgi.service.log.LogService)"); if (ref != null) { ServiceReference ref = ctx.getServiceReference(LogService.class.getName()); ls.set((LogService) ctx.getService(ref)); if (ref != null) { lr.set(ref); ls.set((LogService) ctx.getService(ref)); } lr.set(ref); } } } } Page 25 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 26. BP6 - Use Blueprint dependencies injected publishes consumes service service OSGI-INF/blueprint/ A static assembly and blueprint.xml configuration of components (POJOs) Blueprint bundle • Specifies a Dependency Injection container, standardizing established Spring conventions • Configuration and dependencies declared in XML “module blueprint”, which is a standardization of Spring “application context” XML. – Extended for OSGi: publishes and consumes components as OSGi services • Simplifies unit test outside either Java EE or OSGi r/t. • The Blueprint DI container can be a part of the server runtime (compared to the Spring container which is part of the application.) Page 26 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 27. BP6 - Blueprint service-bundle examples Billing service bundle <blueprint> <service ref=”service” interface = ”org.example.bill.BillingService” /> <bean id=”service” scope=”prototype” class=”org.example.bill.impl.BillingServiceImpl” /> Billing </blueprint> -“prototype” scope indicates a new instance is created by the container for each use. public interface BillingService { -“singleton” scope is the default. void bill(Order o); } Page 27 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 28. BP6 - Blueprint client-bundle examples e-Commerce bundle <blueprint> <bean id=”shop” class=”org.example.ecomm.ShopImpl”> <property name=”billingService” ref=”billingService” /> </bean> e-Commerce <reference id=”billingService” interface=”org.example.bill.BillingService” /> </blueprint> public class ShopImpl { -injected service reference -service can change over time private BillingService billingService; -can be temporarily absent void setBillingService(BillingService srv) { billingService = srv; without the bundle caring } -managed by Blueprint container void process(Order o) { billingService.bill(o); } } Page 28 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 29. BP7 – Make Bundles Loosely Coupled & Highly Cohesive FileSystemAPI SomeotherAPI TransactionsAPI API Implementation org.hal.log.impl org.hal.log.api org.hal.log.impl org.hal.fslog.impl DBAPI JPAAPI 'Hairball' effect – one bundle has many package dependencies Figure 9. Poorly purposed system where a single bundle provides multiple implementations of the same API Page 29 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 30. BP7 – Make Bundles Loosely Coupled & Highly Cohesive FileSystemAPI API Implementation org.hal.log.api org.hal.fslog.impl Implementation Implementation Implementation org.hal.DBlog.impl org.hal.DBlog.impl org.hal.DBlog.impl DBAPI DBAPI DBAPI Figure 10. A well purposed system where each implementation of an API is provided by a separate bundle Page 30 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 31. Summary – OSGi Best Practices > BP1 - Use Import-Package instead of Require-Bundle > BP2 - Avoid split packages > BP3 - Version bundles and packages > BP4 - Separate API from implementations > BP5 - Share services not implementations > BP6 - Use Blueprint > BP7 - Make bundles loosely coupled & highly cohesive Page 31 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 32. Quiz – What best practices are used? blog-api Web application bundle JNDI EM WEB-INF/ Blogging Blog META-INF/ web.xml Service OSGI-INF/blueprint/ persistence.xml blueprint.xml Persistence Service blog-servlet OSGI-INF/blueprint/ blog blueprint.xml blog-persistence Page 32 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 33. Questions? Page 33 OSGi Alliance © 2008-2011 . All Rights Reserved, 21.09.11 © IBM Corp. 2011
  • 34. Additional References OSGi Best Practices www.ibm.com/developerworks/websphere/techjournal/1007_charters/1007_charters.html Enterprise OSGi YouTube Channel: www.youtube.com/user/EnterpriseOSGi For more information on Enterprise OSGi take a look at Enterprise OSGi in Action : http://www.manning.com/cummins Page 34 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved, 21.09.11 © IBM Corp. 2011