SlideShare a Scribd company logo
1 of 44
Download to read offline
Classloading and Type Visibility in OSGi



                                                                     Martin Li
                                                                     M ti Lippertt
                                                           akquinet it-agile GmbH
                                                       martin.lippert@akquinet.de




© 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license | November 4th, 2008
Overview
• Introduction to classloading
       What is classloading?
       How does classloading work?
       What does classloading mean for daily development?
• Classloading in OSGi
       What is different?
       Dependency and visibility
       Advanced classloading in OSGi
       Some Equinox specifics
• Conclusions


   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
What is Classloading?
• Classloaders are Java objects
• They are responsible for loading classes into the VM
      Every class is loaded by a classloader into the VM
          y                  y
      There is no way around
• Every class has a reference to its classloader object
      myObject.getClass().getClassLoader()
        Obj t    tCl   ()   tCl   L d ()


• Originally motivated by Applets
      To load classes from the server into the browser VM




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Classloader API
p
public abstract class ClassLoader {

    public Class<?> loadClass(String name)

    p
    public URL getResource(String name)
               g          (     g     )
    public Enumeration<URL> getResources(String name)
    public InputStream getResourceAsStream(String name)

    p
    public final ClassLoader getParent()
                             g        ()

    public       static         URL getSystemResource(String name)
    public       static         Enumeration<URL> getSystemResources(String name)
    public
    p            static           p
                                InputStream getSystemResourceAsStream(String name)
                                            g   y                          g
    public       static         ClassLoader getSystemClassLoader()

    ...
}


     Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Implicit class loading

public class A {
  public void foo() {
    B b = new B();
    b.sayHello();
                                                                       causes the VM to load
  }
                                                                       class B using the
}
                                                                       classloader of A




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Dynamic class loading

public void foo() {
  ClassLoader cl =
       this.getClass().getClassLoader();
  Class<?> clazz = cl.loadClass(quot;Aquot;);
  Object obj = clazz.newInstance();

    ...
}




    Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Hierarchical classloaders
• Classloaders typically have a parent classloader
       Chained classloading


• If a classloader is invoked to load a class, it first calls
  the parent classloader
       Parent first strategy
       P     t fi t t t
       This helps to prevent loading the same class multiple times




   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Classloader hierarchy

                                                                                       Class A
                           Classloader A                                                 A.jar



                                             parent

                                                                                       Class B
                           Classloader B
                                                                                         B.jar



loaderB.loadClass(quot;Aquot;);



  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type compatibility

                                                                                                       Class A
                                          Classloader A                                                  A.jar

loaderA.loadClass(quot;Aquot;);
                                                            parent

                                                                                                       Class B
                                          Classloader B
                                                                                                         B.jar

        Returns the same class object as
          loaderB.loadClass(quot;Aquot;)



    Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Defining vs. Initiating classloader

 Defining loader




Initiating loader




   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type compatibility II

                                                                                              Class A
                                          Classloader A                                         A.jar


                            parent                                            parent


     Class B                                                                                                Class B
                     Classloader B1                                    Classloader B2
      B.jar                                                                                                   B.jar




loaderB1.loadClass(“A”) == loaderB2.loadClass(“A”)
loaderB1.loadClass(“B”) != loaderB2.loadClass(“B”)


  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type compatibility III
                                                                                               Class A
                                           Classloader A                                        A.jar


                             parent                                           parent


     Class B                                                                                                 Class B
                     Classloader B1                                    Classloader B2
       B.jar
       B jar                                                                                                  B jar
                                                                                                              B.jar



Object b1 = loaderB1.loadClass(“B”).newInstance();
b1    !instanceof                      loaderB2.loadClass(“B”)


     Remember: a class is identified by its name (including the
         package name) AND its defining classloader !!!
     Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type compatibility IV
                                                                                            Class A
                                         Classloader A                                        A.jar
                                                public interface A {}
                           parent                                           parent


   Class B                                                                                                Class B
                   Classloader B1                                    Classloader B2
     B.jar
       j                                                                                                    B.jar
                                                                                                              j
                        public class B implements A {}



A anA = loaderB1.loadClass(“B”).newInstance();
        loaderB1.loadClass( B ).newInstance();
A anotherA = loaderB2.loadClass(“B”).newInstance();
anA = anotherA; (Assignment)



   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
The default setting


          Bootstrap Classloader                                          loads JVM classes (rt.jar)



                                                                         loads classes from the
         Extension Classloader                                           JRE ext folder


                                                                         loads classes from your
            System Classloader                                           application classpath




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
A typical setting…
                                         bcel                           oracle                           json

           rt                          content                           dbcp                           log4j

          jce                          naming                         aspectjrt                          axis

         jsse                            core                          logging                        resource

        plugin                       commons                              poi

     marketing                         guiapp                          lucene

        spring                       hibernate                           jdom

         asm                             cglib                           utils




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Threads context classloader
Thread.currentThread().getContextClassLoader()
Thread currentThread() getContextClassLoader()
Thread.currentThread().setContextClassLoader(..)


• Typically used in libraries to access the context in
  which the library is called




   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Classloader.loadClass vs. Class.forName
•Classloader.loadClass()
 Cl   l d    l dCl    ()    caches the loaded class
 object and returns always the same class object
      This is done by the defining classloader
      This ensures that each classloader loads the same class only
      once
•Class.forName()
 Class.forName()   calls the normal classloader
 hierarchy to load the class (same happens as above)
      But caches the class object within the initiating
      classloader
      In standard cases no problem but can be tricky in dynamic
      environments


  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Classloading is dynamic
• You can create classloaders at runtime
• You can trigger them to load a specific class

• For example:
      What app/web servers do for hot deployment




•S           l      the l
 Some people say th classloading mechanism i th
                              l di       h i    is the
 only real innovation in the Java programming language


  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Classloading in OSGi
• “OSGi is a service framework”
   OSGi              framework

• What is necessary:
      Dependencies between bundles
            Import- and Export-Package, Require-Bundle
      Dynamic Bundle Lifecycle
            Install, Update, Uninstall bundles


• Realized via specialized classloading



  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Classloader per bundle
 • One classloader per bundle
        Controls what is visible from the bundle
        Controls what is visible from other bundles


                            Class A
Classloader
                          Bundle A
                                                                                                        Class B
                                                                     Classloader
                                                                                                      Bundle B

                                               Class C
            Classloader
                                             Bundle C



    Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Classloader per bundle
• Effects
       No linear class path for your application anymore
       Instead class path per bundle
       No real parent hierarchy anymore


• Classloader parent setting
       Default: Bootstrap classloader
       Can be parameterized via system property




   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Dependencies via delegation
                                   Export-Package:
                                   Export Package: mypackageA
                Class A

              Bundle A



                                    Import-Package: mypackageA,                                                  Class B
                                     mypackageC
                                                                                                               Bundle B




Class C          Export-Package: mypackageC
Bundle C         Import-Package: mypackageA


  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type Visibility I

                           Export-Package: mypackageA
         Class A

       Bundle A

                                                                                                                 Class B
                                     Import-Package: mypackageA
                                                                                                               Bundle B
A anA = new A();

                                                                                   A anA = new A();

                   class A is loaded only once by
                    class A is loaded only once by
                       bundle A (the bundles
                  bundle A (its defining classloader)
                             classloader)
   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type Visibility II

                              Export-Package: mypackageA
            Class A

          Bundle A

                                                                                                                    Class B
                                        Import-Package: mypackageA
                                                                                                                  Bundle B
A anA = new A();

                                                                                      A anA = new A();
     class is loaded
successfully (if requested
    inside bundle A)                                        bundle B remains in state “installed”
                                                             (not resolved), no loading of type A
                                                                          possible
      Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type Visibility III

                            Export-Package: mypackageA
          Class A

        Bundle A

                                                                                                                  Class B
                                      Import-Package: mypackageA
                                                                                                                Bundle B
A anA = new A();

       class is loaded                                                              A anA = new A();
        successfully

                                                                  ClassNotFoundException
                                                                                   p


    Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type Compatibility revisited I

                           Export-Package: mypackageA
         Class A

       Bundle A

                                                                                                                 Class B
                                     Import-Package: mypackageA
                                                                                                               Bundle B
A anA = new A();

                                                                     A anotherA = new A();


                       exactly the same type


   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type Compatibility revisited II
Export Package:
Export-Package:                                                        Export-Package:
                                                                       Export Package:
mypackageA;version=quot;1.0.0quot;                                             mypackageA;version=“2.0.0quot;
                 Class A                                                                    Class A

               Bundle A                                                                    Bundle A



Import-Package:                                                        Import-Package:
mypackageA;version= 1.0.0
mypackageA;version=“1 0 0quot;                                             mypackageA;version=“2 0 0quot;
                                                                       mypackageA;version= 2.0.0
                  Class B                                                                    Class C

                Bundle B                                                                   Bundle C




A anA = new A();                                                        A anA = new A();

             Completely different and incompatible types
   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Type Compatibility revisited III                                                                            Type A

                                            public interface A {}                                        Bundle A

 Class B
                 public class B impl A {}
Bundle B

                                 public class C impl A {}
                Class C

              Bundle C


                                                                                                     Class D
            A myA = createServiceA();
                                                                                                   Bundle D


 Static type of myA is A, dynamic type of myA
                could be B or C
   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
