SlideShare a Scribd company logo
Aspect Weaving for OSGi


                                      Martin Lippert (akquinet it-agile GmbH)
                                     Heiko Seeberger (Weigle Wil
                                     H ik S b         (W i l Wilczek G bH)
                                                                      k GmbH)




© 2008 by Martin Lippert, Heiko Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license | November 7th, 2008
Aspect-oriented programming
• Modularity improved a lot by OO concepts
      Classes, interfaces
      Information hiding, polymorphism, inheritance
• AOP adds additional concepts
      To modularize so called “cross-cutting concerns”


       ClassA                ClassB                ClassC                         AspectX

                           ConcernX
     ConcernX                                                                    ConcernX
                                                 ConcernX




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
AOP today
• Meanwhile AOP is an established concept
      Useful for many situations
      Mostly technology-centric usage scenarios
• Established languages and frameworks available
      AspectJ: powerful language extension to Java
      Spring-AOP:
      Spring AOP: simple to use AOP for enterprise apps
• Used in production:
      Spring itself makes heavy use of AOP concepts
      App-servers are using AOP inside
      Direct AOP selectively used in enterprise apps



  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
AspectJ = AOP for Java
• AspectJ is a powerful language extension for Java
      Hosted as an Eclipse project
      Still very active (latest release 1.6.1 in July 2008)
• AJDT:
      Great tooling for the Eclipse IDE (3.3, 3.4)
      Comes close to the JDT feeling
• Spring-IDE:
      Integrates AJDT with Spring-AOP
      AJDT feeling for Spring apps




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
The Standard Use Case



          ClassA                ClassB                ClassC                         AspectX

                              ConcernX
        ConcernX                                                                    ConcernX
                                                    ConcernX



 Project Sources

                                                                     Single Application Classpath

                                       Java Virtual Machine



 Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Library Aspects



          ClassA                ClassB                ClassC                         AspectX

                              ConcernX
        ConcernX                                                                    ConcernX
                                                    ConcernX



  Project Sources                                                              JAR

                                                                     Single Application Classpath

                                       Java Virtual Machine



 Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Aspects for Existing Code



          ClassA                         ClassB                ClassC                AspectX

                                       ConcernX
        ConcernX                                                                    ConcernX
                                                             ConcernX



  JARs                           Project Sources

                                                                     Single Application Classpath

                                       Java Virtual Machine



 Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Java + OSGi
• OSGi:
      “A dynamic module system for Java”


• Modularity
• Dynamic
• Service-Oriented




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
What does it mean for us?
• We would like to modularize
      … classes and interfaces into bundles
      … and aspects into bundles


• The obvious next step:
      modularize cross cutting concerns into bundles
                 cross-cutting


• Takes modularity to the next level




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Intra-Bundle Aspects



        ClassA                ClassB                                   ClassC               AspectX


                                                                                           ConcernX
                                                                     ConcernX



                  Bundle A                                                      Bundle B

            Bundle-Classpath                                              Bundle-Classpath

                                         Java Virtual Machine



 Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Co-Op Bundle Aspects



    ClassA                ClassB                         ClassC                             AspectX

                        ConcernX
  ConcernX                                                                                 ConcernX
                                                       ConcernX



             Bundle A                                   Bundle B                            Bundle C

       Bundle-Classpath                             Bundle-Classpath                  Bundle-Classpath

                                         Java Virtual Machine



 Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Abstract Aspect Bundles



       ClassA                ClassB                                                          Abstract
                                                                                             Ab t t
                                                       Concrete
                                                       C     t
                                                                                             Aspect
                                                        Aspect
                           ConcernX
     ConcernX
                                                                                            ConcernX
                                                      ConcernX


                              Bundle A                                                      Bundle B

                                                     Bundle-Classpath                 Bundle-Classpath

                                         Java Virtual Machine



 Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Dynamics for Aspect Bundles
• OSGi allows dynamic bundle
      … installs
      … uninstalls
      … updates


• Same should be possible for aspect bundles
      … dynamic installs, uninstalls and updates of aspect bundles
      … dynamic installs, uninstalls and updates of bundles that are
      affected by aspects
       ff t d b        t




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
How could all this possibly work?




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Equinox Aspects
• Equinox Incubator Project
      http://www.eclipse.org/equinox/incubator/aspects


• Enables AspectJ/AOP for OSGi
      Supports all presented use-cases
      Ready-to-use
      Ready to use


