1 / 28

Tuscany 架构与应用加载机制

Tuscany 架构与应用加载机制. 目录. 概述 Tuscany 内核加载 示例 Tuscany 应用加载. 概述. Extension Point Registry(EPR). Tuscany 以 E xtension 的方式扩展它的功能 Extension Point 是内核与 Extension 之间的桥梁. Extension Point Registry(EPR). 以 ContributionScanner 为例. FolderContributionScanner. JarContributionScanner.

corbin
Download Presentation

Tuscany 架构与应用加载机制

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tuscany架构与应用加载机制

  2. 目录 • 概述 • Tuscany内核加载 • 示例 • Tuscany应用加载

  3. 概述

  4. Extension Point Registry(EPR) • Tuscany以Extension的方式扩展它的功能 • Extension Point是内核与Extension之间的桥梁

  5. Extension Point Registry(EPR) • 以ContributionScanner为例 FolderContributionScanner JarContributionScanner ZipContributionScanner

  6. Extension Point Registry(EPR) • 实现ContributionScanner接口的类用于扫描特定的打包格式并构建一个artifacts列表 • 如JarContributionScanner则用于读取解析Jar contribution • 每个ContributionScanner接口实现均通过ContributionScannerExtensionPoint向Tuscany运行时注册

  7. Extension Point Registry(EPR) • 内核查找Extension Point Registry,获取Extension Point //创建EPR ExtensionPointRegistryregistry = new Default ExtensionPointRegistry (); //查找 ContributionScannerExtensionPointfactories = registry.getExtensionPoint(ContributionScannerExtensionPoint.class);

  8. 内核加载 • 内核加载流程

  9. Create Extension Point Registry • 实例化Extension Point Registry //实例化EPR ExtensionPointRegistryregistry = new Default ExtensionPointRegistry();

  10. Create Extension Point Registry • 创建必需的Extension Point • UtilityExtensionPoint • ModelFactoryExtensionPoint • ProxyFactoryExtensionPoint //查找UtilityExtensionPoint,若不存在则创建之 UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);

  11. Discover Module Activators • 读取“META-INF/services/”目录下与ModuleActivator相关的属性文件 • 部分内容

  12. Discover Module Activators • 上述类均实现了ModuleActivator接口

  13. Start Module Activators • 对上一阶段发现的各个Module Activator,分别调用start()方法,启动相关服务 • e.g., CorbaRuntimeModuleActivator • 向EPR注册CorbaHostExtensionPoint • 启动Corba服务器

  14. Create Contribution Service • 创建ContributionServiceImpl对象并注册EPR

  15. Create Scope Registry • 定义的几种Scope • Stateless • Request • Session • Conversation • Composite • System • Undefined

  16. Create Composite Builder • CompositeBuilder接口 • 此阶段实例化一些该接口的实现类

  17. Create Composite Builder • CompositeBuilder接口的实现类

  18. Create Composite Activator • 实例化CompositeActivatorImpl

  19. Load System SCA Definitions

  20. 示例 • 在线水果商店

  21. Load Contributions • 找到contributions的路径并加载它们

  22. Resolve Composite • 将composite文件(XML格式)中的元素解析出来 • <include> • <component> • <service>

  23. Build Composite • 执行相关的CompositeBuilder的build()方法

  24. Build Composite • 若binding的方式是WSDL,当对ComponentServiceBindingBuilderImpl执行其build()方法时,则生成WSDL文档

  25. Activate Composite • 对composite中定义的每一个构件,为其增加implementation provider、service binding provider、reference binding provider

  26. Activate Composite • HelloWorld示例中 • store构件的实现方式是widget,那么需要为其增加一个WidgetImplementationProvider • shoppingcart构件的实现方式是Java,则需要为其增加JavaImplementationProvider • store构件的binding是HTTP协议,需要为其增加一个HTTPBindingProvider

  27. Start Composite • 调用上一阶段的provider的start()方法 • 具体来看,完成.composite文件定义的binding,启动相关的implementation provider等

  28. Start Composite • HelloWorld示例中 • Store构件启动WidgetImplementationProvider • shoppingcart构件JavaImplementationProvider • store构件的HTTP binding • Catalog构件的Jsonrpc binding

More Related