ClassNotFoundException
• Typical reasons for a ClassNotFoundException:
       Dependency to declaring bundle not defined
       Type is not visible (not exported)


• Dynamically generated classes
       Proxies
       CGLib
       …


• Serialisation


   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Libraries
                                                                                          org.hibernate
• What happens if a library needs                                                            B dl
                                                                                             Bundle
  to load classes from its clients?
       e.g. persistence libraries?


• Cyclic dependencies are not                                                             Import-Package:
  allowed and maybe even not                                                               org.hibernate
                                                                                           org hibernate
  what you want                                                                                Class A

                                                                                             Bundle A




   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Register classes
• Register types the library need via an API
       E.g.
       Hibernate.registerClass(Class clientClass)


• This allows the lib to create objects of those types without
  loading those classes directly
        g                       y




   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
DynamicImport-Package
                                                                        DynamicImport-Package: *
                                                                         y       p         g
• Works similar to Import
                   Import-
                                                                                          org.hibernate
  Package, but                                                                               Bundle
       wiring does not happen at resolve
       instead at first access to such a
       type
• Wildcards possible
       * allows a bundle to see                                                           Import-Package:
       “everything”                                                                        org.hibernate
                                                                                               Class A
       Should be used very rarely, as
                              rarely
       a “last resort”                                                                       Bundle A




   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Equinox buddy loading I
• Equinox provides so called “Buddy Loading
                              Buddy Loading”

      “I am a buddy of hibernate. Hibernate is allowed to
      access my types”




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Equinox buddy loading II
                                                   Eclipse-BuddyPolicy: registered

                                                                                org.hibernate
                                                                                   Bundle

Allows org.hibernate bundle to
     execute successfully
      loadClass(“A”)

                                                                Eclipse-RegisterBuddy:
                                                                            org.hibernate
                                                                                     Class A
                                                                                     Cl

                                                                                   Bundle A


                                                               A anA = new A();
  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Equinox buddy loading III
• Important difference:
       Buddy loading can load all classes from a buddy bundle
       not only exported types


• Its just a workaround for libraries and other existing
  code that does not behave correctly within the OSGi
  world

• Take care: you could loose consistency



   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
CGLib
                                                                            Bundle
Generated Proxies
• Situation:                                                                                                     Spring
                                                                                                                 Bundle
       Ask the Spring bundle for a bean
• What does Spring?
             p g
       Creates a proxy for the bean using the
       classloader of bundle A using CGLib
• The result
       The proxy type needs to be loaded by a
       classloader that is able to see types from
                                                                                                                Class A
       bundle A and CGLib
                                                                                                              Bundle A




   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
The loading sequence
1.
1     Try the parent for “java ” packages
                            java.
2.    Try the parent for boot delegation packages
3.
3     Try to find it from imported packages
4.    Try to find it from required bundles
5.    Try to find it from its own class path
6.    Try to find it from dynamic import
7.    Try to find it via buddy loading




     Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Garbage Collection for Classloaders
• You could expect that the classloader of a bundle gets
  garbage collected if the bundle is stopped or
  uninstalled

• This is not automatically the case!!!

• You need to ensure that all objects from those classes
  loaded by this classloader are no longer referenced




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
What does this mean?
• Example:
       You request an OSGi service and get an OSGi service back
       The service you get is provided by bundle A
       Next you uninstall bundle A


• If you stay with your object reference to the service
                                                service,
  the classloader of A can never be collected




   Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Service Tracker helps
• Use a Service Tracker
        Service-Tracker

• Takes care of …
      holding the reference for performance reasons
      As long as the service is available
      But
      B t no llonger!!




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
“High Performance Classloading”
• Classloading consumes a remarkable amount of time
  at startup
• OSGi allows to highly optimize classloading
                   g y p                    g
      Finding the right class
      Highly optimized implementations available
      Avoid dynamic import




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Classloading Hooks
• Equinox provides a hook mechanism
      To enhance and modify the behavior of the runtime


• Examples
      Modify bytecode at load-time
      Intercept bundle data access


• Eat your own dog food
      Some Equinox features are implemented using those hooks
      e.g. Eclipse-LazyStart



  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Conclusions
• Changing the viewpoint from the linear classpath to a
  per-bundle classpath
• Clearly defined dependencies and visibilities
        y           p
      Real modularity
      Classloading only implementation detail


• Use OSGi in a clean and correct way and you
  never need to think about classloading at all
                                       g




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
Thank you for your attention!



Q&A


Martin Lippert: martin.lippert@akquinet.de




  Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license

More Related Content

What's hot

MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼NeoClova
 
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكلحل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكلMohamed Moustafa
 
Oracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API ExamplesOracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API ExamplesBobby Curtis
 
Oracle Result Cache deep dive
Oracle Result Cache deep diveOracle Result Cache deep dive
Oracle Result Cache deep diveAlexander Tokarev
 
[오픈소스컨설팅]스카우터엑스 소개
[오픈소스컨설팅]스카우터엑스 소개[오픈소스컨설팅]스카우터엑스 소개
[오픈소스컨설팅]스카우터엑스 소개Open Source Consulting
 
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇BOAZ Bigdata
 
Query Engines for Hive: MR, Spark, Tez with LLAP – Considerations!
Query Engines for Hive: MR, Spark, Tez with LLAP – Considerations!Query Engines for Hive: MR, Spark, Tez with LLAP – Considerations!
Query Engines for Hive: MR, Spark, Tez with LLAP – Considerations!Mich Talebzadeh (Ph.D.)
 
Monitoring Spark Applications
Monitoring Spark ApplicationsMonitoring Spark Applications
Monitoring Spark ApplicationsTzach Zohar
 
APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101Connor McDonald
 
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning ServicestwMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning ServicestwMVC
 
SCIM presentation from CIS 2012
SCIM presentation from CIS 2012SCIM presentation from CIS 2012
SCIM presentation from CIS 2012Twobo Technologies
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricksbcoca
 
Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...
Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...
Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...Markus Michalewicz
 
Installation de Sylius 2.0 et découverte du nouveau backoffice en Bootstrap
Installation de Sylius 2.0 et découverte du nouveau backoffice en BootstrapInstallation de Sylius 2.0 et découverte du nouveau backoffice en Bootstrap
Installation de Sylius 2.0 et découverte du nouveau backoffice en BootstrapMaxime Huran 🌈
 
New in Oracle Universal Installer (OUI)
New in Oracle Universal Installer (OUI) New in Oracle Universal Installer (OUI)
New in Oracle Universal Installer (OUI) Markus Michalewicz
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyAlexander Kukushkin
 
What should a hacker know about WebDav?
What should a hacker know about WebDav?What should a hacker know about WebDav?
What should a hacker know about WebDav?Mikhail Egorov
 

What's hot (20)

MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼
 
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكلحل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
 
Oracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API ExamplesOracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API Examples
 
ZDLRA in Action
ZDLRA in ActionZDLRA in Action
ZDLRA in Action
 
Less03 db dbca
Less03 db dbcaLess03 db dbca
Less03 db dbca
 
Oracle Result Cache deep dive
Oracle Result Cache deep diveOracle Result Cache deep dive
Oracle Result Cache deep dive
 
[오픈소스컨설팅]스카우터엑스 소개
[오픈소스컨설팅]스카우터엑스 소개[오픈소스컨설팅]스카우터엑스 소개
[오픈소스컨설팅]스카우터엑스 소개
 
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
 
Query Engines for Hive: MR, Spark, Tez with LLAP – Considerations!
Query Engines for Hive: MR, Spark, Tez with LLAP – Considerations!Query Engines for Hive: MR, Spark, Tez with LLAP – Considerations!
Query Engines for Hive: MR, Spark, Tez with LLAP – Considerations!
 
Monitoring Spark Applications
Monitoring Spark ApplicationsMonitoring Spark Applications
Monitoring Spark Applications
 
Oracle Data Guard
Oracle Data GuardOracle Data Guard
Oracle Data Guard
 
APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101
 
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning ServicestwMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
 
SCIM presentation from CIS 2012
SCIM presentation from CIS 2012SCIM presentation from CIS 2012
SCIM presentation from CIS 2012
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricks
 
Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...
Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...
Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...
 
Installation de Sylius 2.0 et découverte du nouveau backoffice en Bootstrap
Installation de Sylius 2.0 et découverte du nouveau backoffice en BootstrapInstallation de Sylius 2.0 et découverte du nouveau backoffice en Bootstrap
Installation de Sylius 2.0 et découverte du nouveau backoffice en Bootstrap
 
New in Oracle Universal Installer (OUI)
New in Oracle Universal Installer (OUI) New in Oracle Universal Installer (OUI)
New in Oracle Universal Installer (OUI)
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easy
 
What should a hacker know about WebDav?
What should a hacker know about WebDav?What should a hacker know about WebDav?
What should a hacker know about WebDav?
 

Viewers also liked

Java class loader
Java class loaderJava class loader
Java class loaderbenewu
 
03 osgi and servicemix
03 osgi and servicemix03 osgi and servicemix
03 osgi and servicemixRedpillLinpro
 
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...mfrancis
 
Modular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim WardModular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim Wardmfrancis
 
Object relationship mapping and hibernate
Object relationship mapping and hibernateObject relationship mapping and hibernate
Object relationship mapping and hibernateJoe Jacob
 
Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001Sven Ruppert
 
