Getting started with Open CCM Tutorial An Open

  • Slides: 68
Download presentation
Getting started with Open. CCM Tutorial An Open. CCM application : The demo 3

Getting started with Open. CCM Tutorial An Open. CCM application : The demo 3 “Client / Server-Producer / Consumer” Areski Flissi (IR CNRS / LIFL) flissi@lifl. fr Getting started with Open. CCM 1

Tutorial Objectives n An Open. CCM application n n How to design, build, implement,

Tutorial Objectives n An Open. CCM application n n How to design, build, implement, compile, deploy and execute an application according to the OMG CORBA Component Model with the Open. CCM platform Illustrated with a concrete example : demo 3 n n A simple Client / Server-Producer / Consumer application Build with Open. CCM 0. 4 and ORBacus 4. 1 and Java programming language Getting started with Open. CCM 2

Agenda 1. OMG IDL 3 : design the application by defining components and assembling

Agenda 1. OMG IDL 3 : design the application by defining components and assembling component instances 2. Open. CCM compilation and generation chain for the demo 3 example 3. Open. CCM execution chain for the demo 3 example 4. Package, assembly and deploy the CCM application with XML descriptors (edited using simple GUI) Getting started with Open. CCM 3

Building a CCM application with Open. CCM is very easy. . . Java implementation

Building a CCM application with Open. CCM is very easy. . . Java implementation patterns demo 3. idl 3 User written files Compiler Generated files IDL 3 ir 3_feed ir 3_jimpl User’s Java implementation file IR 3 demo 3. jar Compile and Build archive ir 3_idl 2 OMG IDL 2. x demo 3. idl jidl Java Corba 2 stubs Packaging, Assembling and Deployment done by XML descriptors ir 3_java Java Open. CCM Skeletons GUI Getting started with Open. CCM XML descriptors 4

Agenda 1. OMG IDL 3 : design the application by defining components and assembling

Agenda 1. OMG IDL 3 : design the application by defining components and assembling component instances 2. Open. CCM compilation and generation chain for the demo 3 example 3. Open. CCM execution chain for the demo 3 example 4. Package, assembly and deploy the CCM application with XML descriptors (edited using simple GUI) Getting started with Open. CCM 5

1. OMG IDL 3 : design the application by defining components and assembling component

1. OMG IDL 3 : design the application by defining components and assembling component instances n OMG IDL 3 : defining demo 3 module n n Interfaces Eventtypes Components and interconnections between components (facets, receptacles, event sources, event sinks) Component homes for instantiating and managing components Getting started with Open. CCM 6

The Client/Server-Producer/Consumer Example n n Client components synchronously invoke a Server component which asynchronously

The Client/Server-Producer/Consumer Example n n Client components synchronously invoke a Server component which asynchronously publishes Events to the set of connected Consumer components. Components are created by simple component homes or managers with primary keys Getting started with Open. CCM 7

Building the application : n Assembling CORBA Component instances Component Base ref. Facet Receptacle

Building the application : n Assembling CORBA Component instances Component Base ref. Facet Receptacle Event Sink Event Source Client Component Server Component Getting started with Open. CCM Consumer Component 8

OMG IDL 3. 0 for demo 3 example // Importation of the Components module

OMG IDL 3. 0 for demo 3 example // Importation of the Components module // when access to OMG IDL definitions contained // into the CCM's Components module is required. import Components; module demo 3 { // Sets the prefix of all these OMG IDL definitions. // Prefix generated Java mapping classes. typeprefix demo 3 "ccm. objectweb. org"; . . . }; Getting started with Open. CCM 9

Defining a base component type // A base type for named component Named. Component

Defining a base component type // A base type for named component Named. Component { /** The identifier name property. */ attribute string name; }; // The primary key to identify components valuetype Name. Primary. Key : : : Components: : Primary. Key. Base { /** Just a string name. */ public /*string*/ long name; }; Getting started with Open. CCM 10

The Service Interface and Event valuetype interface Service { void display(in string text); };

The Service Interface and Event valuetype interface Service { void display(in string text); }; // The Event valuetype published by the Server // component and consumed by its Consumer components eventtype Text. Event { /** Just contains a string. */ public string text; }; Getting started with Open. CCM 11

The Server Component // The Server component type component Server : Named. Component {

