SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
Java9 Modules
Tom Schindl <tom.schindl@bestsolution.at>
Twitter: @tomsontom
Blog: http://tomsondev.bestsolution.at
Website: http://www.bestsolution.at
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
About Tom
‣ CTO BestSolution.at Systemhaus GmbH
‣ Eclipse Committer
‣ e4
‣ Platform
‣ EMF
‣ Project lead
‣ e(fx)clipse
‣ Twitter: @tomsontom
‣ Blog: tomsondev.bestsolution.at
‣ Corporate: http://bestsolution.at
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Targets of Java9 Modulesystem
‣ Split up rt.jar in smaller junks
‣ Avoids further introduction of cross-references
‣ Allows smaller Java-Runtimes (eg for IoT-Devices, …)
‣ Restrict Access to internal APIs (eg com.sun.misc.Unsafe)
‣ Allow developers to adopt it for their code as well
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ The Implementation
‣ OSGi Module System is built upon classloaders
‣ Java9 Module System is implemented at the VM Level
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ The Implementation
‣ OSGi Module System is built upon classloaders
‣ Java9 Module System is implemented at the VM Level
OSGi
foo-1.0.0
(BundleLoaderClassLoader@f1)
bar-1.0.0
(BundleLoaderClassLoader@b1)
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ The Implementation
‣ OSGi Module System is built upon classloaders
‣ Java9 Module System is implemented at the VM Level
OSGi
foo-1.0.0
(BundleLoaderClassLoader@f1)
bar-1.0.0
(BundleLoaderClassLoader@b1)
Java9
foo-1.0.0
(AppClassloader@A1)
bar-1.0.0
(AppClassloader@A1)
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Dependency definition
‣ OSGi uses custom MANIFEST.MF entries Require-Bundle and
Import-Package
‣ Java9 uses module-info.java and directive requires
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Dependency definition
‣ OSGi uses custom MANIFEST.MF entries Require-Bundle and
Import-Package
‣ Java9 uses module-info.java and directive requires
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: bar
Require-Bundle: foo
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: bar
Import-Package: foo
OSGi
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Dependency definition
‣ OSGi uses custom MANIFEST.MF entries Require-Bundle and
Import-Package
‣ Java9 uses module-info.java and directive requires
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: bar
Require-Bundle: foo
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: bar
Import-Package: foo
OSGi
module bar {
requires foo;
}
Java9
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Access Restrictions
‣ OSGi uses custom MANIFEST.MF entry Export-Package
‣ Java9 use module-info.java and directive exports
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Access Restrictions
‣ OSGi uses custom MANIFEST.MF entry Export-Package
‣ Java9 use module-info.java and directive exports
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: foo
Export-Package: foo
OSGi
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Access Restrictions
‣ OSGi uses custom MANIFEST.MF entry Export-Package
‣ Java9 use module-info.java and directive exports
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: foo
Export-Package: foo
OSGi
module foo {
exports foo;
}
Java9
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Services
‣ OSGi has eg Declarative Service Components and the
BundleContext to lookup
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Services
‣ OSGi has eg Declarative Service Components and the
BundleContext to lookup
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: bar
Require-Bundle: foo
Service-Component: OSGI-INF/mycomponent.xml
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
<implementation class="bar.BarService"/>
<service>
<provide interface="foo.Service"/>
</service>
</scr:component>
Provider
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Services
‣ OSGi has eg Declarative Service Components and the
BundleContext to lookup
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: bar
Require-Bundle: foo
Service-Component: OSGI-INF/mycomponent.xml
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
<implementation class="bar.BarService"/>
<service>
<provide interface="foo.Service"/>
</service>
</scr:component>
Provider
BundleContext ctx = getContext(cl);
ServiceReference<Service> ref = 

