A Quick CCM Example Tutorial on CCM Introduction
- Slides: 29
A Quick CCM Example
Tutorial on CCM Introduction A Simple Sender&Receiver Scenario • Sender sends out the click-out event to inform the Receiver. • Receiver reads the message from Sender. • $CIAO_ROOT/examples/Hello/ste p-by-step. html • Multiple instances of the Receiver could be deployed.
Tutorial on CCM Steps To Develop A CIAO Based Application 1. Define your IDL types. 2. Define your Component types. 3. Implement your components. 4. Assemble your components. 5. Deploy and run your application.
A Quick CCM Example Define IDL/Component Types
Tutorial on CCM Common IDL module Hello { interface message { string get_message(); }; eventtype timeout { }; }; • Common IDL definition. • Used by both Sender and Receiver. • $CIAO_ROO/examples/Hello_Base/Hello_Base. idl • This file could be skipped if not necessary.
Tutorial on CCM Component Definition (IDL) – Receiver 1/3 • Define the event receptacle. //Receiver. idl component Receiver { uses message read_message; consumes timeout click_in; }; home Receiver. Home manages Receiver{};
Tutorial on CCM Component Definition (IDL) – Receiver 2/3 • Define the interface receptacle. //Receiver. idl component Receiver { uses message read_message; consumes timeout click_in; }; home Receiver. Home manages Receiver{};
Tutorial on CCM Component Definition (IDL) – Receiver 3/3 //Receiver. idl component Receiver { uses message read_message; consumes timeout click_in; }; home Receiver. Home manages Receiver{}; • Define the component home
Tutorial on CCM Component Definition (IDL) – Sender 1/5 • Define the event source. //Sender. idl interface trigger { void start (); }; component Sender supports trigger { provides message push_message; publishes timeout click_out; attribute string local_message; }; home Sender. Home manages Sender {};
Tutorial on CCM Component Definition (IDL) – Sender 2/5 • Define the interfacet. //Sender. idl interface trigger { void start (); }; component Sender supports trigger { provides message push_message; publishes timeout click_out; attribute string local_message; }; home Sender. Home manages Sender {}; • The interfacet is plugged into the component in the way of composition.
Tutorial on CCM Component Definition (IDL) – Sender 3/5 • Define the attribute. //Sender. idl interface trigger { void start (); }; component Sender supports trigger { provides message push_message; publishes timeout click_out; attribute string local_message; }; home Sender. Home manages Sender {};
Tutorial on CCM Component Definition (IDL) – Sender 4/5 • Sender specific interface. //Sender. idl interface trigger { void start (); }; component Sender supports trigger { provides message push_message; publishes timeout click_out; attribute string local_message; }; home Sender. Home manages Sender {}; • Supported interface which is part of the component (inheritance).
Tutorial on CCM Component Definition (IDL) – Sender 5/5 • Define the component home. //Sender. idl interface trigger { void start (); }; component Sender supports trigger { provides message push_message; publishes timeout click_out; attribute string local_message; }; home Sender. Home manages Sender {};
A Quick CCM Example Component Implementations
Tutorial on CCM What does CIDL do? 1/2 CIDL is part of CCM strategy for managing complex applications • Helps separation of concerns • Helps coordination of tools • Increases the ratio of generated to hand-written code us es • Server code is now generated, startup automated by other CCM tools
Tutorial on CCM What does CIDL do? 2/2 • A CIDL file is Passed to CIDL compiler • Triggers code generation for – Component Home (Sender. Home) – managed component (Senderer) • CIDL compiler generates – Sender. Home servant – Senderer servant • attribute operations • port operations • supported interface operations • container callback operations • navigation operation overrides – IDL executor mapping – XML descriptor with meta-data
Tutorial on CCM Sender. cidl // Sender. cidl composition session Sender_Impl { home executor Sender. Home_Exec { implements Sender. Home; manages Sender_Exec; } }; Sender. Home servant Sender. Home_Exec Manages Sender servant Sender_Exec • An executor is where a component/home is implemented – The component/home’s servant will forward a client’s business logic request on the component to its corresponding executor • User should write the implementations (specified in the exacutor mapping IDL file) of: – Sender. Home_Exec – Sender_Exec Which are (In the example): – class Sender. Home_exec_i – class Sender_exec_i
Tutorial on CCM Executor Mapping 1/2 CIDL compiler generates the Executor Mapping • An IDL file consists of local interface definitions. • IDL compiler will generate the stubs for these local interfaces. Home servant s e us Home_Exec Defines Manages Component servant Component_Exec
Tutorial on CCM Executor Mapping 2/2 //Sender. cidl –snipped-composition session Sender_Impl { home executor Sender. Home_Exec { implements Hello: : Sender. Home; manages Sender_Exec; }; }; User writes //Sender_exec. h --snipped— namespace Sender_Impl { class Sender_Exec_i: public virtual Sender_Exec … class Sender. Home_Exec_i: public virtual Sender. Home_Exec … }; CIDL Compiler //Sender. E. idl --snipped— Module Sender_Impl { local interface Sender_Exec: … Local interface Sender. Home_Exec: … }; IDL Auto. Compiler generate d //Sender. EC. h --snipped— namespace Sender_Impl { class Sender_Exec: … Inheritanc class Sender. Home_Exec: … e };
A Quick CCM Example Implementation in Detail
Tutorial on CCM Implementation in Detail - Overview Handles all connections/subscriptions • Component Specific context • Interface connection – Facet – Receptacle • Event connection – Event source – Event receptacle • Attribute • Component Entry point
Tutorial on CCM Initializing Component-specific Context • Component-specific context manages connections & subscriptions • Container passes component its context via either – set_session_context() – set_entity_context() //Sender. E. idl –snipped-local interface Sender_Exec : Hello: : CCM_Sender, Components: : Session. Component { }; class Sender_exec_i : public virtual Sender_Exec, public virtual CORBA: : Local. Object { protected: Sender_Exec_Context_var context_; public: … void set_session_context (Components: : Session. Context_ptr c) { this->context_ = Sender_Exec_Context: : narrow (c); } … };
Tutorial on CCM Implement the Provided Interface Facet 1/2 //Hello_Base. idl –snipped-Module Hello { interface message { …}; … } //Sender. idl –snipped-component Sender supports trigger { provides message push_message; …}; //Sender. E. idl --snipped— Module Hello { local interface CCM_message: message … local interface CCM_Sender : … { Hello: : CCM_message get_push_message(); } }; //Sender_exec. h --snipped— namespace Sender_Impl { class Sender_Exec_i: public virtual Sender_Exec … { public : … get_push_message () {return (new Message_Impl(…)); } }; class Message_Impl : public virtual CCM_message … { //All operations in interface //message }; }; We use Message_Impl to implement interface message. In this example, we intend to plug the facet into the component. In C++ terminology, we use composition but not inheritance.
Tutorial on CCM Implement the Provided Interface Facet 2/2 //Hello_Base. idl –snipped-Module Hello { interface message { …}; … } //Sender. idl –snipped-component Sender supports trigger { provides message push_message; push_message …}; //Sender. E. idl --snipped— Module Hello { local interface CCM_message: message … local interface CCM_Sender : … { Hello: : CCM_message get_push_message(); push_message } }; //Sender_exec. h --snipped— namespace Sender_Impl { class Sender_Exec_i: public virtual Sender_Exec … { public : … get_push_message () {return (new Message_Impl(…)); } }; class Message_Impl : public virtual CCM_message … { //All operations in interface //message }; }; We plug the interfacet into the component and implement the get_<facet-name> method, which will be called by D&C tools or client to get the object reference of the interface servant implementation. User is responsible for managing the lifecycle of the facet object.
Tutorial on CCM Invocation on Interface Receptacle //Hello_Base. idl –snipped-Module Hello { interface message { String get_message (); }; … }; //Receiver. idl –snipped-component Receiver { uses message read_message; _message … }; //Receiver_exec. h/cpp --snipped— namespace Receiver_Impl { class Receiver_Exec_i: public virtual Receiver_Exec … { public : Get the void push_click_in () Obj-Ref { Hello: : message_var rev = this->context_>get_connection_read_message() read_message ; CORBA: : String_var str = rev Operation ->get_message(); invocation } }; }; • Component specific context manages the receptacle connections. • Component executor implementation acquires the connected reference by calling: • get_connection_<receptacle-name>. Then you can invoke opertaions supported by the interface on the OBJ reference.
Tutorial on CCM Send out an Event //Hello_Base. idl –snipped-Module Hello { eventtype timeout { …}; … } //Sender. idl –snipped-Component Sender. idl { publishes timeout click_out; click_out … }; //Sender. E. idl --snipped— module Hello { local interface CCM_Sender_Contex : …{ void push_click_out(); click_out } }; module Sender_Impl { typedef Hello: : CCM_Sender_Contex Sender_Exec_Contex; }; //Sender_exec. h/cpp --snipped— namespace Sender_Impl { class Sender_Exec_i: public virtual Sender_Exec … { public : void start () { this->context_-> push_click_out(); click_out } }; }; • Component specific context manages the event source. • push_<eventsource-name> sends out a event.
Tutorial on CCM Upon Receiving an Event //Hello_Base. idl –snipped-Module Hello { eventtype timeout {}; … }; //Receiver. idl –snipped-component Receiver { consuems timeout click_in; _in … }; //Receiver. E. idl --snipped— module Hello { local interface CCM_Receiver : …{ void push_click_in(); click_in } }; module Sender_Impl { Hello: : CCM_Receiver_Exec : CCM_Receiver {}; }; //Receiver_exec. h --snipped— namespace Receiver_Impl { class Receiver_Exec_i: public virtual Receiver_Exec … { public : void push_click_in (); }; }; • CIDL generates event consumer servants • Executor mapping defines push operations directly • push_<eventsink-name> will be called upon receiving an event.
Tutorial on CCM Attribute Implementation //Sender. idl –snipped-component Sender { attribute string local_message; local_message … }; //Sender. E. idl --snipped— module Hello { local interface CCM_Sender : …{ attribute string local_message; } }; module Sender_Impl { Hello: : CCM_Receiver_Exec : CCM_Receiver {}; }; //Sender_exec. h --snipped— namespace Sender_Impl { class Sender_Exec_i: public virtual Sender_Exec … { public : void local_message (const char* ); char * local_message (); }; }; • Intended for component configuration • User need to implement the Accessor and Mutator methods.
Tutorial on CCM Component Entry Point extern "C" { Components: : Home. Executor. Base_ptr creat. Sender. Home_Impl (void) { return new Sender_Impl: : Sender. Home_exec_i(); } } Server. Activator «instantiates» Component. Server «instantiates» • The signature is defined by the CCM spec • Container calls this method to create a home executor • extern “C” required to prevent C++ name mangling, so function name can be resolved in DLL • XML tag reserved for entry point name Assembly Container «instantiates» CCMHome. . . create. Sender. Home_Impl ()
- Quick find algorithm
- Quickchek menu
- Enterprise ccm
- Ccm certification construction
- Chromatographie sur couche mince photo
- Ccm evolution
- Ccm examples
- Ccm crm
- Corba component model
- Continuous control monitoring definition
- Bhutan ccm
- Ccm eligibility requirements
- Quick bread examples
- Quick sort algorithm with example
- Quick question example
- What is qtp
- Vdoe quick checks
- Quick ratio formula
- Quick order traveler
- Caroline bowen quick screener
- Liikevoittoprosentti kaava
- How to do quick sort
- How to solve square root equations
- Acid test ratio and quick ratio
- Quick acid ratio
- Track tix
- Loop invariant of quick sort
- Is quick sort in place
- Quick software solutions
- Quickserve cummins