Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Second tutorial



The first tutorial presented the coding and configuration of a very simple system with two modules. In this second tutorial, we reuse the implementation of the first tutorial, but we create two instances of one module. It is entirely performed at the configuration level (no code change).

Overview

In the first tutorial, we had two modules:
  • The PublishModule module increments or decrements a value cyclically
  • The EventModule module allows to click on a toggle to set if the first module should increment or decrement the value, and shows the value
We will duplicate the EventModule module at the configuration level. We will have as a result two GUIs which will allow to set if the first module should increment or decrement the value, and shows the value.
tuto2

Architecture

We won't change anything for the services or types configuration of the first tutorial, but we will duplicate the EventModule in the applications configuration. We will have two modules in the eventAppli application: And two applications:
  • The first EventModule1
  • The second EventModule2
The two modules will have exactly the same implementation as our previous EventModule in the first tutorial:
tuto2archi
  • When the PublishModule invokes cyclically the published Service, both EventModule1 and EventModule2 will be notified (and will show the value of the counter)
  • Both the EventModule1 and EventModule2 modules can set the incrementation or decrementation of the counter

XML configuration

Only the applications.xml XML file has to be modified. The code is not impacted.

Applications definition

We will only change the applications.xml XML file, by duplicating the previous EventModule configuration:
      <application name="eventAppli" id="1">
         <deployment>
            <lib url="samples1Event.jar" />
         </deployment>
         <modules>
            <module name="EventModule1" id="1" > 
               <implementation path="org.da.samples.protoframework.event.EventModule" >
                  <initEntryPoint method="init" />
                  <defaultReceiveEntryPoint method="subscribe" />
               </implementation>
               <interfaces>
                  <eventSend service="event" attach="attach"/>
                  <subscribe service="published" />
               </interfaces>             
            </module>
         </modules>
         <modules>
            <module name="EventModule2" id="2" > 
               <implementation path="org.da.samples.protoframework.event.EventModule" >
                  <initEntryPoint method="init" />
                  <defaultReceiveEntryPoint method="subscribe" />
               </implementation>
               <interfaces>
                  <eventSend service="event" attach="attach"/>
                  <subscribe service="published" />
               </interfaces>             
            </module>
         </modules>      
      </application>
Everything else will remain identical.

Starting the framework

To start the framework, we must start the framework with our filelist2.xml file for our configuration:
      java -jar protoframework.jar config=filelist2.xml


tuto2

See also


Categories: tutorials

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence