SlideShare a Scribd company logo
1 of 18
Download to read offline
杨泳
JBoss senior software engineer
yyang@redhat.com
Agenda

●   What’s JBoss-Modules?
●   What’s Module?
●   How JBoss-Modules do?
●   Demo
What’s JBoss-Modules

●   AS 7 bottom infrastructure
●   Load all AS7 libs, frameworks, containers,
    services by module
●   A simple APP loader, not a framework or
    container
        –   Implements a thread-safe,fast,and highly concurrent
              module class loader model
        –   Do one thing best
        –   No any dependecy
●   standalone.sh
        –   java –jar jboss-modules.jar -modulepath modules
              org.jboss.as.standalone
What’s module?
●   Module is a collection of functions to implement the
    requirements of a specific domain, and can interact with others
    by public interfaces.
●   Almost all products are made by module in various kind of
    industry
         –   Computer, Car
●   We also talk about modules in software industry
         –   user module, security module
         –   Care more module concept for Design & Development time,
               but in runtime:
                   ●   No isolation between JARs
                   ●   No protection from overlapping classes and packages
                   ●   No support of multiple versions
                   ●   No manageable dependencies(export/import)
                   ●   JAR HELL !!!
         –   How to ensure modules run as design?
                   ●   Need a module runtime environment!
What’s runtime module?
●   Different module needs separated classloader
        –   Isolated module classloader without JAR HELL
        –   Export only APIs which need to be exported
        –   Import only APIs which other module exports
●   JBoss-modules focus on runtime only
        –   No API or rule for Design&Dev time, not a library for
              development, not a framework, not a container
        –   Modules run in a separated environment expected in
             the Design&Development time
        –   Module can be developed by any other
             team/organization/ company
How JBoss-modules do?

●   Implements a thread-safe,fast,and highly
    concurrent module class loader model
       –   ClassLoader is the mechanism to separate application
             to modules in runtime
●   Manage module dependencies
●   Manage Imports and Exports
       –   Filter supported
Module ClassLoader

●   Every module has its
    classloader
       –   Load local classes
            and resources
       –   Delegate to other
            module
            classloader to
            load the
            dependencies
Module Structure

●   Jar
●   module.xml
          –   name,version
          –   resources
          –   Dependencies
          –   Main class
Module name & version
●   Module names are dot separated,a bit like package names or Maven
    group Ids.Examples:
          –   org.jboss.shrinkwrap.api
          –   org.apache.xalan
          –   org.dom4j
●   However there is no actual relationship between a module’s name and
    the names of the packages which comprise it
●



●   JBoss Modules does not support version resolution
●   Version slot allows two modules with the same name to coexist
    The version slot defaults to “main”
●   Fullname of a module
          –   org.jboss.shrinkwrap.api:main
          –   org.apache.xalan:main
          –   org.dom4j:main
Module Deployment structure
●   Use modules as
    module repo
●   Name&version slot as
    module directory
●   put resources and
    module.xml in the
    module directory
API

●   Custom your module loader extend
    org.jboss.modules.ModuleLoader
●   Load module on-flying and get their
    classloaders
       –   // Get my module loader
       –   ModuleLoader loader = ModuleLoader.forClass(getClass());
       –   // Load the module
       –   Module module = loader.loadModule(“com.widgets”);
       –   // Get its class loader
       –   ClassLoader classLoader = module.getClassLoader();
       –   // Load a class from it
       –   Class<?> c = Class.forName(“com.widgets.Widget”, true, classLoader);
Execute a module
●   Execute a module from the repository
       – which should have a main class
          specified in its module.xml descriptor


●   Java –jar jboss-modules.jar -modulepath
    modules org.foo.mymodule
JBoss-modules in AS7

●   More than 200 modules
●   Super fast bootstrap
       –   Multi-threading loading
       –   Lazy loading
●   Easily to develop your module to
    enhance AS7
●   Of course you can use jboss-modules as
    your application’s infrastructure
VS OSGi&JSR 277/294

●   OSGi
       –   Bootstrap wrapper VS Container
       –   lightweight VS heavy
               ●   Do one thing vs All in one
               ●   Easy to start
●   JSR 277/294 – Java Module System
       –   Stopped
       –   Jigsaw is a prototype module system intended
              for Java 8
       –   JBoss-modules will be compliant with Java
             Module System
Future Directions

●   Tooling
       –   Make it easier to figure out needed and
            missing dependencies(perhaps a
            modified version of Tattletale)
●   IDE integration
       –   Make it easier to run (and debug)
            modular code from within an IDE
Reference
●   Get the sources at
    http://github.com/jbossas/jboss-modules
●   File issues at
    https://issues.jboss.org/browse/MODULES
●   Read documentation at
    http://docs.jboss.org/jbossmodule
●   Discuss your ideas on irc.freenode.net:#jboss-
    modules
●   Chinese docs:
        –   http://jbosscn.iteye.com/
        –   http://www.bluedash.net/spaces/JBoss%20Module
              %E4%BB%8B%E7%BB%8D
DEMO

●   Two modules with one has dependencies to
    the other
Q&A




杨泳 (yyang@redhat.com)
JBoss senior software engineer

More Related Content

What's hot

Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Martin Toshev
 
Java Course In Thane,Mumbai
Java Course In Thane,MumbaiJava Course In Thane,Mumbai
Java Course In Thane,Mumbainettech90
 
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVMJava Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVMshamnasain
 
02 java programming features of java i
02 java programming features of java  i02 java programming features of java  i
02 java programming features of java iRavi Patki
 
J2EE Struts with Hibernate Framework
J2EE Struts with Hibernate FrameworkJ2EE Struts with Hibernate Framework
J2EE Struts with Hibernate Frameworkmparth
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Rikard Thulin
 
Requirejs Demo - 2/14/12
Requirejs Demo - 2/14/12Requirejs Demo - 2/14/12
Requirejs Demo - 2/14/12John Loy
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentalsOm Ganesh
 
JAVA ENVIRONMENT
JAVA  ENVIRONMENTJAVA  ENVIRONMENT
JAVA ENVIRONMENTjosemachoco
 
Introduction to Java Programming
Introduction to Java Programming Introduction to Java Programming
Introduction to Java Programming Saravanakumar R
 
Java Development Kit (jdk)
Java Development Kit (jdk)Java Development Kit (jdk)
Java Development Kit (jdk)Jadavsejal
 

What's hot (19)

Java 9 Jigsaw HackDay
Java 9 Jigsaw HackDayJava 9 Jigsaw HackDay
Java 9 Jigsaw HackDay
 
Java 1
Java 1Java 1
Java 1
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
 
Learn Java Part 1
Learn Java Part 1Learn Java Part 1
Learn Java Part 1
 
Java Course In Thane,Mumbai
Java Course In Thane,MumbaiJava Course In Thane,Mumbai
Java Course In Thane,Mumbai
 
Java modularity: life after Java 9
Java modularity: life after Java 9Java modularity: life after Java 9
Java modularity: life after Java 9
 
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVMJava Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
 
02 java programming features of java i
02 java programming features of java  i02 java programming features of java  i
02 java programming features of java i
 
J2EE Struts with Hibernate Framework
J2EE Struts with Hibernate FrameworkJ2EE Struts with Hibernate Framework
J2EE Struts with Hibernate Framework
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4
 
Modular Java
Modular JavaModular Java
Modular Java
 
JDK,JRE,JVM
JDK,JRE,JVMJDK,JRE,JVM
JDK,JRE,JVM
 
Requirejs Demo - 2/14/12
Requirejs Demo - 2/14/12Requirejs Demo - 2/14/12
Requirejs Demo - 2/14/12
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
JAVA ENVIRONMENT
JAVA  ENVIRONMENTJAVA  ENVIRONMENT
JAVA ENVIRONMENT
 
Introduction to Java Programming
Introduction to Java Programming Introduction to Java Programming
Introduction to Java Programming
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
Java Development Kit (jdk)
Java Development Kit (jdk)Java Development Kit (jdk)
Java Development Kit (jdk)
 
Java - At a glance
Java - At a glanceJava - At a glance
Java - At a glance
 

Viewers also liked

Guvnor presentation jervis liu
Guvnor presentation jervis liuGuvnor presentation jervis liu
Guvnor presentation jervis liujbossug
 
Jbug beijing 2011 rest easy introduction [兼容模式]
Jbug beijing 2011  rest easy introduction [兼容模式]Jbug beijing 2011  rest easy introduction [兼容模式]
Jbug beijing 2011 rest easy introduction [兼容模式]jbossug
 
20 Creative Sustainable Packaging Design Examples
20 Creative Sustainable Packaging Design Examples20 Creative Sustainable Packaging Design Examples
20 Creative Sustainable Packaging Design ExamplesPrintsome
 
Essential things that should always be in your car
Essential things that should always be in your carEssential things that should always be in your car
Essential things that should always be in your carEason Chan
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSSRachel Andrew
 
Classroom Management Tips for Kids and Adolescents
Classroom Management Tips for Kids and AdolescentsClassroom Management Tips for Kids and Adolescents
Classroom Management Tips for Kids and AdolescentsShelly Sanchez Terrell
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your BusinessBarry Feldman
 

Viewers also liked (7)

Guvnor presentation jervis liu
Guvnor presentation jervis liuGuvnor presentation jervis liu
Guvnor presentation jervis liu
 
Jbug beijing 2011 rest easy introduction [兼容模式]
Jbug beijing 2011  rest easy introduction [兼容模式]Jbug beijing 2011  rest easy introduction [兼容模式]
Jbug beijing 2011 rest easy introduction [兼容模式]
 
20 Creative Sustainable Packaging Design Examples
20 Creative Sustainable Packaging Design Examples20 Creative Sustainable Packaging Design Examples
20 Creative Sustainable Packaging Design Examples
 
Essential things that should always be in your car
Essential things that should always be in your carEssential things that should always be in your car
Essential things that should always be in your car
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSS
 
Classroom Management Tips for Kids and Adolescents
Classroom Management Tips for Kids and AdolescentsClassroom Management Tips for Kids and Adolescents
Classroom Management Tips for Kids and Adolescents
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
 

Similar to As7 jbug j_boss_modules_yang yong

Jax london 2011
Jax london 2011Jax london 2011
Jax london 2011njbartlett
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJava Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJAX London
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules uploadRyan Cuprak
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)David Bosschaert
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Martin Toshev
 
Java Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module SystemVignesh Ramesh
 
Java SE 9 modules - an introduction (July 2018)
Java SE 9 modules - an introduction (July 2018)Java SE 9 modules - an introduction (July 2018)
Java SE 9 modules - an introduction (July 2018)Stephen Colebourne
 
Java 9 Module System
Java 9 Module SystemJava 9 Module System
Java 9 Module SystemHasan Ünal
 
Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemTim Ellison
 
Java SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionJava SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionStephen Colebourne
 
Calling all modularity solutions
Calling all modularity solutionsCalling all modularity solutions
Calling all modularity solutionsSangjin Lee
 
Java 9 / Jigsaw - AJUG/VJUG session
Java 9 / Jigsaw - AJUG/VJUG  sessionJava 9 / Jigsaw - AJUG/VJUG  session
Java 9 / Jigsaw - AJUG/VJUG sessionMani Sarkar
 
Calling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBayCalling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBayTony Ng
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Mihail Stoynov
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programmingVandana Salve
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using MavenScheidt & Bachmann
 

Similar to As7 jbug j_boss_modules_yang yong (20)

Jax london 2011
Jax london 2011Jax london 2011
Jax london 2011
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJava Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
JavaScript Module Loaders
JavaScript Module LoadersJavaScript Module Loaders
JavaScript Module Loaders
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
 
Java Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module System
 
Java SE 9 modules - an introduction (July 2018)
Java SE 9 modules - an introduction (July 2018)Java SE 9 modules - an introduction (July 2018)
Java SE 9 modules - an introduction (July 2018)
 
Java 9 Module System
Java 9 Module SystemJava 9 Module System
Java 9 Module System
 
Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module System
 
Java8 - Under the hood
Java8 - Under the hoodJava8 - Under the hood
Java8 - Under the hood
 
Java9
Java9Java9
Java9
 
Java SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionJava SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introduction
 
Calling all modularity solutions
Calling all modularity solutionsCalling all modularity solutions
Calling all modularity solutions
 
Java 9 / Jigsaw - AJUG/VJUG session
Java 9 / Jigsaw - AJUG/VJUG  sessionJava 9 / Jigsaw - AJUG/VJUG  session
Java 9 / Jigsaw - AJUG/VJUG session
 
Calling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBayCalling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBay
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programming
 
Require.JS
Require.JSRequire.JS
Require.JS
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using Maven
 

Recently uploaded

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 