• Setting
      Works with Eclipse 3.4 (and 3.3 deprecated)
      Works with AJDT 1.5.2, 1.5.3, 1.6.0, 1.6.1



  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
What can I do?
• Put aspects into standard OSGi bundles
      Just like Java classes
• Define what and where to weave
      aop.xml and manifest headers
• Go!



• Feels like a natural combination of AOP and OSGi
                                              OSGi…




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Load-Time Weaving for OSGi
• Let the OSGi runtime take care of weaving the aspects
      (and not the compiler)
      Leads to load-time weaving within OSGi


• This means:
      No recompilation of existing bundles necessary
      Supports “aop.xml” load-time weaving config of AspectJ




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Live Demo
• Monitoring Eclipse bundles
                     bundles…




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Caching
• Wasn’t that a fast startup?
  Wasn t

• The reason: caching for woven classes
      Load-time weaving happens only once
      Second time startup is same as without aspects
      Available for t d d JREs d
      A il bl f standard JRE and IBM J9 shared classes
                                              h dl
      Supports configuration switching




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Dynamics
• Dynamics for aspect bundles
      Means re- or un-weaving existing bundles


• How is it realized?
      Silent update of bundles to be woven again
      Bundles must behave nicely within dynamic situations




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Live Demo
• Installing
  Installing,
    updating,
        uninstalling
                                      aspects at runtime…




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
AOP in Spring
• Spring uses AOP a lot for all kinds of purposes
• @Configurable is one example

• Realized by Spring via load-time aspect weaving




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Spring & Equinox Aspects
• Equinox Aspects can do load time aspect weaving for
                         load-time
  Spring-powered bundles…

• Live Demo
      @Configurable for Extensions (Views in Eclipse RCP apps)




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
APIs and Implementation
• org eclipse equinox weaving hook
  org.eclipse.equinox.weaving.hook
      Hooks into the runtime
      Provides API for injecting weaving and caching
      implementations
• org.eclipse.equinox.weaving.aspectj
      Implements aspect weaving using AspectJ
• org.eclipse.equinox.weaving.caching
      Implements caching for standard VMs
• org.eclipse.equinox.weaving.caching.j9
      Implements caching for IBM J9 VMs (shared classes feature)



  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Conclusions
• Equinox Aspects brings full AOP to OSGi
      Load-time weaving integrated into OSGi
      Combines OSGi and AOP modularity features
• Can be used for production systems today

• Give it a try
  http://www.eclipse.org/equinox/incubator/aspects




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
Thank you for your attention!



Q&A


Heiko Seeberger: seeberger@weiglewilczek.com
Martin Lippert lippert@acm org
       Lippert: lippert@acm.org




  Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license

More Related Content

Viewers also liked

W-JAX 09 - Lift
W-JAX 09 - LiftW-JAX 09 - Lift
W-JAX 09 - Lift
Heiko Seeberger
 
W-JAX 08 - Declarative Services versus Spring Dynamic Modules
W-JAX 08 - Declarative Services versus Spring Dynamic ModulesW-JAX 08 - Declarative Services versus Spring Dynamic Modules
W-JAX 08 - Declarative Services versus Spring Dynamic Modules
Heiko Seeberger
 
Scaladays 2011 - The Ease of Scalaz
Scaladays 2011 - The Ease of ScalazScaladays 2011 - The Ease of Scalaz
Scaladays 2011 - The Ease of Scalaz
Heiko Seeberger
 
JAX 08 - Agile RCP
JAX 08 - Agile RCPJAX 08 - Agile RCP
JAX 08 - Agile RCP
Heiko Seeberger
 
OSGi DevCon 09 - OSGi on Scala
OSGi DevCon 09 - OSGi on ScalaOSGi DevCon 09 - OSGi on Scala
OSGi DevCon 09 - OSGi on Scala
Heiko Seeberger
 
OSGi DevCon 09 - Component Oriented Development in OSGi with DS, Spring and i...
OSGi DevCon 09 - Component Oriented Development in OSGi with DS, Spring and i...OSGi DevCon 09 - Component Oriented Development in OSGi with DS, Spring and i...
OSGi DevCon 09 - Component Oriented Development in OSGi with DS, Spring and i...
Heiko Seeberger
 
RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?
Heiko Seeberger
 
JAX 09 - OSGi on Scala
JAX 09 - OSGi on ScalaJAX 09 - OSGi on Scala
JAX 09 - OSGi on Scala
Heiko Seeberger
 