The Server Component // The Server component type component Server : Named. Component { // Provides a Service to its Client components provides Service the_service; // Publishes Events to its Consumer components publishes Text. Event to_consumers; }; // Simple home for instantiating Server component home Server. Home manages Server {}; Getting started with Open. CCM 12

The Server Component Server. Home Server Component // The Server component type component Server

The Server Component Server. Home Server Component // The Server component type component Server : Named. Component { // Provides a Service to its Client components provides Service the_service; // Publishes Events to its Consumer components publishes Text. Event to_consumers; }; // Simple home for instantiating Server component home Server. Home manages Server {}; Getting started with Open. CCM 13

The Server Component Server. Manager Server Component // The home for managing Server components

The Server Component Server. Manager Server Component // The home for managing Server components home Server. Manager manages Server primarykey Name. Primary. Key { // To create a new Server identified by the name factory create_server(in string name); // To find a Server identified by the name finder find_server(in string name); }; Getting started with Open. CCM 14

The Client Component // The Client component type component Client : Named. Component {

The Client Component // The Client component type component Client : Named. Component { // Uses the service provided by the Server component uses Service the_service; }; // Simple home for instanciating Client components home Client. Home manages Client { }; // The home for managing Client components home Client. Manager manages Client primarykey Name. Primary. Key { /** To create a new Client identified by the name. */ factory create_client(in string name); /** To find a Client identified by the name. */ finder find_client(in string name); }; Getting started with Open. CCM 15

The Client Component Client. Home Client // The Client component type component Client :

The Client Component Client. Home Client // The Client component type component Client : Named. Component { // Uses the service provided by the Server component uses Service the_service; }; // Simple home for instanciating Client components home Client. Home manages Client { }; // The home for managing Client components home Client. Manager manages Client primarykey Name. Primary. Key { /** To create a new Client identified by the name. */ factory create_client(in string name); /** To find a Client identified by the name. */ finder find_client(in string name); }; Getting started with Open. CCM 16

The Consumer Component // The Consumer component type component Consumer : Named. Component {

The Consumer Component // The Consumer component type component Consumer : Named. Component { // Consumes Events published by Server components consumes Text. Event from_servers; }; // Simple home for instanciating Client components home Consumer. Home manages Consumer { }; // The home for managing Client components home Consumer. Manager manages Consumer primarykey Name. Primary. Key { /** To create a new Consumer identified by the name. */ factory create_consumer(in string name); Consumer /** To find a Consumer identified by the name. */ finder find_consumer(in string name); }; Getting started with Open. CCM 17

The Consumer Component Consumer. Home // The Consumer component type component Consumer : Named.

The Consumer Component Consumer. Home // The Consumer component type component Consumer : Named. Component Consumer { // Consumes Events published by Server components consumes Text. Event from_servers; }; // Simple home for instanciating Client components home Consumer. Home manages Consumer { }; // The home for managing Client components home Consumer. Manager manages Consumer primarykey Name. Primary. Key { /** To create a new Consumer identified by the name. */ factory create_consumer(in string name); /** To find a Consumer identified by the name. */ finder find_consumer(in string name); }; Getting started with Open. CCM 18

Interconnections between CORBA component instances Consumer. Home Client Server. Home Consumer Server Component Consumer

Interconnections between CORBA component instances Consumer. Home Client Server. Home Consumer Server Component Consumer Client Consumer Getting started with Open. CCM 19

Agenda 1. OMG IDL 3 : design the application by defining components and assembling

Agenda 1. OMG IDL 3 : design the application by defining components and assembling component instances 2. Open. CCM compilation and generation chain for the demo 3 example 3. Open. CCM execution chain for the demo 3 example 4. Package, assembly and deploy the CCM application with XML descriptors (edited using simple GUI) Getting started with Open. CCM 20

2. Open. CCM compilation and generation chain for the demo 3 example n n

2. Open. CCM compilation and generation chain for the demo 3 example n n n n Loading the Open. CCM environment Start the Open. CCM's OMG IDL 3 Repository (named IR 3) Checking the demo 3. idl 3 file Feeding the demo 3. idl 3 file into the Open. CCM's IR 3 Generating equivalent OMG IDL 2. 4 mapping for demo 3 Generating the Java Open. CCM skeletons for demo 3 Implementing the Client/Server–Producer/Consumer example Compiling generated Java CORBA 2 stubs, generated Java Open. CCM skeletons, all Java implementation sources and building archive demo 3. jar Getting started with Open. CCM 21