Understanding Java Dynamic Proxies
Understanding Java Dynamic ProxiesUnderstanding Java Dynamic Proxies
Understanding Java Dynamic ProxiesOSOCO
 
AWS CloudFormation en 5 Minutos
AWS CloudFormation en 5 MinutosAWS CloudFormation en 5 Minutos
AWS CloudFormation en 5 MinutosOSOCO
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 

Viewers also liked (14)

Java class loader
Java class loaderJava class loader
Java class loader
 
03 osgi and servicemix
03 osgi and servicemix03 osgi and servicemix
03 osgi and servicemix
 
Delving Deeper Into OSGI Modularity
Delving Deeper Into OSGI ModularityDelving Deeper Into OSGI Modularity
Delving Deeper Into OSGI Modularity
 
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
 
Modular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim WardModular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim Ward
 
Proxy & CGLIB
Proxy & CGLIBProxy & CGLIB
Proxy & CGLIB
 
Object relationship mapping and hibernate
Object relationship mapping and hibernateObject relationship mapping and hibernate
Object relationship mapping and hibernate
 
Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001
 
Dynamic Proxy by Java
Dynamic Proxy by JavaDynamic Proxy by Java
Dynamic Proxy by Java
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
 
Understanding Java Dynamic Proxies
Understanding Java Dynamic ProxiesUnderstanding Java Dynamic Proxies
Understanding Java Dynamic Proxies
 
AWS CloudFormation en 5 Minutos
AWS CloudFormation en 5 MinutosAWS CloudFormation en 5 Minutos
AWS CloudFormation en 5 Minutos
 
Hibernate in Action
Hibernate in ActionHibernate in Action
Hibernate in Action
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 

More from martinlippert

WJAX 2013: Java8-Tooling in Eclipse
WJAX 2013: Java8-Tooling in EclipseWJAX 2013: Java8-Tooling in Eclipse
WJAX 2013: Java8-Tooling in Eclipsemartinlippert
 
WJAX 2013: Die PaaS-Parade - Teil 2 - Cloud Foundry
WJAX 2013: Die PaaS-Parade - Teil 2 - Cloud FoundryWJAX 2013: Die PaaS-Parade - Teil 2 - Cloud Foundry
WJAX 2013: Die PaaS-Parade - Teil 2 - Cloud Foundrymartinlippert
 
EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...
EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...
EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...martinlippert
 
EclipseCon-Europe 2013: Making the Eclipse IDE fun again
EclipseCon-Europe 2013: Making the Eclipse IDE fun againEclipseCon-Europe 2013: Making the Eclipse IDE fun again
EclipseCon-Europe 2013: Making the Eclipse IDE fun againmartinlippert
 
Jax2013 PaaS-Parade - Part 1: Cloud Foundry
Jax2013 PaaS-Parade - Part 1: Cloud FoundryJax2013 PaaS-Parade - Part 1: Cloud Foundry
Jax2013 PaaS-Parade - Part 1: Cloud Foundrymartinlippert
 
JAX 2013: Modern Architectures with Spring and JavaScript
JAX 2013: Modern Architectures with Spring and JavaScriptJAX 2013: Modern Architectures with Spring and JavaScript
JAX 2013: Modern Architectures with Spring and JavaScriptmartinlippert
 
JAX 2013: Introducing Eclipse Orion
JAX 2013: Introducing Eclipse OrionJAX 2013: Introducing Eclipse Orion
JAX 2013: Introducing Eclipse Orionmartinlippert
 
Spring Tooling: What's new and what's coming
Spring Tooling: What's new and what's comingSpring Tooling: What's new and what's coming
Spring Tooling: What's new and what's comingmartinlippert
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 
Scripted - Embracing Eclipse Orion
Scripted - Embracing Eclipse OrionScripted - Embracing Eclipse Orion
Scripted - Embracing Eclipse Orionmartinlippert
 
PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundrymartinlippert
 
Browser and Cloud - The Future of IDEs?
Browser and Cloud - The Future of IDEs?Browser and Cloud - The Future of IDEs?
Browser and Cloud - The Future of IDEs?martinlippert
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 
What's new with tooling for Spring, Grails, and the Cloud
What's new with tooling for Spring, Grails, and the CloudWhat's new with tooling for Spring, Grails, and the Cloud
What's new with tooling for Spring, Grails, and the Cloudmartinlippert
 
Tooling for the JavaScript Era
Tooling for the JavaScript EraTooling for the JavaScript Era
Tooling for the JavaScript Eramartinlippert
 
Embracing Eclipse Orion
Embracing Eclipse OrionEmbracing Eclipse Orion
Embracing Eclipse Orionmartinlippert
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptmartinlippert
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptmartinlippert
 