EclipseCon 08 - Agile RCP
EclipseCon 08 - Agile RCPEclipseCon 08 - Agile RCP
EclipseCon 08 - Agile RCP
Heiko Seeberger
 
JAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components ModelsJAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components Models
Heiko Seeberger
 
W-JAX 09 - ScalaModules
W-JAX 09 - ScalaModulesW-JAX 09 - ScalaModules
W-JAX 09 - ScalaModules
Heiko Seeberger
 

Viewers also liked (17)

W-JAX 09 - Lift
W-JAX 09 - LiftW-JAX 09 - Lift
W-JAX 09 - Lift
 
W-JAX 08 - Declarative Services versus Spring Dynamic Modules
W-JAX 08 - Declarative Services versus Spring Dynamic ModulesW-JAX 08 - Declarative Services versus Spring Dynamic Modules
W-JAX 08 - Declarative Services versus Spring Dynamic Modules
 
Smackdown
SmackdownSmackdown
Smackdown
 
Scaladays 2011 - The Ease of Scalaz
Scaladays 2011 - The Ease of ScalazScaladays 2011 - The Ease of Scalaz
Scaladays 2011 - The Ease of Scalaz
 
JAX 08 - Agile RCP
JAX 08 - Agile RCPJAX 08 - Agile RCP
JAX 08 - Agile RCP
 
OSGi DevCon 09 - OSGi on Scala
OSGi DevCon 09 - OSGi on ScalaOSGi DevCon 09 - OSGi on Scala
OSGi DevCon 09 - OSGi on Scala
 
OSGi DevCon 09 - Component Oriented Development in OSGi with DS, Spring and i...
OSGi DevCon 09 - Component Oriented Development in OSGi with DS, Spring and i...OSGi DevCon 09 - Component Oriented Development in OSGi with DS, Spring and i...
OSGi DevCon 09 - Component Oriented Development in OSGi with DS, Spring and i...
 
Smackdown
SmackdownSmackdown
Smackdown
 
RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?
 
Smackdown
SmackdownSmackdown
Smackdown
 
JAX 09 - OSGi on Scala
JAX 09 - OSGi on ScalaJAX 09 - OSGi on Scala
JAX 09 - OSGi on Scala
 
Smackdown
SmackdownSmackdown
Smackdown
 
Smackdown
SmackdownSmackdown
Smackdown
 
Smackdown
SmackdownSmackdown
Smackdown
 
EclipseCon 08 - Agile RCP
EclipseCon 08 - Agile RCPEclipseCon 08 - Agile RCP
EclipseCon 08 - Agile RCP
 
JAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components ModelsJAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components Models
 
W-JAX 09 - ScalaModules
W-JAX 09 - ScalaModulesW-JAX 09 - ScalaModules
W-JAX 09 - ScalaModules
 

Similar to W-JAX 08 - Aspect Weaving for OSGii

Building Server Applications with EclipseRT
Building Server Applications with EclipseRTBuilding Server Applications with EclipseRT
Building Server Applications with EclipseRT
Gunnar Wagenknecht
 
GeForce 8800 OpenGL Extensions
GeForce 8800 OpenGL ExtensionsGeForce 8800 OpenGL Extensions
GeForce 8800 OpenGL Extensions
icastano
 
Smooth transition to Eclipse in practice
Smooth transition to Eclipse in practiceSmooth transition to Eclipse in practice
Smooth transition to Eclipse in practice
guest301ea
 
Knowledge Engineering rediscovered, Towards Reasoning Patterns for the Semant...
Knowledge Engineering rediscovered, Towards Reasoning Patterns for the Semant...Knowledge Engineering rediscovered, Towards Reasoning Patterns for the Semant...
Knowledge Engineering rediscovered, Towards Reasoning Patterns for the Semant...
Frank van Harmelen
 
NIAR_VRC_2010
NIAR_VRC_2010NIAR_VRC_2010
NIAR_VRC_2010
fftoledo
 
Cg2012 niet-geanimeerd
Cg2012 niet-geanimeerdCg2012 niet-geanimeerd
Cg2012 niet-geanimeerd
Eric Malotaux
 
OSGi Applications Clustering using Distributed Shared Memory
OSGi Applications Clustering using Distributed Shared MemoryOSGi Applications Clustering using Distributed Shared Memory
OSGi Applications Clustering using Distributed Shared Memory
Anthony Gelibert
 
