The Common Component Architecture and XCAT.ppt
《The Common Component Architecture and XCAT.ppt》由会员分享,可在线阅读,更多相关《The Common Component Architecture and XCAT.ppt(41页珍藏版)》请在麦多课文档分享上搜索。
1、The Common Component Architecture and XCAT,Indiana University Extreme! Lab,What is a Component Architecture?,A systematic way of encapsulating special functionality and behaviors of a piece of software into reusable units. More than an object model. It defines the rules for the way objects can be in
2、stantiated and composed. It defines the environment of services that a component can use. It defines the way in which we discover how to interact with them.,Isnt this what a subroutine library does?,Subroutine libraries or class libraries have well defined interfaces encapsulate functionality But ar
3、e often hard to reuse because they often have complex resource requirements make conflicting assumptions about their operating environments. Subroutine libraries that follow very strict sets of design and use rules get reused. Above all else, a component architecture is framework of standard rules o
4、f behavior for objects.,Standard Component Archtectures,Examples: Microsoft COM/DCOM, COM+ the foundation of all Microsoft office products Java Beans Java standard for building user interfaces Enterprise Java Beans a standard for client-server applications in Java CORBA 3.0 The new component spec fo
5、r CORBA.,Look at One Design in Detail,The U.S. Dept of Energy DOE2000 project The Common Component Architecture Lawrence Livermore National Lab Sandia Labs Argonne National Labs Los Alamos National Labs Universities: Utah, NCSA, Indiana A specification for component design for parallel and distribut
6、ed applications,Two parts to the CCA Architecture,Components An encapsulated “object” defined by its public interfaces. Can be Java, C, Python, C+ or C+ and Fortran. Frameworks The software systems that provides basic services to components Used to compose components to make apps. Many implementatio
7、ns: Parallel and Distributed.,Some Concepts in Detail,Ports: the public interfaces of a component defines the different ways we can interact with a component and the ways the component uses services and other components.,Image Processing Component,setImage(Image I),Image getImage(),adjustColor(),set
8、Filter(Filter),calls doFFT(),Provides Ports - interfaces functions provided by component,Uses Ports - interface of a service used by component,How do you “compose” two components?,There are three basic approaches: Events: A component can generate an “event” of a particular type. Other components are
9、 added as “listeners” for such events from that component. Services: A source component “uses” services “provided” by a target components. “use” = calls a function provided by the target. Dataflow: A typed data “output” stream is connected to a similarly typed “input” port of another. In XCAT all th
10、ree are supported. The services model is the basic mechanism. Dataflow is emulated in CCA by “pushing” data from a user to a provider, or by having a user “pull” data from a provider. Events are managed by a separate mechanism.,Acme FFT component,Building Applications by Composition,Connect uses Por
11、ts to Provides Ports.,Image Processing Component,getImage(),adjustColor(),Image tool graphical interface component,Image database component,setImage(),doFFT(),Ports and Interfaces (CCA),Component composition: Connect (possibly at runtime) a “provides” port of one component to a “uses” port of anothe
12、r. A provides port is simply an implementation in the component of the interface defined by the port type (interface defn.). A Uses port is a “proxy” that a component “uses” to make a request of another component.,Source Component,Target Component,A Provides port,A uses port,How do you describe the
13、interfaces a port has?,Standard Methods: Use an Interface Definition Language - a formal description of the interface objects. CORBA IDL is one. The LLNL Scientific IDL by Scott Kohn, Andrew Cleary, Steven Smith, and Brent Smolinski is better for CCA. A simple IDL compiler can be used to automatical
14、ly generate the Uses and Provides Port code for a specific IDL type. For the XCAT java version the interface of a component port are defined as Java interfaces.,Component Communication,Use a simple Remote Procedure Call MechanismXSOAP Implementation of Simple Object Access Protocol (SOAP)Performance
15、 Issuesin-process callsEvents/MessagesObjects encoded as XML documentsProteusMultiprotocol Messaging and RMI,X,Creation Service,Creates a running instance of another component Encapsulates authentication issues,Creation Service Component,Launch an instance of component X on resource Y,Returns: remot
16、e reference to new component instance,Globus resource Y,Connection Service,A component that can be used to connect a “uses” port of one component to the “provides” port of another Can export ports of another component,Y,Connection Service Component,X,Connect port A of component X to port B of compon
17、ent Y,A,B,Builder Service,combination of Creation and Connection service standardized as part of recently updated CCA specification we are now in process of implementing it in XCAT,Simple Example in Java,public class SimpleEchoImpl implements SimpleEcho public String echoHello(String s) throws Remot
18、eException return “SimpleEchoImpl says: Hello “ + s; ,Simple Example in Java,public class EchoPrinterComponent implements Component public void setServices(Services cc)PortInfo portType = new PortInfoImpl(“simpleEchoProvidesPort“, “http:/ = new SimpleEchoImpl();cc.addProvidesPort(simpleEchoImpl,port
19、Type); ,Simple Example in Java,public class EchoGeneratorComponent implements Component public void setServices(Services cc)PortInfo portType = new PortInfoImpl(“simpleEchoUsesPort“, “http:/ ,Simple Example in Java,SimpleEcho usesSimpleEcho = (SimpleEcho) cc.getPort(“simpleEchoUsesPort“);usesSimpleE
20、cho.echoHello(“Extreme Lab“);cc.releasePort(“simpleEchoUsesPort“);,Echo Generator Component,Echo Printer Component,A Provides port simpleEchoProvidesPort,A uses port simpleEchoUsesPort,Scripting XCAT Applications,import xcat generator = xcat.createComponent(GeneratorComponet) printer = xcat.createCo
21、mponent(Printer)xcat.setCreationMechanism(generator, gram) xcat.setCreationMechanism(printer, ssh)xcat.createInstance(generator) xcat.createInstance(printer)xcat.connectPorts(generator, simpleEchoUsesPort,printer, simpleEchoProvidesPort),Scripting XCAT Applications,generatorComponent = EnvObj() gene
22、ratorComponent.put(“exec-name“, “simpleGeneratorComponent“) generatorComponent.put(“exec-fqn“, “samples.simpleEchoGenerator.SimpleEchoGeneratorComponent“)printerComponent = EnvObj() printerComponent.put(“exec-name“, “simplePrinterComponent“) printerComponent.put(“exec-fqn“, “samples.simpleEchoPrinte
23、r.SimpleEchoPrinterComponent“)# create component wrappers generator = cca.createComponent(generatorComponent) printer = cca.createComponent(printerComponent)# assign a machine name printermc = “exodus.extreme.indiana.edu“ generatormc = “exodus.extreme.indiana.edu“ cca.setMachineName(generator,genera
24、tormc) cca.setMachineName(printer, printermc),# create live instances cca.createInstanceWithTimeOut(printer, 120000) cca.createInstanceWithTimeOut(generator, 120000)# connect their ports cca.connectPorts(generator, “simpleEchoUsesPort“, printer, “simpleEchoProvidesPort“)# start the components invoke
25、 go() on GoPortusesGoPortClassName = “samples.idl.goPort.UsesGoPort“ usesPortType = “http:/ providesPortName = “providesGoPort“ methodName = “go“ methodParams = zeros(0, Object) cca.invokeMethodOnComponent(generator, usesGoPortClassName, usesPortType, providesPortName, methodName, methodParams)print
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- THECOMMONCOMPONENTARCHITECTUREANDXCATPPT