JAX 2012: Pimp Your IDE Productivity
JAX 2012: Pimp Your IDE ProductivityJAX 2012: Pimp Your IDE Productivity
JAX 2012: Pimp Your IDE Productivitymartinlippert
 
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...martinlippert
 

More from martinlippert (20)

WJAX 2013: Java8-Tooling in Eclipse
WJAX 2013: Java8-Tooling in EclipseWJAX 2013: Java8-Tooling in Eclipse
WJAX 2013: Java8-Tooling in Eclipse
 
WJAX 2013: Die PaaS-Parade - Teil 2 - Cloud Foundry
WJAX 2013: Die PaaS-Parade - Teil 2 - Cloud FoundryWJAX 2013: Die PaaS-Parade - Teil 2 - Cloud Foundry
WJAX 2013: Die PaaS-Parade - Teil 2 - Cloud Foundry
 
EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...
EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...
EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...
 
EclipseCon-Europe 2013: Making the Eclipse IDE fun again
EclipseCon-Europe 2013: Making the Eclipse IDE fun againEclipseCon-Europe 2013: Making the Eclipse IDE fun again
EclipseCon-Europe 2013: Making the Eclipse IDE fun again
 
Jax2013 PaaS-Parade - Part 1: Cloud Foundry
Jax2013 PaaS-Parade - Part 1: Cloud FoundryJax2013 PaaS-Parade - Part 1: Cloud Foundry
Jax2013 PaaS-Parade - Part 1: Cloud Foundry
 
JAX 2013: Modern Architectures with Spring and JavaScript
JAX 2013: Modern Architectures with Spring and JavaScriptJAX 2013: Modern Architectures with Spring and JavaScript
JAX 2013: Modern Architectures with Spring and JavaScript
 
JAX 2013: Introducing Eclipse Orion
JAX 2013: Introducing Eclipse OrionJAX 2013: Introducing Eclipse Orion
JAX 2013: Introducing Eclipse Orion
 
Spring Tooling: What's new and what's coming
Spring Tooling: What's new and what's comingSpring Tooling: What's new and what's coming
Spring Tooling: What's new and what's coming
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 
Scripted - Embracing Eclipse Orion
Scripted - Embracing Eclipse OrionScripted - Embracing Eclipse Orion
Scripted - Embracing Eclipse Orion
 
PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundry
 
Browser and Cloud - The Future of IDEs?
Browser and Cloud - The Future of IDEs?Browser and Cloud - The Future of IDEs?
Browser and Cloud - The Future of IDEs?
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 
What's new with tooling for Spring, Grails, and the Cloud
What's new with tooling for Spring, Grails, and the CloudWhat's new with tooling for Spring, Grails, and the Cloud
What's new with tooling for Spring, Grails, and the Cloud
 
Tooling for the JavaScript Era
Tooling for the JavaScript EraTooling for the JavaScript Era
Tooling for the JavaScript Era
 
Embracing Eclipse Orion
Embracing Eclipse OrionEmbracing Eclipse Orion
Embracing Eclipse Orion
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScript
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScript
 
JAX 2012: Pimp Your IDE Productivity
JAX 2012: Pimp Your IDE ProductivityJAX 2012: Pimp Your IDE Productivity
JAX 2012: Pimp Your IDE Productivity
 
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
 