Multi-bundle Scoping in OSGi
Multi-bundle Scoping in OSGiMulti-bundle Scoping in OSGi
Multi-bundle Scoping in OSGi
glynnormington
 
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVCUpgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
FPGA Central
 
Framework Engineering
Framework EngineeringFramework Engineering
Framework Engineering
YoungSu Son
 
RapidMRC
RapidMRCRapidMRC
RapidMRC
davidkftam
 
Conole vilnius 3_nov
Conole vilnius 3_novConole vilnius 3_nov
Conole vilnius 3_nov
grainne
 

Similar to W-JAX 08 - Aspect Weaving for OSGii (12)

Building Server Applications with EclipseRT
Building Server Applications with EclipseRTBuilding Server Applications with EclipseRT
Building Server Applications with EclipseRT
 
GeForce 8800 OpenGL Extensions
GeForce 8800 OpenGL ExtensionsGeForce 8800 OpenGL Extensions
GeForce 8800 OpenGL Extensions
 
Smooth transition to Eclipse in practice
Smooth transition to Eclipse in practiceSmooth transition to Eclipse in practice
Smooth transition to Eclipse in practice
 
Knowledge Engineering rediscovered, Towards Reasoning Patterns for the Semant...
Knowledge Engineering rediscovered, Towards Reasoning Patterns for the Semant...Knowledge Engineering rediscovered, Towards Reasoning Patterns for the Semant...
Knowledge Engineering rediscovered, Towards Reasoning Patterns for the Semant...
 
NIAR_VRC_2010
NIAR_VRC_2010NIAR_VRC_2010
NIAR_VRC_2010
 
Cg2012 niet-geanimeerd
Cg2012 niet-geanimeerdCg2012 niet-geanimeerd
Cg2012 niet-geanimeerd
 
OSGi Applications Clustering using Distributed Shared Memory
OSGi Applications Clustering using Distributed Shared MemoryOSGi Applications Clustering using Distributed Shared Memory
OSGi Applications Clustering using Distributed Shared Memory
 
Multi-bundle Scoping in OSGi
Multi-bundle Scoping in OSGiMulti-bundle Scoping in OSGi
Multi-bundle Scoping in OSGi
 
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVCUpgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
 
Framework Engineering
Framework EngineeringFramework Engineering
Framework Engineering
 
RapidMRC
RapidMRCRapidMRC
RapidMRC
 
Conole vilnius 3_nov
Conole vilnius 3_novConole vilnius 3_nov
Conole vilnius 3_nov
 

More from Heiko Seeberger

Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?
Heiko Seeberger
 
JM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala ReviewJM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala Review
Heiko Seeberger
 
JM 08/09 - ScalaModules
JM 08/09 - ScalaModulesJM 08/09 - ScalaModules
JM 08/09 - ScalaModules
Heiko Seeberger
 
OSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on ScalaOSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on Scala
Heiko Seeberger
 
Eclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by ContractEclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by ContractHeiko Seeberger
 
Eclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der DreiEclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der DreiHeiko Seeberger
 
Eclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance LoggingEclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance LoggingHeiko Seeberger
 
Eclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on EquinoxEclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on EquinoxHeiko Seeberger
 
Eclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matterEclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matterHeiko Seeberger
 
W-JAX 07 - AOP im Einsatz mit OSGi und RCP
W-JAX 07 - AOP im Einsatz mit OSGi und RCPW-JAX 07 - AOP im Einsatz mit OSGi und RCP
W-JAX 07 - AOP im Einsatz mit OSGi und RCPHeiko Seeberger
 
JM 04/09 - OSGi in kleinen Dosen 5
JM 04/09 - OSGi in kleinen Dosen 5JM 04/09 - OSGi in kleinen Dosen 5
JM 04/09 - OSGi in kleinen Dosen 5
Heiko Seeberger
 
JM 12/08 - OSGi in kleinen Dosen 1
JM 12/08 - OSGi in kleinen Dosen 1JM 12/08 - OSGi in kleinen Dosen 1
JM 12/08 - OSGi in kleinen Dosen 1
Heiko Seeberger
 
JM 01/09 - OSGi in kleinen Dosen 2
JM 01/09 - OSGi in kleinen Dosen 2JM 01/09 - OSGi in kleinen Dosen 2
JM 01/09 - OSGi in kleinen Dosen 2
Heiko Seeberger
 