As7 jbug j_boss_modules_yang yong

  • 1. 杨泳 JBoss senior software engineer yyang@redhat.com
  • 2. Agenda ● What’s JBoss-Modules? ● What’s Module? ● How JBoss-Modules do? ● Demo
  • 3. What’s JBoss-Modules ● AS 7 bottom infrastructure ● Load all AS7 libs, frameworks, containers, services by module ● A simple APP loader, not a framework or container – Implements a thread-safe,fast,and highly concurrent module class loader model – Do one thing best – No any dependecy ● standalone.sh – java –jar jboss-modules.jar -modulepath modules org.jboss.as.standalone
  • 4. What’s module? ● Module is a collection of functions to implement the requirements of a specific domain, and can interact with others by public interfaces. ● Almost all products are made by module in various kind of industry – Computer, Car ● We also talk about modules in software industry – user module, security module – Care more module concept for Design & Development time, but in runtime: ● No isolation between JARs ● No protection from overlapping classes and packages ● No support of multiple versions ● No manageable dependencies(export/import) ● JAR HELL !!! – How to ensure modules run as design? ● Need a module runtime environment!
  • 5. What’s runtime module? ● Different module needs separated classloader – Isolated module classloader without JAR HELL – Export only APIs which need to be exported – Import only APIs which other module exports ● JBoss-modules focus on runtime only – No API or rule for Design&Dev time, not a library for development, not a framework, not a container – Modules run in a separated environment expected in the Design&Development time – Module can be developed by any other team/organization/ company
  • 6. How JBoss-modules do? ● Implements a thread-safe,fast,and highly concurrent module class loader model – ClassLoader is the mechanism to separate application to modules in runtime ● Manage module dependencies ● Manage Imports and Exports – Filter supported
  • 7. Module ClassLoader ● Every module has its classloader – Load local classes and resources – Delegate to other module classloader to load the dependencies
  • 8. Module Structure ● Jar ● module.xml – name,version – resources – Dependencies – Main class
  • 9. Module name & version ● Module names are dot separated,a bit like package names or Maven group Ids.Examples: – org.jboss.shrinkwrap.api – org.apache.xalan – org.dom4j ● However there is no actual relationship between a module’s name and the names of the packages which comprise it ● ● JBoss Modules does not support version resolution ● Version slot allows two modules with the same name to coexist The version slot defaults to “main” ● Fullname of a module – org.jboss.shrinkwrap.api:main – org.apache.xalan:main – org.dom4j:main
  • 10. Module Deployment structure ● Use modules as module repo ● Name&version slot as module directory ● put resources and module.xml in the module directory
  • 11. API ● Custom your module loader extend org.jboss.modules.ModuleLoader ● Load module on-flying and get their classloaders – // Get my module loader – ModuleLoader loader = ModuleLoader.forClass(getClass()); – // Load the module – Module module = loader.loadModule(“com.widgets”); – // Get its class loader – ClassLoader classLoader = module.getClassLoader(); – // Load a class from it – Class<?> c = Class.forName(“com.widgets.Widget”, true, classLoader);
  • 12. Execute a module ● Execute a module from the repository – which should have a main class specified in its module.xml descriptor ● Java –jar jboss-modules.jar -modulepath modules org.foo.mymodule
  • 13. JBoss-modules in AS7 ● More than 200 modules ● Super fast bootstrap – Multi-threading loading – Lazy loading ● Easily to develop your module to enhance AS7 ● Of course you can use jboss-modules as your application’s infrastructure
  • 14. VS OSGi&JSR 277/294 ● OSGi – Bootstrap wrapper VS Container – lightweight VS heavy ● Do one thing vs All in one ● Easy to start ● JSR 277/294 – Java Module System – Stopped – Jigsaw is a prototype module system intended for Java 8 – JBoss-modules will be compliant with Java Module System
  • 15. Future Directions ● Tooling – Make it easier to figure out needed and missing dependencies(perhaps a modified version of Tattletale) ● IDE integration – Make it easier to run (and debug) modular code from within an IDE
  • 16. Reference ● Get the sources at http://github.com/jbossas/jboss-modules ● File issues at https://issues.jboss.org/browse/MODULES ● Read documentation at http://docs.jboss.org/jbossmodule ● Discuss your ideas on irc.freenode.net:#jboss- modules ● Chinese docs: – http://jbosscn.iteye.com/ – http://www.bluedash.net/spaces/JBoss%20Module %E4%BB%8B%E7%BB%8D
  • 17. DEMO ● Two modules with one has dependencies to the other