Recently uploaded

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Classloading and Type Visibility in OSGi

  • 1. Classloading and Type Visibility in OSGi Martin Li M ti Lippertt akquinet it-agile GmbH martin.lippert@akquinet.de © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license | November 4th, 2008
  • 2. Overview • Introduction to classloading What is classloading? How does classloading work? What does classloading mean for daily development? • Classloading in OSGi What is different? Dependency and visibility Advanced classloading in OSGi Some Equinox specifics • Conclusions Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 3. What is Classloading? • Classloaders are Java objects • They are responsible for loading classes into the VM Every class is loaded by a classloader into the VM y y There is no way around • Every class has a reference to its classloader object myObject.getClass().getClassLoader() Obj t tCl () tCl L d () • Originally motivated by Applets To load classes from the server into the browser VM Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 4. Classloader API p public abstract class ClassLoader { public Class<?> loadClass(String name) p public URL getResource(String name) g ( g ) public Enumeration<URL> getResources(String name) public InputStream getResourceAsStream(String name) p public final ClassLoader getParent() g () public static URL getSystemResource(String name) public static Enumeration<URL> getSystemResources(String name) public p static p InputStream getSystemResourceAsStream(String name) g y g public static ClassLoader getSystemClassLoader() ... } Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 5. Implicit class loading public class A { public void foo() { B b = new B(); b.sayHello(); causes the VM to load } class B using the } classloader of A Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 6. Dynamic class loading public void foo() { ClassLoader cl = this.getClass().getClassLoader(); Class<?> clazz = cl.loadClass(quot;Aquot;); Object obj = clazz.newInstance(); ... } Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 7. Hierarchical classloaders • Classloaders typically have a parent classloader Chained classloading • If a classloader is invoked to load a class, it first calls the parent classloader Parent first strategy P t fi t t t This helps to prevent loading the same class multiple times Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 8. Classloader hierarchy Class A Classloader A A.jar parent Class B Classloader B B.jar loaderB.loadClass(quot;Aquot;); Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 9. Type compatibility Class A Classloader A A.jar loaderA.loadClass(quot;Aquot;); parent Class B Classloader B B.jar Returns the same class object as loaderB.loadClass(quot;Aquot;) Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 10. Defining vs. Initiating classloader Defining loader Initiating loader Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 11. Type compatibility II Class A Classloader A A.jar parent parent Class B Class B Classloader B1 Classloader B2 B.jar B.jar loaderB1.loadClass(“A”) == loaderB2.loadClass(“A”) loaderB1.loadClass(“B”) != loaderB2.loadClass(“B”) Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 12. Type compatibility III Class A Classloader A A.jar parent parent Class B Class B Classloader B1 Classloader B2 B.jar B jar B jar B.jar Object b1 = loaderB1.loadClass(“B”).newInstance(); b1 !instanceof loaderB2.loadClass(“B”) Remember: a class is identified by its name (including the package name) AND its defining classloader !!! Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 13. Type compatibility IV Class A Classloader A A.jar public interface A {} parent parent Class B Class B Classloader B1 Classloader B2 B.jar j B.jar j public class B implements A {} A anA = loaderB1.loadClass(“B”).newInstance(); loaderB1.loadClass( B ).newInstance(); A anotherA = loaderB2.loadClass(“B”).newInstance(); anA = anotherA; (Assignment) Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 14. The default setting Bootstrap Classloader loads JVM classes (rt.jar) loads classes from the Extension Classloader JRE ext folder loads classes from your System Classloader application classpath Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 15. A typical setting… bcel oracle json rt content dbcp log4j jce naming aspectjrt axis jsse core logging resource plugin commons poi marketing guiapp lucene spring hibernate jdom asm cglib utils Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 16. Threads context classloader Thread.currentThread().getContextClassLoader() Thread currentThread() getContextClassLoader() Thread.currentThread().setContextClassLoader(..) • Typically used in libraries to access the context in which the library is called Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 17. Classloader.loadClass vs. Class.forName •Classloader.loadClass() Cl l d l dCl () caches the loaded class object and returns always the same class object This is done by the defining classloader This ensures that each classloader loads the same class only once •Class.forName() Class.forName() calls the normal classloader hierarchy to load the class (same happens as above) But caches the class object within the initiating classloader In standard cases no problem but can be tricky in dynamic environments Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 18. Classloading is dynamic • You can create classloaders at runtime • You can trigger them to load a specific class • For example: What app/web servers do for hot deployment •S l the l Some people say th classloading mechanism i th l di h i is the only real innovation in the Java programming language Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 19. Classloading in OSGi • “OSGi is a service framework” OSGi framework • What is necessary: Dependencies between bundles Import- and Export-Package, Require-Bundle Dynamic Bundle Lifecycle Install, Update, Uninstall bundles • Realized via specialized classloading Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 20. Classloader per bundle • One classloader per bundle Controls what is visible from the bundle Controls what is visible from other bundles Class A Classloader Bundle A Class B Classloader Bundle B Class C Classloader Bundle C Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 21. Classloader per bundle • Effects No linear class path for your application anymore Instead class path per bundle No real parent hierarchy anymore • Classloader parent setting Default: Bootstrap classloader Can be parameterized via system property Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 22. Dependencies via delegation Export-Package: Export Package: mypackageA Class A Bundle A Import-Package: mypackageA, Class B mypackageC Bundle B Class C Export-Package: mypackageC Bundle C Import-Package: mypackageA Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 23. Type Visibility I Export-Package: mypackageA Class A Bundle A Class B Import-Package: mypackageA Bundle B A anA = new A(); A anA = new A(); class A is loaded only once by class A is loaded only once by bundle A (the bundles bundle A (its defining classloader) classloader) Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 24. Type Visibility II Export-Package: mypackageA Class A Bundle A Class B Import-Package: mypackageA Bundle B A anA = new A(); A anA = new A(); class is loaded successfully (if requested inside bundle A) bundle B remains in state “installed” (not resolved), no loading of type A possible Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 25. Type Visibility III Export-Package: mypackageA Class A Bundle A Class B Import-Package: mypackageA Bundle B A anA = new A(); class is loaded A anA = new A(); successfully ClassNotFoundException p Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 26. Type Compatibility revisited I Export-Package: mypackageA Class A Bundle A Class B Import-Package: mypackageA Bundle B A anA = new A(); A anotherA = new A(); exactly the same type Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 27. Type Compatibility revisited II Export Package: Export-Package: Export-Package: Export Package: mypackageA;version=quot;1.0.0quot; mypackageA;version=“2.0.0quot; Class A Class A Bundle A Bundle A Import-Package: Import-Package: mypackageA;version= 1.0.0 mypackageA;version=“1 0 0quot; mypackageA;version=“2 0 0quot; mypackageA;version= 2.0.0 Class B Class C Bundle B Bundle C A anA = new A(); A anA = new A(); Completely different and incompatible types Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 28. Type Compatibility revisited III Type A public interface A {} Bundle A Class B public class B impl A {} Bundle B public class C impl A {} Class C Bundle C Class D A myA = createServiceA(); Bundle D Static type of myA is A, dynamic type of myA could be B or C Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 29. ClassNotFoundException • Typical reasons for a ClassNotFoundException: Dependency to declaring bundle not defined Type is not visible (not exported) • Dynamically generated classes Proxies CGLib … • Serialisation Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 30. Libraries org.hibernate • What happens if a library needs B dl Bundle to load classes from its clients? e.g. persistence libraries? • Cyclic dependencies are not Import-Package: allowed and maybe even not org.hibernate org hibernate what you want Class A Bundle A Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 31. Register classes • Register types the library need via an API E.g. Hibernate.registerClass(Class clientClass) • This allows the lib to create objects of those types without loading those classes directly g y Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 32. DynamicImport-Package DynamicImport-Package: * y p g • Works similar to Import Import- org.hibernate Package, but Bundle wiring does not happen at resolve instead at first access to such a type • Wildcards possible * allows a bundle to see Import-Package: “everything” org.hibernate Class A Should be used very rarely, as rarely a “last resort” Bundle A Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 33. Equinox buddy loading I • Equinox provides so called “Buddy Loading Buddy Loading” “I am a buddy of hibernate. Hibernate is allowed to access my types” Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 34. Equinox buddy loading II Eclipse-BuddyPolicy: registered org.hibernate Bundle Allows org.hibernate bundle to execute successfully loadClass(“A”) Eclipse-RegisterBuddy: org.hibernate Class A Cl Bundle A A anA = new A(); Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 35. Equinox buddy loading III • Important difference: Buddy loading can load all classes from a buddy bundle not only exported types • Its just a workaround for libraries and other existing code that does not behave correctly within the OSGi world • Take care: you could loose consistency Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 36. CGLib Bundle Generated Proxies • Situation: Spring Bundle Ask the Spring bundle for a bean • What does Spring? p g Creates a proxy for the bean using the classloader of bundle A using CGLib • The result The proxy type needs to be loaded by a classloader that is able to see types from Class A bundle A and CGLib Bundle A Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 37. The loading sequence 1. 1 Try the parent for “java ” packages java. 2. Try the parent for boot delegation packages 3. 3 Try to find it from imported packages 4. Try to find it from required bundles 5. Try to find it from its own class path 6. Try to find it from dynamic import 7. Try to find it via buddy loading Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 38. Garbage Collection for Classloaders • You could expect that the classloader of a bundle gets garbage collected if the bundle is stopped or uninstalled • This is not automatically the case!!! • You need to ensure that all objects from those classes loaded by this classloader are no longer referenced Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 39. What does this mean? • Example: You request an OSGi service and get an OSGi service back The service you get is provided by bundle A Next you uninstall bundle A • If you stay with your object reference to the service service, the classloader of A can never be collected Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 40. Service Tracker helps • Use a Service Tracker Service-Tracker • Takes care of … holding the reference for performance reasons As long as the service is available But B t no llonger!! Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 41. “High Performance Classloading” • Classloading consumes a remarkable amount of time at startup • OSGi allows to highly optimize classloading g y p g Finding the right class Highly optimized implementations available Avoid dynamic import Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 42. Classloading Hooks • Equinox provides a hook mechanism To enhance and modify the behavior of the runtime • Examples Modify bytecode at load-time Intercept bundle data access • Eat your own dog food Some Equinox features are implemented using those hooks e.g. Eclipse-LazyStart Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 43. Conclusions • Changing the viewpoint from the linear classpath to a per-bundle classpath • Clearly defined dependencies and visibilities y p Real modularity Classloading only implementation detail • Use OSGi in a clean and correct way and you never need to think about classloading at all g Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 44. Thank you for your attention! Q&A Martin Lippert: martin.lippert@akquinet.de Classloading and Type Visibility in OSGi | © 2008 by Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license