JM 02/09 - OSGi in kleinen Dosen 3
JM 02/09 - OSGi in kleinen Dosen 3JM 02/09 - OSGi in kleinen Dosen 3
JM 02/09 - OSGi in kleinen Dosen 3
Heiko Seeberger
 

More from Heiko Seeberger (19)

Java Magazin - Lift
Java Magazin - LiftJava Magazin - Lift
Java Magazin - Lift
 
JavaSPEKTRUM - Scala 3
JavaSPEKTRUM - Scala 3JavaSPEKTRUM - Scala 3
JavaSPEKTRUM - Scala 3
 
JavaSPEKTRUM - Scala 2
JavaSPEKTRUM - Scala 2JavaSPEKTRUM - Scala 2
JavaSPEKTRUM - Scala 2
 
JavaSPEKTRUM - Scala 1
JavaSPEKTRUM - Scala 1JavaSPEKTRUM - Scala 1
JavaSPEKTRUM - Scala 1
 
Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?
 
JM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala ReviewJM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala Review
 
JM 08/09 - ScalaModules
JM 08/09 - ScalaModulesJM 08/09 - ScalaModules
JM 08/09 - ScalaModules
 
OSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on ScalaOSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on Scala
 
Eclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by ContractEclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by Contract
 
JUGM 07 - AspectJ
JUGM 07 - AspectJJUGM 07 - AspectJ
JUGM 07 - AspectJ
 
Eclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der DreiEclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der Drei
 
Eclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance LoggingEclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance Logging
 
Eclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on EquinoxEclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on Equinox
 
Eclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matterEclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matter
 
W-JAX 07 - AOP im Einsatz mit OSGi und RCP
W-JAX 07 - AOP im Einsatz mit OSGi und RCPW-JAX 07 - AOP im Einsatz mit OSGi und RCP
W-JAX 07 - AOP im Einsatz mit OSGi und RCP
 
JM 04/09 - OSGi in kleinen Dosen 5
JM 04/09 - OSGi in kleinen Dosen 5JM 04/09 - OSGi in kleinen Dosen 5
JM 04/09 - OSGi in kleinen Dosen 5
 
JM 12/08 - OSGi in kleinen Dosen 1
JM 12/08 - OSGi in kleinen Dosen 1JM 12/08 - OSGi in kleinen Dosen 1
JM 12/08 - OSGi in kleinen Dosen 1
 
JM 01/09 - OSGi in kleinen Dosen 2
JM 01/09 - OSGi in kleinen Dosen 2JM 01/09 - OSGi in kleinen Dosen 2
JM 01/09 - OSGi in kleinen Dosen 2
 
JM 02/09 - OSGi in kleinen Dosen 3
JM 02/09 - OSGi in kleinen Dosen 3JM 02/09 - OSGi in kleinen Dosen 3
JM 02/09 - OSGi in kleinen Dosen 3
 

Recently uploaded

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 

Recently uploaded (20)

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 