ctx.getServiceReference(Service.class);
Service s = ctx.getService(ref);
Consumer
(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Java9 Modules vs OSGi
‣ Service
‣ Java9 uses module-info.java and ServiceLoader for the
lookup
module bar {
requires foo;
provides foo.Service with bar.BarService;
}
Provider
module foo {
requires foo;
uses foo.Service;
}
Consumer
ServiceLoader<GreetService> l =
ServiceLoader.load(Service.class);
Service s = l.iterator().next();

Más contenido relacionado

Similar a Democamp - Munich - Java9

E(fx)clipse eclipse con
E(fx)clipse   eclipse conE(fx)clipse   eclipse con
E(fx)clipse eclipse conTom Schindl
 
ColdFusion .NET integration - Adobe Max 2006
ColdFusion .NET integration - Adobe Max 2006ColdFusion .NET integration - Adobe Max 2006
ColdFusion .NET integration - Adobe Max 2006Rupesh Kumar
 
Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Rhinofly
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with ComposerJason Grimes
 
Cocoon Blocks ApacheCon US 2005
Cocoon Blocks ApacheCon US 2005Cocoon Blocks ApacheCon US 2005
Cocoon Blocks ApacheCon US 2005Daniel Fagerstrom
 
Java fx smart code econ
Java fx smart code econJava fx smart code econ
Java fx smart code econTom Schindl
 
Introduction to OSGGi
Introduction to OSGGiIntroduction to OSGGi
Introduction to OSGGiMarek Koniew
 
OSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyOSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyRaymond Feng
 
Window Shopping Browser - Bug Hunting in 2012
Window Shopping Browser - Bug Hunting in 2012Window Shopping Browser - Bug Hunting in 2012
Window Shopping Browser - Bug Hunting in 2012Roberto Suggi Liverani
 
Cross Context Scripting attacks & exploitation
Cross Context Scripting attacks & exploitationCross Context Scripting attacks & exploitation
Cross Context Scripting attacks & exploitationRoberto Suggi Liverani
 
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...Anna Shymchenko
 
Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi WebinarWSO2
 
Best Practices for Enterprise OSGi Applications - Emily Jiang
Best Practices for Enterprise OSGi Applications - Emily JiangBest Practices for Enterprise OSGi Applications - Emily Jiang
Best Practices for Enterprise OSGi Applications - Emily Jiangmfrancis
 
KSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptxKSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptxNashet Ali
 
Asp net mvc
Asp net mvcAsp net mvc
Asp net mvcbgrynko
 
Know thy code
Know thy codeKnow thy code
Know thy codeRavi Vyas
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesRobert Lemke
 
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghAcceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghEngineor
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with ComposerAdam Englander
 

Similar a Democamp - Munich - Java9 (20)

E(fx)clipse eclipse con
E(fx)clipse   eclipse conE(fx)clipse   eclipse con
E(fx)clipse eclipse con
 
ColdFusion .NET integration - Adobe Max 2006
ColdFusion .NET integration - Adobe Max 2006ColdFusion .NET integration - Adobe Max 2006
ColdFusion .NET integration - Adobe Max 2006
 
Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
Cocoon Blocks ApacheCon US 2005
Cocoon Blocks ApacheCon US 2005Cocoon Blocks ApacheCon US 2005
Cocoon Blocks ApacheCon US 2005
 
Java fx smart code econ
Java fx smart code econJava fx smart code econ
Java fx smart code econ
 
Introduction to OSGGi
Introduction to OSGGiIntroduction to OSGGi
Introduction to OSGGi
 
OSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyOSGi Enablement For Apache Tuscany
OSGi Enablement For Apache Tuscany
 
Window Shopping Browser - Bug Hunting in 2012
Window Shopping Browser - Bug Hunting in 2012Window Shopping Browser - Bug Hunting in 2012
Window Shopping Browser - Bug Hunting in 2012
 
Cross Context Scripting attacks & exploitation
Cross Context Scripting attacks & exploitationCross Context Scripting attacks & exploitation
Cross Context Scripting attacks & exploitation
 
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
 
Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi Webinar
 
Best Practices for Enterprise OSGi Applications - Emily Jiang
Best Practices for Enterprise OSGi Applications - Emily JiangBest Practices for Enterprise OSGi Applications - Emily Jiang
Best Practices for Enterprise OSGi Applications - Emily Jiang
 
KSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptxKSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptx
 
Asp net mvc
Asp net mvcAsp net mvc
Asp net mvc
 
Know thy code
Know thy codeKnow thy code
Know thy code
 
CodeShip
CodeShipCodeShip
CodeShip
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghAcceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup Edinburgh
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 

Último

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 

Último (20)

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 

Democamp - Munich - Java9

  • 1. Java9 Modules Tom Schindl <tom.schindl@bestsolution.at> Twitter: @tomsontom Blog: http://tomsondev.bestsolution.at Website: http://www.bestsolution.at
  • 2. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 About Tom ‣ CTO BestSolution.at Systemhaus GmbH ‣ Eclipse Committer ‣ e4 ‣ Platform ‣ EMF ‣ Project lead ‣ e(fx)clipse ‣ Twitter: @tomsontom ‣ Blog: tomsondev.bestsolution.at ‣ Corporate: http://bestsolution.at
  • 3. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Targets of Java9 Modulesystem ‣ Split up rt.jar in smaller junks ‣ Avoids further introduction of cross-references ‣ Allows smaller Java-Runtimes (eg for IoT-Devices, …) ‣ Restrict Access to internal APIs (eg com.sun.misc.Unsafe) ‣ Allow developers to adopt it for their code as well
  • 4. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ The Implementation ‣ OSGi Module System is built upon classloaders ‣ Java9 Module System is implemented at the VM Level
  • 5. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ The Implementation ‣ OSGi Module System is built upon classloaders ‣ Java9 Module System is implemented at the VM Level OSGi foo-1.0.0 (BundleLoaderClassLoader@f1) bar-1.0.0 (BundleLoaderClassLoader@b1)
  • 6. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ The Implementation ‣ OSGi Module System is built upon classloaders ‣ Java9 Module System is implemented at the VM Level OSGi foo-1.0.0 (BundleLoaderClassLoader@f1) bar-1.0.0 (BundleLoaderClassLoader@b1) Java9 foo-1.0.0 (AppClassloader@A1) bar-1.0.0 (AppClassloader@A1)
  • 7. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Dependency definition ‣ OSGi uses custom MANIFEST.MF entries Require-Bundle and Import-Package ‣ Java9 uses module-info.java and directive requires
  • 8. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Dependency definition ‣ OSGi uses custom MANIFEST.MF entries Require-Bundle and Import-Package ‣ Java9 uses module-info.java and directive requires Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: bar Require-Bundle: foo Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: bar Import-Package: foo OSGi
  • 9. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Dependency definition ‣ OSGi uses custom MANIFEST.MF entries Require-Bundle and Import-Package ‣ Java9 uses module-info.java and directive requires Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: bar Require-Bundle: foo Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: bar Import-Package: foo OSGi module bar { requires foo; } Java9
  • 10. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Access Restrictions ‣ OSGi uses custom MANIFEST.MF entry Export-Package ‣ Java9 use module-info.java and directive exports
  • 11. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Access Restrictions ‣ OSGi uses custom MANIFEST.MF entry Export-Package ‣ Java9 use module-info.java and directive exports Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: foo Export-Package: foo OSGi
  • 12. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Access Restrictions ‣ OSGi uses custom MANIFEST.MF entry Export-Package ‣ Java9 use module-info.java and directive exports Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: foo Export-Package: foo OSGi module foo { exports foo; } Java9
  • 13. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Services ‣ OSGi has eg Declarative Service Components and the BundleContext to lookup
  • 14. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Services ‣ OSGi has eg Declarative Service Components and the BundleContext to lookup Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: bar Require-Bundle: foo Service-Component: OSGI-INF/mycomponent.xml <?xml version="1.0" encoding="UTF-8"?> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"> <implementation class="bar.BarService"/> <service> <provide interface="foo.Service"/> </service> </scr:component> Provider
  • 15. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Services ‣ OSGi has eg Declarative Service Components and the BundleContext to lookup Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: bar Require-Bundle: foo Service-Component: OSGI-INF/mycomponent.xml <?xml version="1.0" encoding="UTF-8"?> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"> <implementation class="bar.BarService"/> <service> <provide interface="foo.Service"/> </service> </scr:component> Provider BundleContext ctx = getContext(cl); ServiceReference<Service> ref = 
 ctx.getServiceReference(Service.class); Service s = ctx.getService(ref); Consumer
  • 16. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0 Java9 Modules vs OSGi ‣ Service ‣ Java9 uses module-info.java and ServiceLoader for the lookup module bar { requires foo; provides foo.Service with bar.BarService; } Provider module foo { requires foo; uses foo.Service; } Consumer ServiceLoader<GreetService> l = ServiceLoader.load(Service.class); Service s = l.iterator().next();