Loading the Open. CCM environment n Assuming Open. CCM is compiled and installed in

Loading the Open. CCM environment n Assuming Open. CCM is compiled and installed in C: Open. CCM with ORBacus-4. 1 under Windows NT : C: Open. CCM>ORBacus-4. 1binenvi_Open. CCM. bat To have access to all Open. CCM’s tools Getting started with Open. CCM 22

Start the Open. CCM's OMG IDL 3 Repository C: Open. CCMdemo 3>ir 3_start §

Start the Open. CCM's OMG IDL 3 Repository C: Open. CCMdemo 3>ir 3_start § § § Start the Open. CCM’s IR 3 Feed the Open. CCM's IR 3 with the IFR_3_0. idl file Feed the Open. CCM's IR 3 with the Components. idl file this script automatically creates the $Open. CCM_CONFIG_DIR directory Getting started with Open. CCM 23

Checking the demo 3. idl 3 file C: Open. CCMdemo 3>idl 3_check demo 3.

Checking the demo 3. idl 3 file C: Open. CCMdemo 3>idl 3_check demo 3. idl 3 Open. CCM's n OMG OMG OMG IDL IDL IDL 3. 0 3. 0 Compiler Compiler 0. 5. 0: Reading from file demo 3. idl 3. . . Preprocessing file demo 3. idl 3. . . File demo 3. idl 3 preprocessed Feeding the Interface Repository. . . Compilation completed: 0 warnings. This script checks if if the specified OMG IDL 3. 0 file “demo 3. idl 3” is correct Getting started with Open. CCM 24

Feeding the demo 3. idl 3 file into the Open. CCM's IR 3 C:

Feeding the demo 3. idl 3 file into the Open. CCM's IR 3 C: Open. CCMdemo 3>ir 3_feed demo 3. idl 3 Open. CCM's n OMG OMG OMG IDL IDL IDL 3. 0 3. 0 Compiler Compiler 0. 5. 0: Reading from file demo 3. idl 3. . . Preprocessing file demo 3. idl 3. . . File demo 3. idl 3 preprocessed Feeding the Interface Repository. . . Compilation completed: 0 warnings. The ir 3_feed script allows to compile demo 3. idl 3 file and to feed the Open. CCM's IR 3 (necessary to use any of the Open. CCM tools) Getting started with Open. CCM 25

Generating equivalent OMG IDL 2. 4 mapping for the demo 3 IR 3 object

Generating equivalent OMG IDL 2. 4 mapping for the demo 3 IR 3 object n n The ir 3_idl 2 script generates the OMG IDL 2. 4 CCM's mapping associated to an Open. CCM's IR 3 object (demo 3. idl) : C: Open. CCMdemo 3>ir 3_idl 2 demo 3 Add –o filename option to produce an output file and –i option to add the #include statement, ie : C: Open. CCMdemo 3>ir 3_idl 2 -i Components. idl -o demo 3. idl demo 3 In this case, “-i Components. idl” produces the “#include Components. idl” statement in the demo 3. idl file Getting started with Open. CCM 26

Client-side and Server-side OMG IDL Mappings Component Client Application Component Designer Component Implementer OMG

Client-side and Server-side OMG IDL Mappings Component Client Application Component Designer Component Implementer OMG IDL 3. 0 Component Executor uses implemented by OMG IDL 3. 0 Compiler Client-side OMG IDL 2. x User written implemented by Compiler Client Generated files Stub Local server-side OMG IDL 2. x delegates to ORB Component Skeleton Getting started with Open. CCM 27

Client-Side OMG IDL Mapping rules n n A component type is mapped to an

Client-Side OMG IDL Mapping rules n n A component type is mapped to an interface inheriting from Components: : CCMObject Facets and event sinks are mapped to an operation for obtaining the associated reference Receptacles are mapped to operations for connecting, disconnecting, and getting the associated reference(s) Event sources are mapped to operations for subscribing and unsubscribing to produced events Getting started with Open. CCM 28