W-JAX 08 - Aspect Weaving for OSGii

  • 1. Aspect Weaving for OSGi Martin Lippert (akquinet it-agile GmbH) Heiko Seeberger (Weigle Wil H ik S b (W i l Wilczek G bH) k GmbH) © 2008 by Martin Lippert, Heiko Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license | November 7th, 2008
  • 2. Aspect-oriented programming • Modularity improved a lot by OO concepts Classes, interfaces Information hiding, polymorphism, inheritance • AOP adds additional concepts To modularize so called “cross-cutting concerns” ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 3. AOP today • Meanwhile AOP is an established concept Useful for many situations Mostly technology-centric usage scenarios • Established languages and frameworks available AspectJ: powerful language extension to Java Spring-AOP: Spring AOP: simple to use AOP for enterprise apps • Used in production: Spring itself makes heavy use of AOP concepts App-servers are using AOP inside Direct AOP selectively used in enterprise apps Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 4. AspectJ = AOP for Java • AspectJ is a powerful language extension for Java Hosted as an Eclipse project Still very active (latest release 1.6.1 in July 2008) • AJDT: Great tooling for the Eclipse IDE (3.3, 3.4) Comes close to the JDT feeling • Spring-IDE: Integrates AJDT with Spring-AOP AJDT feeling for Spring apps Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 5. The Standard Use Case ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX Project Sources Single Application Classpath Java Virtual Machine Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 6. Library Aspects ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX Project Sources JAR Single Application Classpath Java Virtual Machine Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 7. Aspects for Existing Code ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX JARs Project Sources Single Application Classpath Java Virtual Machine Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 8. Java + OSGi • OSGi: “A dynamic module system for Java” • Modularity • Dynamic • Service-Oriented Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 9. What does it mean for us? • We would like to modularize … classes and interfaces into bundles … and aspects into bundles • The obvious next step: modularize cross cutting concerns into bundles cross-cutting • Takes modularity to the next level Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 10. Intra-Bundle Aspects ClassA ClassB ClassC AspectX ConcernX ConcernX Bundle A Bundle B Bundle-Classpath Bundle-Classpath Java Virtual Machine Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 11. Co-Op Bundle Aspects ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX Bundle A Bundle B Bundle C Bundle-Classpath Bundle-Classpath Bundle-Classpath Java Virtual Machine Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 12. Abstract Aspect Bundles ClassA ClassB Abstract Ab t t Concrete C t Aspect Aspect ConcernX ConcernX ConcernX ConcernX Bundle A Bundle B Bundle-Classpath Bundle-Classpath Java Virtual Machine Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 13. Dynamics for Aspect Bundles • OSGi allows dynamic bundle … installs … uninstalls … updates • Same should be possible for aspect bundles … dynamic installs, uninstalls and updates of aspect bundles … dynamic installs, uninstalls and updates of bundles that are affected by aspects ff t d b t Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 14. How could all this possibly work? Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 15. Equinox Aspects • Equinox Incubator Project http://www.eclipse.org/equinox/incubator/aspects • Enables AspectJ/AOP for OSGi Supports all presented use-cases Ready-to-use Ready to use • Setting Works with Eclipse 3.4 (and 3.3 deprecated) Works with AJDT 1.5.2, 1.5.3, 1.6.0, 1.6.1 Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 16. What can I do? • Put aspects into standard OSGi bundles Just like Java classes • Define what and where to weave aop.xml and manifest headers • Go! • Feels like a natural combination of AOP and OSGi OSGi… Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 17. Load-Time Weaving for OSGi • Let the OSGi runtime take care of weaving the aspects (and not the compiler) Leads to load-time weaving within OSGi • This means: No recompilation of existing bundles necessary Supports “aop.xml” load-time weaving config of AspectJ Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 18. Live Demo • Monitoring Eclipse bundles bundles… Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 19. Caching • Wasn’t that a fast startup? Wasn t • The reason: caching for woven classes Load-time weaving happens only once Second time startup is same as without aspects Available for t d d JREs d A il bl f standard JRE and IBM J9 shared classes h dl Supports configuration switching Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 20. Dynamics • Dynamics for aspect bundles Means re- or un-weaving existing bundles • How is it realized? Silent update of bundles to be woven again Bundles must behave nicely within dynamic situations Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 21. Live Demo • Installing Installing, updating, uninstalling aspects at runtime… Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 22. AOP in Spring • Spring uses AOP a lot for all kinds of purposes • @Configurable is one example • Realized by Spring via load-time aspect weaving Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 23. Spring & Equinox Aspects • Equinox Aspects can do load time aspect weaving for load-time Spring-powered bundles… • Live Demo @Configurable for Extensions (Views in Eclipse RCP apps) Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 24. APIs and Implementation • org eclipse equinox weaving hook org.eclipse.equinox.weaving.hook Hooks into the runtime Provides API for injecting weaving and caching implementations • org.eclipse.equinox.weaving.aspectj Implements aspect weaving using AspectJ • org.eclipse.equinox.weaving.caching Implements caching for standard VMs • org.eclipse.equinox.weaving.caching.j9 Implements caching for IBM J9 VMs (shared classes feature) Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 25. Conclusions • Equinox Aspects brings full AOP to OSGi Load-time weaving integrated into OSGi Combines OSGi and AOP modularity features • Can be used for production systems today • Give it a try http://www.eclipse.org/equinox/incubator/aspects Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license
  • 26. Thank you for your attention! Q&A Heiko Seeberger: seeberger@weiglewilczek.com Martin Lippert lippert@acm org Lippert: lippert@acm.org Aspect Weaving for OSGi | © 2008 by M. Lippert, H. Seeberger; made available under Creative Commons Att. Nc Nd 2.5 license