1 / 26

SCA C++, C and COBOL

www.oasis-open.org. SCA C++, C and COBOL. Bryan Aupperle David Haney 18 Sept. 2007. OASIS Status. C and C++ specifications transitioning from OSOA to OASIS Governed by the SCA-C-C++ TC Policy related annotations Cross standard consistency Compliance test suites

sancho
Télécharger la présentation

SCA C++, C and COBOL

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. www.oasis-open.org SCA C++, C and COBOL Bryan Aupperle David Haney 18 Sept. 2007

  2. OASIS Status • C and C++ specifications transitioning from OSOA to OASIS • Governed by the SCA-C-C++ TC • Policy related annotations • Cross standard consistency • Compliance test suites • COBOL specification continuing development under OSOA • SCA-C-C++ TC work will influence

  3. SCDL for C++ • interface.cpp • header – C++ header file describing the interface • class – (optional) Class defining the interface • callbackHeader – (optional) C++ header describing the callback interface • callbackClass – (optional) Class defining the callback interface • remotable – (optional) • implementation.cpp • library – Shared library defining the service factory • path – (optional) Path to search for the library • header – C++ header file describing the implementation • class – (optional) Class defining the implementation • scope – (optional)

  4. C++ APIs • ComponentContext • Primary interface for accessing SCA defined components. • Component Meta Information • getCurrent(), getURI(), getProperties(), getDataFactory() • Service Lookup • getService(), getServices() • Service References • getServiceReference(), getServiceReferences() • getSelfReference()

  5. C++ APIs (cont) • ServiceReference • Interface for interacting with service instances • Conversational interface • getConversationID(), setConversationID() • Asynchronous interface • getCallbackID(), setCallbackID() • getCallback(), setCallback()

  6. C++ WSDL Mapping • Defines a translation from a C++ class interface to a WSDL • Uses comment annotations to control the conversion • Defines mapping rules for: • primitive types • C++ Standard Library types • SDO • classes, structs, arrays, enums • Defers to the OMG WSDL to C++ Mapping for generating C++ headers from a WSDL.

  7. SCDL for C • Interface defined by a set of functions • interface.c • header – header file describing the interface • callbackHeader – (optional) header file describing the callback interface • remotable – (optional) • implementation.c • module – binary executable for the component implementation • library – (optional) indicates whether the service is implemented as a library or a program • location – (optional) location of the module • scope – (optional)

  8. C APIs • Synchronous Programming • SCALocate(), SCALocateMultiple() – get handle(s) to services • SCAInvoke() – invokes an operation of a service • SCAProperty<PropertyType>() – get the value of a property • SCAGetFaultMessage(), SCASetFaultMessage() – get or set a fault message for a service operation • Asynchronous Programming • SCAGetCallback() – get handle of callback instance • SCACallback() – invoke a callback operation • SCASetCallback() – set a callback function for a reference • SCASetCallbackID(), SCAGetCallbackID() – get or set the callback ID for a service instance • Conversation Services • SCAGetConversationID(), SCASetConversationID() – get or set a user provided conversation ID • SCAEndConversation() – end a conversation

  9. Implementation as Program • Support environments where function is provided by programs • API • SCAService() – get name of invoked service • SCAOperation() – get name of invoked operation • SCAMessageIn() – get input message SCAMessageOut() – set output message

  10. SCDL for COBOL • interface.cobol • copybook – copybook file describing the interface • callbackCopybook – (optional) copybook file that describing the callback interface • location – (optional) location of library containing the copybook files • remotable – (optional) • implementation.cobol • program –binary executable for the component implementation • location – (optional) location of library containing the binary executable • scope – (optional)

  11. COBOL APIs • Same functions as in C • Synchronous Programming • SCAProperty is not typed • Program-Based Implemenation Support • Asynchronous Programming • Conversation Services

  12. C & COBOL WSDL Mapping • Defines a translation between language structures and WSDL • Defines type mapping rules for: • Primitive types • Structs or Groups • SDO • Variable length strings and unbounded arrays • Defines mapping rules between operations and functions

  13. Annotations • Contained in comments, processed by tools • Interface • Invocation attribute • OneWay • Remotable • Callback • EndConversation • Implementation • Scope • Lifecycle • Conversation information • Property • Reference

  14. Open Implementations • Apache Tuscany Native • http://incubator.apache.org/tuscany/sca-native.html • Implements pre-1.0 C++ specification • Working towards 1.0 compliance

  15. OASIS References • SCA-C-C++ TC • http://www.oasis-open.org/apps/org/workgroup/sca-c-cpp/description.php • SCA-C-C++ Charter • http://www.oasis-open.org/committees/sca-c-cpp/charter.php

  16. OSOA References • OSOA SCA Specifications • http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications • Final Specifications • SCA C++ Client and Implementation • Draft Specifications • SCA C Client and Implementation • SCA COBOL Client and Implementation

  17. Other References • OMG WSDL to C++ Specification • http://www.omg.org/docs/ptc/06-08-01.pdf

  18. Backup

  19. C++ APIs (cont) • Supplemental APIs • RefCountingPointer • Defines a reference-counted pointer interface • SCAException • Provides a hierarchy of exception classes for use with the SCA API. • SCANullPointerException • ServiceRuntimeException • ServiceUnavailableException • NoRegisteredCallbackException • ConversationEndedException • MultipleServicesException

  20. C++ Annotations • Contained in comments, processed by tools • Interface Header File • @Remotable • @Callback • @OneWay • @EndConversation • Implementation Header File • @Scope • @EagerInit • @AllowsPassByReference • @Conversation • @Property • @Reference

  21. C Annotations • Contained in comments, processed by tools • Header File • @Operation, @Callback • @Remotable, @OneWay • @EndConversation • Implementation File • @Service • @Reference • @Property • @Scope • @Init, @Destroy, @EagerInit • @AllowPassByReference • @Conversation

  22. COBOL Annotations • Contained in comments, processed by tools • Interface File • @Operation, @Callback • @Remotable, @OneWay • @EndConversation • Implementation File • @Service • @Reference • @Property • @Scope • @Init, @Destroy, @EagerInit • @AllowPassByReference • @Conversation

  23. C++ Example • Interface SCDL <service name=“LoanService”> <interface.cpp header=“LoanService.h”/> </service> • Implementation SCDL <component name=“LoanServiceImpl”> <implementation.cpp library=“loan” header=“LoanServiceImpl.h”/> </component>

  24. C++ Example (cont) • LoanService Interface class LoanService { public: virtual bool approveLoan( unsigned long customerNumber, unsigned long loanAmount) = 0; };

  25. C++ Example (cont) • LoanServiceImpl Interface class LoanServiceImpl :public LoanService { public: virtual bool approveLoan( unsigned long customerNumber, unsigned long loanAmount) { // … } };

  26. C++ Example (cont) • SCA Application int main(void) { ComponentContextPtr context = ComponentContext::getCurrent(); LoanService* service = (LoanService*) context->getService(“loanService”); bool result = service->approveLoan(12345, 100); }

More Related