Client-Side OMG IDL Mapping rules n An event type is mapped to n A

Client-Side OMG IDL Mapping rules n An event type is mapped to n A value type n n A consumer interface n n inheriting from Components: : Event. Base inheriting from Components: : Event. Consumer. Base A home type is mapped to three interfaces n One for explicit operations user-defined n n n inheriting from Components: : CCMHome One for implicit operations generated One inheriting from both previous interfaces Getting started with Open. CCM 29

Client-Side OMG IDL Mapping rules n Text. Event eventtype is mapped to : eventtype

Client-Side OMG IDL Mapping rules n Text. Event eventtype is mapped to : eventtype Text. Event { /** Just contains a string. */ public string text; }; Is mapped to valuetype Text. Event : : : Components: : Event. Base { public string text; }; interface Text. Event. Consumer : : : Components: : Event. Consumer. Base { void push_Text. Event(in : : demo 3: : Text. Event the_textevent); }; Getting started with Open. CCM 30

Client-Side OMG IDL Mapping rules n Server Component component Server : Named. Component {

Client-Side OMG IDL Mapping rules n Server Component component Server : Named. Component { provides Service the_service; publishes Text. Event to_consumers; }; Server Component Is mapped to interface Server : : : demo 3: : Named. Component { : : demo 3: : Service provide_the_service(); : : Components: : Cookie subscribe_to_consumers(in : : demo 3: : Text. Event. Consumer consumer); : : demo 3: : Text. Event. Consumer unsubscribe_to_consumers(in : : Components: : Cookie ck); }; Getting started with Open. CCM 31

Client-Side OMG IDL Mapping rules n Server. Home home Server. Home manages Server {};

Client-Side OMG IDL Mapping rules n Server. Home home Server. Home manages Server {}; Server Component Is mapped to interface Server. Home. Explicit : : : Components: : CCMHome { }; interface Server. Home. Implicit : : : Components: : Keyless. CCMHome { : : demo 3: : Server create(); }; interface Server. Home : : : demo 3: : Server. Home. Explicit, : : demo 3: : Server. Home. Implicit { }; Getting started with Open. CCM 32

Client-Side OMG IDL Mapping rules n Server. Manager home Server. Manager Server Component home

Client-Side OMG IDL Mapping rules n Server. Manager home Server. Manager Server Component home Server. Manager manages Server primarykey Name. Primary. Key { factory create_server(in string name); finder find_server(in string name); }; Is mapped to Getting started with Open. CCM 33

Client-Side OMG IDL Mapping rules n home Server. Manager Is mapped to interface Server.

Client-Side OMG IDL Mapping rules n home Server. Manager Is mapped to interface Server. Manager. Explicit : : : Components: : CCMHome { : : demo 3: : Server create_server(in string name); : : demo 3: : Server find_server(in string name); }; interface Server. Manager. Implicit { : : demo 3: : Server create(in : : demo 3: : Name. Primary. Key key); : : demo 3: : Server find_by_primary_key(in : : demo 3: : Name. Primary. Key key); void remove(in : : demo 3: : Name. Primary. Key key); : : demo 3: : Name. Primary. Key get_primary_key(in : : demo 3: : Server comp); }; interface Server. Manager : : : demo 3: : Server. Manager. Explicit, : : demo 3: : Server. Manager. Implicit { }; Getting started with Open. CCM 34

Client-Side OMG IDL Mapping rules n Client Component component Client : Named. Component {

Client-Side OMG IDL Mapping rules n Client Component component Client : Named. Component { uses Service the_service; }; Is mapped to interface Client : : : demo 3: : Named. Component { void connect_the_service(in : : demo 3: : Service connexion); : : demo 3: : Service disconnect_the_service(); : : demo 3: : Service get_connection_the_service(); }; Getting started with Open. CCM 35

Client-Side OMG IDL Mapping rules n Consumer Component Consumer component Consumer : Named. Component

Client-Side OMG IDL Mapping rules n Consumer Component Consumer component Consumer : Named. Component { consumes Text. Event from_servers; }; Is mapped to interface Consumer : : : demo 3: : Named. Component { : : demo 3: : Text. Event. Consumer get_consumer_from_servers(); }; Getting started with Open. CCM 36

Server-Side OMG IDL Mapping rules n A component type is mapped to three local

Server-Side OMG IDL Mapping rules n A component type is mapped to three local interfaces n The main component executor interface n n The monolithic component executor interface n n Operations to obtain facet executors and receive events The component specific context interface n n Inheriting from Components: : Enterprise. Component Operations to access component receptacles and event sources A home type is mapped to three local interfaces n One for explicit operations user-defined n n n Inheriting from Components: : Home. Executor. Base One for implicit operations generated One inheriting from both previous interfaces Getting started with Open. CCM 37

Server-Side OMG IDL Mapping rules : Named. Component // Main component executor interface name

Server-Side OMG IDL Mapping rules : Named. Component // Main component executor interface name = xxx local interface CCM_Named. Component_Executor : : : Components: : Enterprise. Component { attribute string name; }; // Monolithic component executor interface local interface CCM_Named. Component : : : demo 3: : CCM_Named. Component_Executor { // no operations to obtain facet executors and receive events }; // Component-specific context interface. local interface CCM_Named. Component_Context : : : Components: : CCMContext { // no operations to access component receptacles and event sources }; Getting started with Open. CCM 38

Server-Side OMG IDL Mapping rules : Server Component // Main component executor interface local

Server-Side OMG IDL Mapping rules : Server Component // Main component executor interface local interface CCM_Server_Executor : : : demo 3: : CCM_Named. Component_Executor { }; Server Component // Monolithic component executor interface local interface CCM_Server : : : demo 3: : CCM_Server_Executor { : : demo 3: : CCM_Service get_the_service(); }; // Component-specific context interface. local interface CCM_Server_Context : : : demo 3: : CCM_Named. Component_Context { void push_to_consumers(in : : demo 3: : Text. Event event); }; Getting started with Open. CCM 39

Server-Side OMG IDL Mapping rules : Server Component Server CCM_Server Service Session. Component CCM_Service

Server-Side OMG IDL Mapping rules : Server Component Server CCM_Server Service Session. Component CCM_Service Monolithic executor CCM_Server_Context Session. Context Getting started with Open. CCM 40

Server-Side OMG IDL Mapping rules : Client Component // Main component executor interface local

Server-Side OMG IDL Mapping rules : Client Component // Main component executor interface local interface CCM_Client_Executor : : : demo 3: : CCM_Named. Component_Executor { }; // Monolithic component executor interface local interface CCM_Client : : : demo 3: : CCM_Client_Executor { }; // Component-specific context interface. local interface CCM_Client_Context : : : demo 3: : CCM_Named. Component_Context { : : demo 3: : Service get_connection_the_service(); }; Getting started with Open. CCM 41

Server-Side OMG IDL Mapping rules : Client Component Client CCM_Client Session. Component Monolithic executor

Server-Side OMG IDL Mapping rules : Client Component Client CCM_Client Session. Component Monolithic executor CCM_Client_Context Session. Context Getting started with Open. CCM 42

Server-Side OMG IDL Mapping rules : Consumer Component local interface CCM_Text. Event. Consumer {

Server-Side OMG IDL Mapping rules : Consumer Component local interface CCM_Text. Event. Consumer { void push(in : : demo 3: : Text. Event event); }; // Main component executor interface local interface CCM_Consumer_Executor : : : demo 3: : CCM_Named. Component_Executor { }; // Monolithic component executor interface local interface CCM_Consumer : : : demo 3: : CCM_Consumer_Executor { void push_from_servers(in : : demo 3: : Text. Event event); }; // Component-specific context interface. local interface CCM_Consumer_Context : : : demo 3: : CCM_Named. Component_Context { }; Getting started with Open. CCM 43

Server-Side OMG IDL Mapping rules : Consumer Component Consumer CCM_Consumer Session. Component CCM_Text. Event.

Server-Side OMG IDL Mapping rules : Consumer Component Consumer CCM_Consumer Session. Component CCM_Text. Event. Consumer Monolithic Executor CCM_Consumer_Context Session. Context Getting started with Open. CCM 44

Generating the Java Open. CCM skeletons associated to demo 3 n The script id

Generating the Java Open. CCM skeletons associated to demo 3 n The script id 3_java. bat allows to generate skeletons C: Open. CCMdemod emo 3>ir 3_java : : demo 3 n Files generated : Client. CCM. java Client. Home. Skeleton. Interceptor. java Client. Home. Stub. Interceptor. java Client. Manager. CCM. java Client. Manager. Skeleton. Interceptor. java Client. Manager. Stub. Interceptor. java Client. Monolithic. Wrapper. java Client. Skeleton. Interceptor. java Consumer. CCM. java Consumer. Home. Skeleton. Interceptor. java Consumer. Home. Stub. Interceptor. java Consumer. Manager. CCM. java Consumer. Manager. Skeleton. Interceptor. java Consumer. Manager. Stub. Interceptor. java Consumer. Monolithic. Wrapper. java Consumer. Skeleton. Interceptor. java Getting started with Open. CCM 45

Generating the Java Open. CCM skeletons associated to demo 3 Named. Component. CCM. java

Generating the Java Open. CCM skeletons associated to demo 3 Named. Component. CCM. java Named. Component. Monolithic. Wrapper. java Named. Component. Skeleton. Interceptor. java Name. Primary. Key. Factory. Helper. java Server. CCM. java Server. Home. Skeleton. Interceptor. java Server. Home. Stub. Interceptor. java Server. Manager. CCM. java Server. Manager. Skeleton. Interceptor. java Server. Manager. Stub. Interceptor. java Server. Monolithic. Wrapper. java Server. Skeleton. Interceptor. java Service. Stub. Interceptor. java Text. Event. Consumer. Skeleton. Interceptor. java Text. Event. Consumer. Stub. Interceptor. java Text. Event. Consumer. Wrapper. java Text. Event. Factory. Helper. java Getting started with Open. CCM 46

Generating Java CORBA 2 stubs n Using jidl compiler for ORBacus-4. 1, --tie option

Generating Java CORBA 2 stubs n Using jidl compiler for ORBacus-4. 1, --tie option allows to generate tie classes, -I option to include idl files, this generate stubs for demo 3 in demo 3generatedstubs directory. C: Open. CCMdemo 3>jidl --auto-package --tie -I. . /ORBacus-4. 1/idl --output-dir generated/stubs demo 3. idl Getting started with Open. CCM 47

Implementing the Client/Server – Producer/Consumer Open. CCM example n n Now we have to

Implementing the Client/Server – Producer/Consumer Open. CCM example n n Now we have to implement this example by writing Java implementation files Only functional parts of the application have to be implemented Files to write : Client. Home. Impl. java Client. Impl. java Consumer. Home. Impl. java Consumer. Impl. java Demo 3. java Server. Home. Impl. java Server. Impl. java Text. Event. Default. Factory. java Text. Event. Impl. java Getting started with Open. CCM 48

Implementing the Client/Server – Producer/Consumer Open. CCM example n Demo 3. java is the

Implementing the Client/Server – Producer/Consumer Open. CCM example n Demo 3. java is the bootstrap of the application, here we have to n n n n n Initialise the ORB, obtain the Name Service Obtain component servers Component. Server 1 and Component. Server 2 Obtain the container homes Instantiate a container on each server Install homes for Client, Server and Consumer Create components with create() method of homes : here we have three clients, three consumers and one server-producer Configure components Connect each client and consumer to server Call the configuration_complete() method of components implementation Getting started with Open. CCM 49

Implementing the Client/Server – Producer/Consumer Open. CCM example Demo 3. java Connect each client

Implementing the Client/Server – Producer/Consumer Open. CCM example Demo 3. java Connect each client and consumer to server Client Component Server Component Consumer Component . . Service the_service = s. provide_the_service(); c 1. connect_the_service(the_service); c 2. connect_the_service(the_service); c 3. connect_the_service(the_service); s. subscribe_to_consumers(cs 1. get_consumer_from_servers()); s. subscribe_to_consumers(cs 2. get_consumer_from_servers()); s. subscribe_to_consumers(cs 3. get_consumer_from_servers()); . . Getting started with Open. CCM 50

Implementing the Client/Server – Producer/Consumer Open. CCM example n Client. Impl. java : n

Implementing the Client/Server – Producer/Consumer Open. CCM example n Client. Impl. java : n Instantiates, constructs and shows the GUI n Perform the action when the button is clicked by calling the display service. display(. . . ) (Service interface operation) . . // Obtain the object reference associated to the // 'the_service' receptacle. Service service = the_context_. get_connection_the_service(); // Calls the display service. display(name_ + ": " + text_. get. Text()); . . Getting started with Open. CCM 51

Implementing the Client/Server – Producer/Consumer Open. CCM example n Server. Impl. java n Instantiates,

Implementing the Client/Server – Producer/Consumer Open. CCM example n Server. Impl. java n Instantiates, constructs and shows the GUI n Implements the display method for the Service interface by displaying string text n Push events to consumers push_to_consumers(. . . ) . . . public void display(String text) { // Puts the text into the text area. text. Area_. append(text + "n"); // Pushes an event to all connected consumers. the_context_. push_to_consumers ( new Text. Event. Impl(text) ); }. . . Getting started with Open. CCM 52

Implementing the Client/Server – Producer/Consumer Open. CCM example n Consumer. Impl. java : n

Implementing the Client/Server – Producer/Consumer Open. CCM example n Consumer. Impl. java : n n Instantiates, constructs and shows the GUI Implements reception of events published by server components push_from_server(. . . ) . . . public void push_from_servers(Text. Event event) { push(event); } public void push(Text. Event event) { // Put the text into the text area. text. Area_. append(event. text + "n"); }. . . Getting started with Open. CCM 53

Implementing the Client/Server – Producer/Consumer Open. CCM example n Client. Home. Impl. java This

Implementing the Client/Server – Producer/Consumer Open. CCM example n Client. Home. Impl. java This class inherits from the local CCM_Client. Home interface generated. It implements the create_home() method called by the Open. CCM Component Server to create a home instance Consumer. Home. Impl. java, Server. Home. Impl. java n Implements the create_home() method to create a home instance n Register the Text. Event valuetype factory to the ORB n n Getting started with Open. CCM 54

Compiling Java sources Building archive demo 3. jar n Now, we have to :

Compiling Java sources Building archive demo 3. jar n Now, we have to : n n n Compile generated Java CORBA 2 stubs and Java Open. CCM skeletons, Compile all Java implementation sources, Build archive demo 3. jar Getting started with Open. CCM 55

Agenda 1. OMG IDL 3 : design the application by defining components and assembling

Agenda 1. OMG IDL 3 : design the application by defining components and assembling component instances 2. Open. CCM compilation and generation chain for the demo 3 example 3. Open. CCM execution chain for the demo 3 example 4. Package, assembly and deploy the CCM application with XML descriptors (edited using simple GUI) Getting started with Open. CCM 56

3. Open. CCM execution chain for the demo 3 example n Installing the Open.

3. Open. CCM execution chain for the demo 3 example n Installing the Open. CCM configuration Repository ccm_install n Starting the Name. Service ns_start n Starting Java Component Servers jcs_start n Getting the IOR of the started Name Service ns_ior n Starting JVM to run demo 3 Getting started with Open. CCM 57

Installing the Open. CCM configuration Repository, Starting the Name Service C: Open. CCMdemo 3>ccm_install

Installing the Open. CCM configuration Repository, Starting the Name Service C: Open. CCMdemo 3>ccm_install The Open. CCM Platform will be installed. Creating the C: Open. CCMORBacus-4. 1Open. CCM_CONFIG_DIR directory. Creating the C: Open. CCMORBacus 4. 1Open. CCM_CONFIG_DIRComponent. Servers directory. The Open. CCM Platform is installed. C: Open. CCMdemo 3>ns_start The Name Service will be started. Launching the ORBacus Name Service. The Name Service is started. Getting started with Open. CCM 58

Starting Java Component Servers for demo 3 n Named Component. Server 1 and Component.

Starting Java Component Servers for demo 3 n Named Component. Server 1 and Component. Server 2 C: Open. CCMdemo 3>jcs_start Component. Server 1 The Open. CCM's Java Component Server Component. Server 1 will be started. Creating the C: Open. CCMORBacus 4. 1Open. CCM_CONFIG_DIRComponent. ServersComponent. Server 1. archive _cache directory. Launching an Open. CCM's Java Component Server. The Open. CCM's Java Component Server Component. Server 1 is started. C: Open. CCMdemo 3>jcs_start Component. Server 2 The Open. CCM's Java Component Server Component. Server 2 will be started. Creating the C: Open. CCMORBacus 4. 1Open. CCM_CONFIG_DIRComponent. ServersComponent. Server 2. archive _cache directory. Launching an Open. CCM's Java Component Server. The Open. CCM's Java Component Server Component. Server 2 is started. Getting started with Open. CCM 59

Getting the IOR of the started Name Service and run demo 3 C: Open.

Getting the IOR of the started Name Service and run demo 3 C: Open. CCMdemo 3>ns_ior IOR: 00000002 a 49444 c 3 a 6 f 6 f 632 e 636 f 6 d 2 f 436 f 73. . . . n Then we call the JVM with IOR args and demo 3. jar archive in classpath Starting demonstration demo 3. . . Initializing the ORB. . . Obtaining the Name Service. . . Obtaining Component Servers. . . Installing archives. . . Creating components. . . Configuring components. . . Interconnecting components. . . Configuration completion. . . Demonstration demo 3 is ready to be used. . . Getting started with Open. CCM 60

The Client / Server-Producer / Consumer CCM application running. . . Getting started with

The Client / Server-Producer / Consumer CCM application running. . . Getting started with Open. CCM 61

Agenda 1. OMG IDL 3 : design the application by defining components and assembling

Agenda 1. OMG IDL 3 : design the application by defining components and assembling component instances 2. Open. CCM compilation and generation chain for the demo 3 example 3. Open. CCM execution chain for the demo 3 example 4. Package, assembly and deploy the CCM application with XML descriptors (edited using simple GUI) Getting started with Open. CCM 62

4. Package, assembly and deploy the CCM application with XML descriptors edited using simple

4. Package, assembly and deploy the CCM application with XML descriptors edited using simple GUI n Software Package Descriptor n n describe general elements (title, author, description, web page, license, link to IDL file. . . etc) and list implementations (information about implementations like OS, ORB, language, compiler, dependancies on other libraries. . . etc. , entry point) Property File Descriptor n n used to set home and component properties. It contains pairs of name/value to configure home and component attributes Getting started with Open. CCM 63

Package, assembly and deploy the CCM application with XML descriptors edited using simple GUI

Package, assembly and deploy the CCM application with XML descriptors edited using simple GUI n Component Assembly Descriptor References component software descriptors client. csd, server. csd and consumer. csd Defines home instances and their collocation, component instances Defines that homes, components or ports are to be registered in the Component. Home. Finder or Naming Service Defines connections to be made between Client, Server and Consumer component ports (receptacles to facets, event sinks to event sources) Getting started with Open. CCM 64

Package, assembly and deploy the CCM application using XML descriptors IDL/CIDL File User's Code

Package, assembly and deploy the CCM application using XML descriptors IDL/CIDL File User's Code Programming Language Tools IDL/CIDL Compiler Default Properties Stubs, Skeletons Home Properties Component Properties CORBA Component Package Implementation Packaging Tool CORBA Component Package Assembly Tool Component Assembly Package Component Descriptor Assembly Descriptor softpkg Descriptor CORBA Component Package Getting started with Open. CCM Deployment Tool 65

Edit XML descriptors using simple GUI demo : Packaging, Assembling and Deploying the Client

Edit XML descriptors using simple GUI demo : Packaging, Assembling and Deploying the Client / Server – Producer / Consumer CCM application by defining : n Component names properties n Home instances and their collocation n Component instances n Connections between components n. . . Getting started with Open. CCM 66

Conclusion n Open. CCM : 1 st open standard for Distributed Component Computing n

Conclusion n Open. CCM : 1 st open standard for Distributed Component Computing n n An open compilation & generation tool chain n n Multi-languages, multi-OSs, multi-ORBs. . . etc. An OMG IDL 3 Compiler An OMG IDL 3 Repository A generator for equivalent OMG IDL 2 A generator for extended Java skeleton classes A flexible distributed deployment & execution middleware infrastructure Getting started with Open. CCM 67

More information n Object. Web n n Open. CCM n n n http: //www.

More information n Object. Web n n Open. CCM n n n http: //www. objectweb. org/openccm/ Mailing list = openccm@objectweb. org LIFL n n http: //www. objectweb. org http: //www. lifl. fr . . . Getting started with Open. CCM 68