PROCEDE DE FIABILISATION DE LA MULTI-DIFFUSION D'OBJETS METHOD FOR THE RELIABILITY OF MULTI-DIFFUSION OF OBJECTS
DISTRIBUESDISTRIBUTED
La présente invention se rapporte à un procédé de fiabilisation de la multi- diffusion d'objets distribués.The present invention relates to a method for making the multicasting of distributed objects reliable.
Actuellement, le standard CORBA, qui est un des moyens utilisés pour assurer la transmission d'objets distribués, par exemple pour les transmissions entre calculateurs d'un même réseau, ne supporte que la multi-diffusion (« multicast » en anglais) non fiabilisée des requêtes CORBA avec le protocole MIOP (cf. le document OMG ptc/03-01-11 en date d'octobre 2001). Ce protocole MIOP (« Multicast Inter-ORB Protocol ») est mis en oeuvre pour envoyer des requêtes CORBA vers une couche de protocole multi-diffusion UDP, mais il ne garantit pas la fiabilité de la réception des requêtes et le respect de l'ordre de réception (appelé aussi « ordonnancement » ou « ordering » en anglais) de ces requêtes. Il est donc alors possible que des requêtes arrivent dans le désordre à leur destinataire, ou même qu'elles se perdent dans le réseau sans pouvoir être récupérées à la réception.Currently, the standard CORBA, which is one of the means used to ensure the transmission of distributed objects, for example for transmissions between computers of the same network, only supports the multicast ("multicast" in English) unreliable CORBA queries with the MIOP protocol (see OMG document ptc / 03-01-11 dated October 2001). This MIOP protocol ("Multicast Inter-ORB Protocol") is implemented to send CORBA requests to a UDP multicast protocol layer, but it does not guarantee the reliability of the reception of requests and the respect of the order reception (also called "ordering" or "ordering" in English) of these requests. It is then possible that requests arrive in the disorder to their recipient, or even they get lost in the network without being able to be recovered at the reception.
Un nouveau protocole de multi-diffusion, le ROMIOP (« Reliable Ordered Multicast Inter-ORB Protocol » en anglais, c'est-à-dire le protocole MIOP fiabilisé et ordonnancé), est en cours d'élaboration (la dernière version révisée connue date d' Octobre 2003 ), mais jusqu'à présent aucune réalisation concrète n'a été proposée au niveau industriel. En outre, ce protocole ROMIOP ne s'appuie pas sur les caractéristiques du protocole MIOP actuel, mais définira un nouveau protocole de communication. Il en résulte que si on l'utilisait tel qu'il est défini actuellement dans un environnement dans lequel les différents calculateurs ont des implémentations de CORBA différentes, mais inter-opérables, cela obligerait à conférer à tous les ORBs (les bus logiciels des objets répartis assurant le transport des requêtes entre les objets distribués) des implémentations compatibles entre elles du protocole ROMIOP. Enfin, ce protocole ROMIOP ne permet pas le choix, à l'émission et/ou à la réception de requêtes de multi-diffusion, d'une stratégie assurant un niveau de fiabilisation et/ou d'ordonnancement désiré, et limite le nombre de stratégies possibles au niveau des ORBs.
La présente invention a pour objet un procédé de fiabilisation de la multi- diffusion d'objets distribués, en particulier mais non exclusivement avec le langage CORBA, ce procédé permettant de fixer à tout moment et de manière dynamique une qualité de service souhaitée durant la durée d'utilisation du système de mise en oeuvre de la multi-diffusion, utilisant le protocole MIOP et assurant le bon ordonnancement et la réception des requêtes émises en multi-diffusion, et ce, sans modifier, du point de vue de l'utilisateur de l'application de ce système, les objets distribués ; la mise en oeuvre de ce procédé pouvant être faite à l'aide de composants logiciels du commerce (composants dits « COTS ») et de langages standard. La présente invention a également pour objet une librairie structuranteA new multicast protocol, the Reliable Ordered Multicast Inter-ORB Protocol (ROMIOP), is being developed (the last known revised version). dated October 2003), but so far no concrete achievements have been proposed at the industrial level. In addition, this ROMIOP protocol does not rely on the characteristics of the current MIOP protocol, but will define a new communication protocol. As a result, if we used it as it is currently defined in an environment in which the different computers have different CORBA implementations, but interoperable, this would require to confer to all the ORBs (the software bus of the objects). distributed networks providing the transport of requests between the distributed objects) compatible implementations of the ROMIOP protocol. Finally, this ROMIOP protocol does not allow the choice, on transmission and / or reception of multicast requests, of a strategy ensuring a desired level of reliability and / or scheduling, and limits the number of requests. possible strategies at ORB level. The subject of the present invention is a method of making the multicasting of distributed objects more reliable, in particular but not exclusively with the CORBA language, this method making it possible to set at any time and dynamically a quality of service desired during the period of time. of use of the implementation system of the multicast, using the MIOP protocol and ensuring the proper scheduling and reception of queries issued in multicasting, and without changing, from the point of view of the user of the application of this system, distributed objects; the implementation of this method can be done using commercial software components (so-called "COTS" components) and standard languages. The present invention also relates to a structuring library
(« Framework » en anglais) pouvant être facilement intégrée à un système existant, sans modifier les couches ORB.("Framework" in English) that can be easily integrated into an existing system without changing the ORB layers.
Le procédé conforme à l'invention est un procédé de fiabilisation de la multi- diffusion d'objets distribués , et il est caractérisé en ce que l'on établit un fichier décrivant l'interface entre les applications distribuées et indépendant du langage utilisé pour la gestion des objets, que l'on établit un fichier décrivant les qualités de service attendues, que l'on génère une liste de méta-modèles indépendants du langage de l'application, que l'on établit une bibliothèque d'algorithmes de fiabilisation, que l'on réalise un réceptacle dans lequel l'utilisateur décrit le comportement de l'application, que l'on établit un fichier de paramétrage du service côté client, et un fichier de paramétrage du service côté serveur et que l'on réalise par compilation un programme exécutable pour gérer les clients et les serveurs.The method according to the invention is a method of making the multicasting of distributed objects more reliable, and it is characterized in that a file is drawn up describing the interface between the distributed applications and independent of the language used for the distribution. management of the objects, that one establishes a file describing the qualities of service expected, that one generates a list of meta-models independent of the language of the application, that one establishes a library of algorithms of reliability, that we realize a receptacle in which the user describes the behavior of the application, that one establishes a file of parameterization of the service on the client side, and a file of parameterization of the service server side and that one carries out by compile an executable program to manage clients and servers.
La présente invention sera mieux comprise à la lecture de la description détaillée d'un mode de réalisation, pris à titre d'exemple non limitatif et illustré par le dessin annexé, sur lequel : la figure 1 est un bloc-diagramme servant à expliquer la mise en oeuvre du procédé de l'invention, la figure 2 est un bloc-diagramme d'un système simplifié mettant en oeuvre l'invention , et - la figure 3 est un diagramme simplifié des différentes couches logiques du système de la figure 2 (les ORBs représentés sur la
figure sont donnés à titre d'exemples et de manière non restrictive). La présente invention est décrite ci-dessous en référence à la multi-diffusion de messages utilisant le langage CORBA, mais il est bien entendu qu'elle n'est pas limitée à cette seule application, et qu'elle peut être mise en oeuvre avec d'autres langages utilisant des vecteurs de transport de requêtes pour la distribution d'objets, comme par exemple le langage EJB ou le langage DOT.NET.The present invention will be better understood on reading the detailed description of an embodiment, taken by way of nonlimiting example and illustrated by the appended drawing, in which: FIG. 1 is a block diagram serving to explain the implementation of the method of the invention, FIG. 2 is a block diagram of a simplified system embodying the invention, and FIG. 3 is a simplified diagram of the different logic layers of the system of FIG. the ORBs represented on the figure are given as examples and in a non restrictive way). The present invention is described below with reference to the multicasting of messages using the CORBA language, but it is understood that it is not limited to this single application, and that it can be implemented with other languages using query transport vectors for the distribution of objects, such as EJB or DOT.NET.
Selon le diagramme de la figure 1 du dessin, on a représenté les différentes étapes menant à la réalisation de programmes exécutables destinés à créer, du côté des calculateurs clients et des calculateurs serveurs, des couches intermédiaires entre les applications et le « middleware » (couche intermédiaire) CORBA. A la fin de la présente description, on a fourni un exemple simplifié de différents fichiers (annexes 1 à 9). Cet exemple a été illustré à l'aide d'une requête quelconque, dont le nom générique est « Foo », et qui est, pour le cas représenté sur les figures 2 et 3, la requête « Hello ». En premier lieu, on établit un fichier 1 (voir annexe 1), en format IDL, décrivant l'application considérée, les services et l'interface entre les applications distribuées, puis un fichier 2 (voir annexe 2), en format XML, décrivant les différentes qualités de service susceptibles d'être utilisées. A l'aide d'un générateur 3 de code multi-diffusion, par exemple un « COTS » (logiciel du commerce) en format XSLT, on génère un « proxy » (image locale d'un objet distant) côté client 4 incluant la définition des différentes qualités de service (telles que définies dans le fichier 2) et un squelette 5 côté serveur, incluant également la définition des différentes qualités de service (telles que définies dans le fichier 2).According to the diagram of FIG. 1 of the drawing, the various steps leading to the realization of executable programs designed to create, on the side of the client computers and the server computers, intermediate layers between the applications and the "middleware" (layer intermediate) CORBA. At the end of the present description, a simplified example of different files (Appendices 1 to 9) has been provided. This example has been illustrated using any request, whose generic name is "Foo", and which is, for the case shown in FIGS. 2 and 3, the "Hello" request. Firstly, a file 1 (see appendix 1), in IDL format, describing the considered application, the services and the interface between the distributed applications, and a file 2 (see appendix 2), in XML format, is established. describing the different qualities of service that can be used. With the aid of a multicast code generator 3, for example a "COTS" (commercial software) in XSLT format, a "proxy" (local image of a remote object) is generated on the client side 4 including the defining the different qualities of service (as defined in file 2) and a server-side skeleton, also including the definition of different qualities of service (as defined in file 2).
Par ailleurs, on dispose d'une bibliothèque 6 de services de multi-diffusion, c'est-à-dire une bibliothèque d'algorithmes d'élaboration des différentes qualités de service, telles que définies dans le fichier 2. On dispose également d'un fichier 7 de code applicatif (voir annexe 4) utilisant les services de l'application, côté client (récepteur), et d'un fichier 8 (voir annexe 3) en langage IDL, généré grâce au générateur 3 à partir du fichier 1 que l'utilisateur doit implémenter et décrivant le comportement des services de l'application.
L'utilisateur compile (9) les éléments 4 à 8 pour obtenir les exécutables client (10) (voir annexe 8) et serveur (11) (voir annexe 9). L'exécutable client comporte une bibliothèque 12 de noyau multi-diffusion, un proxy client 13 et un code de l'application 14. L'exécutable serveur comporte une bibliothèque 15 de noyau multi-diffusion, un squelette serveur 16 et la description 17 du comportement des services.Moreover, there is a library 6 of multicast services, that is to say a library of algorithms for developing the different qualities of service, as defined in file 2. It also has an application code file 7 (see appendix 4) using the services of the application, client side (receiver), and a file 8 (see appendix 3) in IDL, generated by the generator 3 from the file 1 that the user must implement and describing the behavior of the services of the application. The user compiles (9) items 4 to 8 to obtain the client executables (10) (see Appendix 8) and server (11) (see Appendix 9). The client executable includes a multicast kernel library 12, a client proxy 13, and an application code 14. The server executable includes a multicast kernel library 15, a server skeleton 16, and the description 17 of the server executable 13. service behavior.
Dans l'annexe 5, on a fourni un exemple de code d'implémentation utilisé lors de la transmission à nouveau d'une requête perdue, à l'initiative du client. L'annexe 6 est un exemple d'outil serveur permettant de créer des objets ORB sécurisés selon l'une parmi plusieurs qualités de service disponibles, tandis que l'annexe 7 est un exemple d'outil similaire pour le client associé à la même qualité de service.In Appendix 5, an example implementation code was provided for the re-transmission of a lost request, initiated by the client. Appendix 6 is an example of a server tool for creating secure ORB objects based on one of several available qualities of service, while Appendix 7 is an example of a similar tool for the client with the same quality. on duty.
On a représenté en figure 2, de façon très simplifiée, un système comportant deux calculateurs 18, 19 reliés à un réseau de transmission commun 20, qui est une couche de « middleware » CORBA. Le calculateur client 18 est associé à une application quelconque 21 qui est « encapsulée » dans un réceptacle 22. Ce réceptacle 22 est une interface mettant en oeuvre l'exécutable 10 décrit ci-dessus, et en particulier la bibliothèque 12. Le calculateur serveur 19 est associé à une application quelconque 23, qui peut être différente de l'application 21. L'application 23 est « encapsulée » dans un réceptacle 24, qui est une interface mettant en oeuvre l'exécutable 11, et en particulier la bibliothèque 15. La couche CORBA 20 mémorise la liste ordonnée à numérotation régulière et continue 25 des requêtes envoyées par le client, et une liste ordonnée à numérotation régulière et continue 26 des requêtes reçues par le serveur. Le présent exemple se rapporte à une qualité de service « absence d'un accusé de réception par le serveur »("negative acknowledgement" en anglais), mais il est bien entendu que d'autres types de qualité de service peuvent aussi bien être mis en oeuvre.FIG. 2 very simply shows a system comprising two computers 18, 19 connected to a common transmission network 20, which is a CORBA middleware layer. The client computer 18 is associated with any application 21 that is "encapsulated" in a receptacle 22. This receptacle 22 is an interface implementing the executable 10 described above, and in particular the library 12. The server computer 19 is associated with any application 23, which may be different from the application 21. The application 23 is "encapsulated" in a receptacle 24, which is an interface implementing the executable 11, and in particular the library 15. The CORBA layer 20 stores the regular numbered ordered list and continues queries sent by the client, and an ordered list with regular and continuous numbering of requests received by the server. This example relates to a quality of service "lack of acknowledgment by the server" ("negative acknowledgment" in English), but it is understood that other types of quality of service can as well be put implemented.
L'application 21 émet une première requête, qui est, dans le cas présent, et comme précisé ci-dessus, « Hello ». Cette requête est d'abord traitée par le service de multi-diffusion 12, puis transmise (27) via la couche CORBA 20 vers le service de
multi-diffusion 15, homologue du service 12 avec ajout du numéro d'ordre de requête associé pour ce type de qualité de service particulière. Le service 15 devrait normalement transmettre cette requête à l'application 23. Si cette requête était perdue dans le réseau (comme illustré par une croix 28 coupant le trajet 27) , le service 15 enverrait une requête 29 de transmission à nouveau de la première requête - étant entendu que cette dernière ne peut être effectuée que lors de la réception d'une autre requête de type 27 afin de déterminer un trou dans la séquence des numéros d'ordres des requêtes reçues 26 pour ce type de qualité de service. Le service 12 répète alors (30) la première requête. On a détaillé en figure 3 les différentes couches logiques de la librairie structurante de l'invention. L'application cliente (21) comporte une couche de composants logiciels 31 de communication CORBA. Ces composants sont, par exemple, en langage C++, et renferment un code applicatif 32 utilisant le service applicatif client, de l'application 21. De façon similaire, l'application serveur (23) comporte une couche de composants logiciels 33 de communication CORBA. Ces composants sont, par exemple, en langage Java, et renferment un code serveur 34 fourni par l'utilisateur de l'application 23, ce code correspondant au comportement du service applicatif serveur.The application 21 sends a first request, which is, in the present case, and as specified above, "Hello". This request is first processed by the multicast service 12, and then transmitted (27) via the CORBA layer 20 to the service provider. multi-diffusion 15, peer of the service 12 with the addition of the associated request sequence number for this type of particular quality of service. The service 15 would normally transmit this request to the application 23. If this request was lost in the network (as illustrated by a cross 28 intersecting the path 27), the service 15 would send a request 29 for transmission again of the first request. it being understood that the latter can only be performed when another type request 27 is received in order to determine a hole in the sequence of the order numbers of the requests received for this type of quality of service. The service 12 then repeats (30) the first request. The various logic layers of the structuring library of the invention are detailed in FIG. The client application (21) comprises a layer of software components 31 CORBA communication. These components are, for example, in the C ++ language, and contain an application code 32 using the client application service of the application 21. Similarly, the server application (23) comprises a CORBA communication software component layer 33 . These components are, for example, in the Java language, and contain a server code 34 provided by the user of the application 23, this code corresponding to the behavior of the server application service.
Le service 32 envoie ses requêtes au proxy client 13, qui est contenu dans le réceptacle 22. Ce proxy 13 contient la définition courante de la qualité de service demandée pour les requêtes client. Le proxy 13, d'une part, communique avec la bibliothèque 12, et d'autre part envoie les requêtes 27 et 30 au squelette serveur 16 via la couche CORBA 20. Cette couche 20 comporte par exemple, du côté client, une implémentation d'un ORB TAO 35 - TAO est un COTS et un exemple d'ORB supportant la projection (« mapping » en anglais) CORBA IDL / C++ - , et du côté serveur, une implémentation d'un ORB du type JacORB ( JacORB est un COTS et un exemple d'ORB supportant le « mapping » CORBA IDL / Java) contenues dans 20 .La communication entre client et serveur est réalisée selon le protocole multi- diffusion UDP/IP 37. Du côté serveur, le squelette 16 reçoit les requêtes client 27 et 30, et communique avec la bibliothèque 15, qui est chargée d'émettre la requête
d'émission à nouveau 29. Le squelette 16 transmet les informations reçues au code 34.The service 32 sends its requests to the client proxy 13, which is contained in the receptacle 22. This proxy 13 contains the current definition of the quality of service requested for the client requests. The proxy 13, on the one hand, communicates with the library 12, and on the other hand sends the requests 27 and 30 to the server skeleton 16 via the CORBA layer 20. This layer 20 comprises, for example, on the client side, an implementation of a TAO 35 - TAO ORB is a COTS and an example of ORB supporting CORBA IDL / C ++ mapping, and on the server side, an implementation of a JacORB type ORB (JacORB is a COTS and an example of an ORB supporting the CORBA IDL / Java mapping contained in 20. The communication between client and server is performed according to the UDP / IP multicast protocol 37. On the server side, the skeleton 16 receives the requests. client 27 and 30, and communicates with the library 15, which is responsible for issuing the request 29. The skeleton 16 transmits the received information to the code 34.
Ainsi, la librairie structurante (« Framework » en anglais) de l'invention permet de placer les solutions de fiabilité non pas sous forme ROMIOP (au niveau des objets ORB donc de manière intrusive pour l'implémentation des ORBs), mais au-dessus de la couche ORB, sans modifier les objets des ORBs. Le problème d'inter-opérabilité est alors résolu en utilisant le service de multi-diffusion standard actuel (le protocole MIOP). Il en résulte que les moyens assurant la fiabilité et l'ordonnancement peuvent être facilement intégrés à un système existant en tant qu'élément « enfichable » (« plug-in » en anglais), et ce, sans modifier la couche ORB.Thus, the structuring library ("Framework" in English) of the invention makes it possible to place the reliability solutions not in ROMIOP form (at the level of the ORB objects so intrusively for the implementation of the ORBs), but above of the ORB layer, without modifying the objects of the ORBs. The interoperability problem is then solved using the current standard multicast service (the MIOP protocol). As a result, the means ensuring the reliability and scheduling can be easily integrated into an existing system as a "plug-in" ("plug-in"), and without changing the ORB layer.
La présente invention permet de prévoir dans un système à la fois différentes qualités de service et différents types d'ordonnancement, et de choisir l'un d'entre eux, et même d'en changer dynamiquement. Parmi les différentes qualités de service possibles, on peut citer :The present invention makes it possible to predict in a system at the same time different qualities of service and different types of scheduling, and to choose one of them, and even to change dynamically. Among the different qualities of service possible, we can mention:
- service non fiabilisé (équivalent au MIOP),- unreliable service (equivalent to MIOP),
- service fiabilisé par émission multiple,- service rendered reliable by multiple transmission,
- service fiabilisé avec détection d'erreurs par le serveur,- reliable service with error detection by the server,
- service fiabilisé avec détection d'erreurs par le client, - service avec présence d'un accusé de réception par le client ou en l'absence d'un accusé de réception par le serveur (respectivement "acknowledgement", ou "négative acknowledgement" en anglais). Bien entendu, compte tenu de l'aspect modulaire du service, il est facilement possible d'ajouter ultérieurement d'autres qualités de service. Parmi les différents types d'ordonnancement (analogues aux types d'ordonnancement de files d'attente de messages CORBA) , on peut citer :- reliable service with error detection by the customer, - service with an acknowledgment by the customer or in the absence of an acknowledgment by the server (respectively "acknowledgment" or "negative acknowledgment" in English). Of course, considering the modular aspect of the service, it is easily possible to add other qualities of service later. Among the different types of scheduling (similar to the types of CORBA message queue scheduling) are:
- l'ordonnancement temporel,- the temporal scheduling,
- l'ordonnancement à priorités de message,- scheduling with message priorities,
- l'ordonnancement avec respect des temps maximaux alloués à la réception des requêtes.
Grâce à l'invention, on minimise l'impact sur l'utilisation de l'architecture- Scheduling with respect to the maximum times allocated to the receipt of requests. Thanks to the invention, the impact on the use of the architecture is minimized
CORBA (au niveau des API), ce qui permettra l'éventuelle utilisation du service de multi-diffusion fiable du futur standard ROMIOP en plus du service de l'invention.CORBA (at API level), which will allow the possible use of the reliable multicast service of the future standard ROMIOP in addition to the service of the invention.
L'invention offre en outre une architecture ouverte, c'est-à-dire donnant le moyen aux utilisateurs d'ajouter facilement d'autres types de qualité de service et d'ordonnancement des requêtes CORBA. L'utilisation du langage CORBA standard assure une meilleure interopérabilité entre applications différentes et l'utilisation de méta-modèles (« templates » XSLT) au niveau du générateur de code garantit l'évolutivité du service par le support de différents langages de programmation pour manipuler les objets distribués (C++, Java, Ada...).The invention further provides an open architecture, i.e., providing the means for users to easily add other types of quality of service and scheduling of CORBA requests. The use of the standard CORBA language ensures better interoperability between different applications and the use of XSLT templates in the code generator ensures scalability of the service by supporting different programming languages to manipulate distributed objects (C ++, Java, Ada ...).
ANNEXESNOTES
ANNEXE 1 #ifndef_BasicFooManager_idl_ #define _BasicFooManager_idl_APPENDIX 1 #ifndef_BasicFooManager_idl_ #define _BasicFooManager_idl_
#include "ValuetypeBlock.idl" module Test#include "ValuetypeBlock.idl" Test module
{ interface FooManager{FooManager interface
{ oneway void set_Foo_name(in string name);{oneway void set_Foo_name (in string name);
// create source Foo oneway void create source Foo (in Block: : SourceBlock theSourceBlock, in Block: :IdentityBlock theldentityBlock, in Block: :KinematicBlock theKinematicBlock);// create source Foo oneway void create source Foo (in Block:: SourceBlock theSourceBlock, in Block :: IdentityBlock theldentityBlock, in Block:: KinematicBlock theKinematicBlock);
// update source Foo kinematic block oneway void update source Foo kinematic// update source Foo kinematic oneway block void update source Foo kinematic
(in Block:: SourceBlock theSourceBlock, in Block: :KinematicBlock theKinematicBlock);
// update a Foo(in Block :: SourceBlock theSourceBlock, in Block :: KinematicBlock theKinematicBlock); // update to Foo
// the Foo is identified by the source block embedded in the séquence of blocks // the other blocks contains the updated data oneway void update Foo// the Foo is identified by the source block embedded in the sequence of blocks // the other blocs
(in Block: :Blocks theBlocks);(in Block:: Blocks theBlocks);
// drop source Foo oneway void drop source Foo (in Block: : SourceBlock theSourceBlock);// drop source Foo oneway void source drop Foo (in Block:: SourceBlock theSourceBlock);
// drop a list of source Foos oneway void drop source Foos// drop a list of source Foos oneway void drop source Foos
(in Block: :SourceBlocks theSourceBlocks);(in Block:: SourceBlocks theSourceBlocks);
}; };}; };
#endif#endif
ANNEXE 2ANNEX 2
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ETNACC SYSTEM "EtnaCC.dtd"><? xml version = "1.0" encoding = "UTF-8"?> <! DOCTYPE ETNACC SYSTEM "EtnaCC.dtd">
<ETNACC> <MULTICAST_SERVICE><ETNACC> <MULTICAST_SERVICE>
<MS_TARGET_MODULE> <MODULE_NAME>Test</MODULE_NAME><MS_TARGET_MODULE> <MODULE_NAME> Test </ MODULE_NAME>
<IDL_FILENAME>../idl/BasicFooManager.idK/IDL_FILENAME> <MS_TARGET_INTERFACE><IDL_FILENAME> ../ idl / BasicFooManager.idK / IDL_FILENAME> <MS_TARGET_INTERFACE>
<INTERFACE idl-interface="FooManager" idl- filename="BasicFooManager.idl"/> <MS QOS reliability="reliable" ordering="temporal7><Idl-interface INTERFACE = "FooManager" idl- filename = "BasicFooManager.idl" /> <MS QOS reliability = "reliable" ordering = "temporal7>
</MS_TARGET_INTERFACE> </MS_TARGET_MODULE> </MULTICAST_SERVICE> </ETNACC></ MS_TARGET_INTERFACE> </ MS_TARGET_MODULE> </ MULTICAST_SERVICE> </ ETNACC>
ANNEXE 3ANNEX 3
/* = FooManagerBehavior.idl
= This file has been generated by COBRA (COrba Based Real-time Architecture) Code Generator 1.0/ * = FooManagerBehavior.idl = This file has been generated by COBRA (Code based Real-time Architecture) Code Generator 1.0
= for the fault tolérance and multicast service(s) = on Fri May 07 16:37:01 CEST 2004 = DO NOT EDIT !!! ^=^^= = - =*/= tolerance and multicast service (s) = on Fri May 07 16:37:01 CEST 2004 = DO NOT EDIT !!! ^ = ^^ = = - = * /
#ifhdef _FooManagerBehavior_idl_ #define _FooManagerBehavior_idl_#ifhdef _FooManagerBehavior_idl_ #define _FooManagerBehavior_idl_
#include "BasicFooManager.idl" local interface FooManagerBehavior : Test::FooManager {};#include "BasicFooManager.idl" local interface FooManagerBehavior: Test :: FooManager {};
#endif //_FooManagerBehavior_idl_#endif // _ FooManagerBehavior_idl_
ANNEXE 4ANNEX 4
= FooManager ROTemporalMulticast. idl= FooManager ROTemporalMulticast. idl
= This file has been generated by COBRA (COrba Based Real-time Architecture) Code Generator 1.0 = for the fault tolérance and multicast service(s) = on Fri May 07 16:37:01 CEST 2004 = DO NOT EDIT !!! ^=^^= = — - =*/ #ifndef _FooManager_ROTemporalMulticast_idl_ #deτïne _FooManager_ROTemporalMulticast_idl_= Code Generator 1.0 = for the fault tolerance and multicast service (s) = on Fri May 07 16:37:01 CEST 2004 = DO NOT EDIT !!! ^ = ^^ = = - - = * / #ifndef _FooManager_ROTemporalMulticast_idl_ # dezine _FooManager_ROTemporalMulticast_idl_
// To add multicast types #include <Multicast.idl>// To add multicast types #include <Multicast.idl>
#include "BasicFooManager.idl" interface FooManager ROTemporalMulticast { // Opérations like :#include "BasicFooManager.idl" FooManager interface ROTemporalMulticast {// Operations like:
// oneway void Op(QoS, args); oneway void set_Foo_name( in Multicast: :SenderIdentifier sender, in Multicast: :QueueOrder order, in string name);
oneway void create_source_Foo( in Multicast::SenderIdentifier sender, in Multicast::QueueOrder order, in Block::SourceBlock theSourceBlock, in Block::IdentityBlock theldentityBlock, in Block::KinematicBlock theKinematicBlock); oneway void update_source_Foo_kinematic( in Multicast::SenderIdentifier sender, in Multicast: :QueueOrder order, in Block::SourceBlock theSourceBlock, in Block::KinematicBlock theKinematicBlock); oneway void update_Foo( in Multicast: : Senderldentifier sender, in Multicast: :QueueOrder order, in Block::Blocks theBlocks); oneway void drop_source_Foo( in Multicast: : Senderldentifier sender, in Multicast: :QueueOrder order, in Block::SourceBlock theSourceBlock); oneway void drop_source_Foos( in Multicast: : Senderldentifier sender, in Multicast: :QueueOrder order, in Block::SourceBlocks theSourceBlocks);// oneway void Op (QoS, args); oneway void set_Foo_name (in Multicast:: SenderIdentifier sender, in Multicast:: QueueOrder order, in string name); oneway void create_source_Foo (in Multicast :: SenderIdentifier sender, in Multicast :: QueueOrder order, in Block :: SourceBlock theSourceBlock, in Block :: IdentityBlock theldentityBlock, in Block :: KinematicBlock theKinematicBlock); oneway void update_source_Foo_kinematic (in Multicast :: SenderIdentifier sender, in Multicast :: QueueOrder order, in Block :: SourceBlock theSourceBlock, in Block :: KinematicBlock theKinematicBlock); oneway void update_Foo (in Multicast:: Senderldentifier sender, in Multicast:: QueueOrder order, in Block :: Blocks theBlocks); oneway void drop_source_Foo (in Multicast:: Senderldentifier sender, in Multicast:: QueueOrder order, in Block :: SourceBlock theSourceBlock); oneway void drop_source_Foos (in Multicast:: Senderldentifier sender, in Multicast:: QueueOrder order, in Block :: SourceBlocks theSourceBlocks);
// Attributes like :// Attributes like:
// oneway void set_attr(QoS, value); // No attribute accessor hère// oneway void set_attr (QoS, value); // No attribute accessor hère
};};
#endif//_FooManager_ROTemporalMulticast_idl#endif // _ FooManager_ROTemporalMulticast_idl
Annexe 5Annex 5
/*=/ * =
= FooManager_ROTemporalMulticast_impl.cpp= FooManager_ROTemporalMulticast_impl.cpp
= This file has been generated by COBRA (COrba Based Real-time Architecture) Code Generator 1.0 = for the fault tolérance and multicast service(s) = on Fri May 07 16:37:01 CEST 2004
= DO NOT EDIT!!!COGRA (COrba Based Real-Time Architecture) Code Generator 1.0 = for the fault tolerance and multicast service (s) = on Fri May 07 16:37:01 CEST 2004 = DO NOT EDIT !!!
=*/= * /
#include "FooManager ROTemporalMulticast impl.hpp"#include "FooManager ROTemporalMulticast impl.hpp"
FooManager ROTemporalMulticast impl-FooManager ROTemporalMulticast imFooManager ROTemporalMulticast impl-FooManager ROTemporalMulticast im
PK): m strategy(O)PK ) : m strategy (O)
{}{}
FooManager ROTemporalMulticast implx-FooManager ROTemporalMulticast i mpl() { if (m strategy) { delete m strategy; m strategy = O; };FooManager ROTemporalMulticast implx-FooManager ROTemporalMulticast i mpl () {if (m strategy) {delete m strategy; m strategy = O; };
} voidFooManager_ROTemporalMulticast_impl::init(FooManagerBehavior_ptr local ref, const Multicast::Reliability& reliability, const Multicast::Ordering& ordering, const Multicast::QueueSize& queue size, const Multicast::Timeout& timeout, const Multicast: :Retries& retries, const Multicast: :FaultReportFile& file, const Multicast: :NumberOfSenders& number of senders, const Multicast: :Retransmission& retransmission, const Multicast: :RetransmissionMode& retransmission mode, const Multicast: :InetAddress& retransmission inetaddress, const Multicast: :FirstRequestMode& fîrst request mode, const Multicast: :InetAddress& inet address, CORBA: :ORB_ptr orb)} voidFooManager_ROTemporalMulticast_impl :: init (Local FooManagerBehavior_ptr ref, const Multicast :: Reliability & Reliability, const Multicast :: Ordering & ordering, const Multicast :: QueueSize & tail size, const Multicast :: Timeout & timeout, const Multicast:: Retries & retries, const Multicast :: FaultReportFile & file, const Multicast :: NumberOfSenders & number of senders, const Multicast :: Retransmission & retransmission, const Multicast:: RetransmissionMode & retransmission mode, const Multicast :: InetAddress & retransmission inetaddress, const Multicast :: FirstRequestMode & fîrst request mode, const Multicast:: InetAddress & inet address, CORBA:: ORB_ptr orb)
{ m local ref = FooManagerBehavior::_duplicate(local_ref); m reliability = reliability; m ordering = ordering; m number of senders = number of senders; m timeout = timeout; m retries = retries; m file = file;
m retransmission = retransmission; m retransmission mode = retransmission mode; m retransmission inetaddress = retransmission inetaddress; m first request mode = first request mode; m inet address = inet address; m orb = CORBA: :ORB::_duρlicate(orb); m_strategy = new Multicast::StrategyManager; m_strategy->init(reliability, ordering, queue size, timeout, retries, retransmission, retransmission mode, retransmission inetaddress, first request mode, inet address, file, orb); for(int i=0;i<number_of_senders;i-H-) { m_strategy->add_strategy(newMulticast::OrderTemporalReceiverStrategy());{m local ref = FooManagerBehavior :: _ duplicate (local_ref); m reliability = reliability; m ordering = ordering; m number of senders = number of senders; m timeout = timeout; m retries = retries; m file = file; m retransmission = retransmission; m retransmission mode = retransmission mode; m retransmission inetaddress = inetaddress retransmission; m first request mode = first request mode; m inet address = inet address; m orb = CORBA :: ORB :: _ duplicate (orb); m_strategy = new Multicast :: StrategyManager; m_strategy-> init (reliability, ordering, queue size, timeout, retries, retransmission, mode retransmission, inetaddress retransmission, first request mode, inet address, file, orb); for (int i = 0; i <number_of_senders; iH-) {m_strategy-> add_strategy (newMulticast :: OrderTemporalReceiverStrategy ());
}}
#ifdef MSDEBUGl std::cout « m_strategy->print() « std::endl; #endif }#ifdef MSDEBUGl std :: cost "m_strategy-> print ()" std :: endl; #endif}
// Opérations like// Operations like
// virtual void FooManager ROTemporal: :op(args) throw (CORBA: :SystemException) {...}; ll^= = —// virtual void FooManager ROTemporal :: op (args) throw (CORBA:: SystemException) {...}; ll ^ = = -
// FooManager ROTemporalMulticast impl : : set_Foo_name()// FooManager ROTemporalMulticast impl:: set_Foo_name ()
//— = — — = — void FooManager ROTemporalMulticast impl: :set_Foo_name( const char* sender,// - = - - = - void FooManager ROTemporalMulticast impl:: set_Foo_name (const char * sender,
Multicast::QueueOrder order, const char* name) throw (CORBA: :SystemException) {Multicast :: QueueOrder order, char const * name) throw (CORBA:: SystemException) {
#ifdefMSDEBUG2 std::cout « "exécute set Foo name <sender=" « sender « "," « " order=" « order « ">"« std::endl;# ifdefMSDEBUG2 std :: cost "" executes set Foo name <sender = "" sender "" "" "order =" "order" ">" "std :: endl;
#endif#endif
Multicast::OrderTemporalReceiverStrategy* strategy =Multicast :: OrderTemporalReceiverStrategy * strategy =
(Multicast::OrderTemporalReceiverStrategy*) m_strategy->get_strategy(sender); if (strategy != (Multicast::OrderTemporalReceiverStrategy*) NULL) {
Multicast::OrderedQueue* queue = strategy->getQueue(); Multicast::MutexType& mutex = queue->getMutex(); bool try execute = false; bool out of range = false;(Multicast :: OrderTemporalReceiverStrategy *) m_strategy-> get_strategy (sender); if (strategy! = (Multicast :: OrderTemporalReceiverStrategy *) NULL) { Multicast :: OrderedQueue * queue = strategy-> getQueue (); Multicast :: MutexType & mutex = queue-> getMutex (); bool try execute = false; bool out of range = false;
{ CDMW_MUTEX_GUARD(mutex);{CDMW_MUTEX_GUARD (mutex);
Multicast::QueueOrderElementHeader* elementHeader = queue- >try_append(order) ; if (((elementHeader != (Multicast: :QueueOrderElementHeader*) NULL) ScScMulticast :: QueueOrderElementHeader * elementHeader = queue-> try_append (order); if (((elementHeader! = (Multicast:: QueueOrderElementHeader *) NULL) ScSc
(elementHeader != (Multicast: :QueueOrderElementHeader*) 0)))(elementHeader! = (Multicast :: QueueOrderElementHeader *) 0)))
{{
Multicast: :QueueOrderElement* élément = new FooManager_set_Foo_name_ROTemporalMulticastArgs( m_local_ref.in(), name); element->element_id = "Test::FooManager::set_Foo_name"; element->sender = CORBA: :string_dup(sender); element->order = order; elementHeader->element = élément; queue->appended(elementHeader);Multicast :: QueueOrderElement * element = new FooManager_set_Foo_name_ROTemporalMulticastArgs (m_local_ref.in (), name); element-> element_id = "Test :: FooManager :: set_Foo_name"; element-> sender = CORBA :: string_dup (sender); element-> order = order; elementHeader-> element = element; tail-> Appended (elementHeader);
try execute = true;try execute = true;
} else if (elementHeader = (Multicast: :QueueOrderElementHeader*) 0)} else if (elementHeader = (Multicast:: QueueOrderElementHeader *) 0)
{ out of range = true;{out of range = true;
}}
} if (try execute) strategy->try_execute(order) ; else if (out of range) strategy->out_of_range(); }} if (try execute) strategy-> try_execute (order); else if (out of range) strategy-> out_of_range (); }
}
//— = = —} // - = = -
// FooManager ROTemporalMulticast impl : : create_source_Foo()// FooManager ROTemporalMulticast impl:: create_source_Foo ()
// = — void FooManager_ROTemporalMulticast_impl::create_source_Foo( const char* sender, Multicast::QueueOrder order, Block: : SourceBlock* theSourceBlock, Block: :IdentityBlock* theldentityBlock, Block: :KinematicBlock* theKinematicBlock) throw (CORBA: :SystemException)// = - void FooManager_ROTemporalMulticast_impl :: create_source_Foo (const char * sender, Multicast :: QueueOrder order, Block :: SourceBlock * theSourceBlock, Block :: IdentityBlock * theldentityBlock, Block :: KinematicBlock * theKinematicBlock) throw (CORBA:: SystemException)
{ #ifdef MSDEBUG2 std::cout « "exécute create source Foo <sender=" « sender « "," « " order=" « order « ">"« std::endl; #endif{#ifdef MSDEBUG2 std :: cost "" execute create source Foo <sender = "" sender "" "" "order =" "order" ">" "std :: endl; #endif
Multicast::OrderTemporalReceiverStrategy* strategy = (Multicast: :OrderTemporalReceiverStrategy*) m_strategy->get_strategy(sender); if (strategy != (Multicast: :OrderTemporalReceiverStrategy*) NULL) { Multicast: :OrderedQueue* queue = strategy->getQueue();Multicast :: OrderTemporalReceiverStrategy * strategy = (Multicast:: OrderTemporalReceiverStrategy *) m_strategy-> get_strategy (sender); if (strategy! = (Multicast :: OrderTemporalReceiverStrategy *) NULL) {Multicast :: OrderedQueue * queue = strategy-> getQueue ();
Multicast: :MutexType& mutex = queue->getMutex(); bool try execute = false; bool out of range = false;Multicast :: MutexType & mutex = queue-> getMutex (); bool try execute = false; bool out of range = false;
{{
CDMW_MUTEX_GUARD(mutex);CDMW_MUTEX_GUARD (mutex);
Multicast: :QueueOrderElementHeader* elementHeader = queue- >try_append(order) ; if (((elementHeader != (Multicast: :QueueOrderElementHeader*) NULL) && (elementHeader != (Multicast: :QueueOrderElementHeader*) 0)))Multicast :: QueueOrderElementHeader * elementHeader = queue-> try_append (order); if (((elementHeader! = (Multicast:: QueueOrderElementHeader *) NULL) && (elementHeader! = (Multicast:: QueueOrderElementHeader *) 0)))
{{
Multicast: :QueueOrderElement* élément = new FooManager_create_source_Foo_ROTemporalMulticastArgs( m_local_ref.in(), theSourceBlock, theldentityBlock, theKinematicBlock); element->element_id = "Test::FooManager::create_source_Foo";
element->sender = CORBA: :string_dup(sender); element->order = order; elementHeader->element = élément; queue->appended(elementHeader);Multicast :: QueueOrderElement * element = new FooManager_create_source_Foo_ROTemporalMulticastArgs (m_local_ref.in (), theSourceBlock, theldentityBlock, theKinematicBlock); element-> element_id = "Test :: FooManager :: create_source_Foo"; element-> sender = CORBA :: string_dup (sender); element-> order = order; elementHeader-> element = element; tail-> Appended (elementHeader);
try execute = true;try execute = true;
} else if (elementHeader = (Multicast::QueueOrderElementHeader*) 0)} else if (elementHeader = (Multicast :: QueueOrderElementHeader *) 0)
{ out of range = true; }{out of range = true; }
} if (try execute) strategy->try_execute(order); else if (out of range) strategy->out_of_range();} if (try execute) strategy-> try_execute (order); else if (out of range) strategy-> out_of_range ();
} }}}
//— = = —// - = = -
// FooManager ROTemporalMulticast implxupdate source Foo kinematicO// FooManager ROTemporalMulticast implxupdate source Foo kinematicO
// ^=; = — void FooManager ROTemporalMulticast impl: :update_source_Foo_kinematic( const char* sender, Multicast::QueueOrder order, Block: : SourceBlock* theSourceBlock, Block: :KinematicBlock* theKinematicBlock) throw (CORBA::SystemException)// ^ = ; = - void FooManager ROTemporalMulticast impl:: update_source_Foo_kinematic (const char * sender, Multicast :: QueueOrder order, Block :: SourceBlock * theSourceBlock, Block :: KinematicBlock * theKinematicBlock) throw (CORBA :: SystemException)
{ #ifdef MSDEBUG2 std::cout « "exécute update source Foo kinematic <sender=" « sender « "," « " order=" « order « ">"« std: :endl; #endif{#ifdef MSDEBUG2 std :: cost "" executes update source Foo kinematic <sender = "" sender "" "" "order =" "order" ">" "std:: endl; #endif
Multicast::OrderTemporalReceiverStrategy* strategy =Multicast :: OrderTemporalReceiverStrategy * strategy =
(Multicast::OrderTemporalReceiverStrategy*) m_strategy->get_strategy(sender); if (strategy != (Multicast::OrderTemporalReceiverStrategy*) NULL)
{(Multicast :: OrderTemporalReceiverStrategy *) m_strategy-> get_strategy (sender); if (strategy! = (Multicast :: OrderTemporalReceiverStrategy *) NULL) {
Multicast::OrderedQueue* queue = strategy->getQueue(); Multicast::MutexType& mutex = queue->getMutex(); bool try execute = false; bool out of range = false; {Multicast :: OrderedQueue * queue = strategy-> getQueue (); Multicast :: MutexType & mutex = queue-> getMutex (); bool try execute = false; bool out of range = false; {
CDMW_MUTEX_GUARD(mutex);CDMW_MUTEX_GUARD (mutex);
Multicast::QueueOrderElementHeader* elementHeader = queue- >try_append(order) ; if (((elementHeader != (Multicast::QueueOrderElementHeader*) NULL) && (elementHeader != (Multicast::QueueOrderElementHeader*) 0)))Multicast :: QueueOrderElementHeader * elementHeader = queue-> try_append (order); if (((elementHeader! = (Multicast :: QueueOrderElementHeader *) NULL) && (elementHeader! = (Multicast :: QueueOrderElementHeader *) 0)))
{ Multicast::QueueOrderElement* élément = new{Multicast :: QueueOrderElement * element = new
FooManager_update_source_Foo_kinematic_ROTemporalMulticastArgs( m_local_ref.in(), theSourceBlock, theKinematicBlock); element->element_id = "Test: :FooManager: :update_source_Foo_kinematic"; element->sender = CORBA: :string_dup(sender); element->order = order; elementHeader->element = élément; queue->appended(elementHeader);FooManager_update_source_Foo_kinematic_ROTemporalMulticastArgs (m_local_ref.in (), theSourceBlock, theKinematicBlock); element-> element_id = "Test :: FooManager :: update_source_Foo_kinematic"; element-> sender = CORBA :: string_dup (sender); element-> order = order; elementHeader-> element = element; tail-> Appended (elementHeader);
try execute = true; } else if (elementHeader = (Multicast::QueueOrderElementHeader*) 0)try execute = true; } else if (elementHeader = (Multicast :: QueueOrderElementHeader *) 0)
{ out of range = true;{out of range = true;
}}
} if (try execute) strategy->try_execute(order) ; else if (out of range) strategy->out_of_range();
}} if (try execute) strategy-> try_execute (order); else if (out of range) strategy-> out_of_range (); }
} //— = ^^= ^^= ^^=} // - = ^^ = ^^ = ^^ =
// FooManager ROTemporalMulticast impl: :update_Foo()// FooManager ROTemporalMulticast impl:: update_Foo ()
11^=^—^—^—^—= - = void FooManager ROTemporalMulticast impl: :update_Foo( const char* sender, Multicast: :QueueOrder order, const Block::Blocks& theBlocks) throw (CORBA: :SystemException)11 ^ = ^ - ^ - ^ - ^ - = - = void FooManager ROTemporalMulticast impl:: update_Foo (const char * sender, Multicast :: QueueOrder order, const Block :: Blocks & theBlocks) throw (CORBA:: SystemException)
{ #ifdef MSDEBUG2 std::cout « "exécute update Foo <sender=" « sender « "," « " order=" « order « ">"« std::endl; #endif Multicast: : OrderTemporalReceiverStrategy* strategy ={#ifdef MSDEBUG2 std :: cost "" execute update Foo <sender = "" sender "" "" "order =" "order" ">" "std :: endl; #endif Multicast :: OrderTemporalReceiverStrategy * strategy =
(Multicast: :OrderTemporalReceiverStrategy*) m_strategy->get_strategy(sender); if (strategy != (Multicast: :OrderTemporalReceiverStrategy*) NULL)(Multicast :: OrderTemporalReceiverStrategy *) m_strategy-> get_strategy (sender); if (strategy! = (Multicast:: OrderTemporalReceiverStrategy *) NULL)
{{
Multicast: :OrderedQueue* queue = strategy->getQueue();Multicast :: OrderedQueue * queue = strategy-> getQueue ();
Multicast: :MutexType& mutex = queue->getMutex(); bool try execute = false; bool out of range = false;Multicast :: MutexType & mutex = queue-> getMutex (); bool try execute = false; bool out of range = false;
{ CDMW_MUTEX_GUARD(mutex);{CDMW_MUTEX_GUARD (mutex);
Multicast: :QueueOrderElementHeader* elementHeader = queue- >try_append(order) ; if (((elementHeader != (Multicast: :QueueOrderElementHeader*) NULL) ScScMulticast :: QueueOrderElementHeader * elementHeader = queue-> try_append (order); if (((elementHeader! = (Multicast:: QueueOrderElementHeader *) NULL) ScSc
(elementHeader != (Multicast: :QueueOrderElementHeader*) 0)))(elementHeader! = (Multicast :: QueueOrderElementHeader *) 0)))
{{
Multicast: :QueueOrderElement* élément = new FooManager_update_Foo_ROTemporalMulticastArgs( m_local_ref.in(), theBlocks); element->element_id = "Test::FooManager::update_Foo";
element->sender = CORBA: :string_dup(sender); element->order = order; elementHeader->element = élément; queue->appended(elementHeader);Multicast :: QueueOrderElement * element = new FooManager_update_Foo_ROTemporalMulticastArgs (m_local_ref.in (), theBlocks); element-> element_id = "Test :: FooManager :: update_Foo"; element-> sender = CORBA :: string_dup (sender); element-> order = order; elementHeader-> element = element; tail-> Appended (elementHeader);
try execute = true;try execute = true;
} else if (elementHeader = (Multicast::QueueOrderElementHeader*) 0)} else if (elementHeader = (Multicast :: QueueOrderElementHeader *) 0)
{ out of range = true; }{out of range = true; }
} if (try execute) strategy->try_execute(order); else if (out of range) strategy->out_of_range();} if (try execute) strategy-> try_execute (order); else if (out of range) strategy-> out_of_range ();
} }}}
//— = = —// - = = -
// FooManager ROTemporalMulticast impl : : drop_source_Foo()// FooManager ROTemporalMulticast impl:: drop_source_Foo ()
// ^=; = — void FooManager_ROTemporalMulticast_impl::drop_source_Foo( const char* sender, Multicast::QueueOrder order, Block: : SourceBlock* theSourceBlock) throw (CORBA: :SystemException)// ^ = ; = - void FooManager_ROTemporalMulticast_impl :: drop_source_Foo (const char * sender, Multicast :: QueueOrder order, Block :: SourceBlock * theSourceBlock) throw (CORBA:: SystemException)
{ #ifdef MSDEBUG2 std::cout « "exécute drop source Foo <sender=" « sender « "," « " order=" « order « ">"« std::endl; #endif{#ifdef MSDEBUG2 std :: cost "" executes drop source Foo <sender = "" sender "" "" "order =" "order" ">" "std :: endl; #endif
Multicast::OrderTemporalReceiverStrategy* strategy = (Multicast::OrderTemporalReceiverStrategy*) m_strategy->get_strategy(sender); if (strategy != (Multicast::OrderTemporalReceiverStrategy*) NULL) {
Multicast::OrderedQueue* queue = strategy->getQueue();Multicast :: OrderTemporalReceiverStrategy * strategy = (Multicast :: OrderTemporalReceiverStrategy *) m_strategy-> get_strategy (sender); if (strategy! = (Multicast :: OrderTemporalReceiverStrategy *) NULL) { Multicast :: OrderedQueue * queue = strategy-> getQueue ();
Multicast::MutexType& mutex = queue->getMutex(); bool try execute = false; bool out of range = false;Multicast :: MutexType & mutex = queue-> getMutex (); bool try execute = false; bool out of range = false;
{{
CDMW_MUTEX_GUARD(mutex);CDMW_MUTEX_GUARD (mutex);
Multicast::QueueOrderElementHeader* elementHeader = queue- >try_append(order) ; if (((elementHeader != (Multicast::QueueOrderElementHeader*) NULL) ScSc (elementHeader != (Multicast::QueueOrderElementHeader*) 0)))Multicast :: QueueOrderElementHeader * elementHeader = queue-> try_append (order); if (((elementHeader! = (Multicast :: QueueOrderElementHeader *) NULL) ScSc (elementHeader! = (Multicast :: QueueOrderElementHeader *) 0)))
{{
Multicast::QueueOrderElement* élément = new FooManager_drop_source_Foo_ROTemporalMulticastArgs( m_local_ref.in(), theSourceBlock); element->element_id = "Test::FooManager::drop_source_Foo"; element->sender = CORBA: :string_dup(sender); element->order = order; elementHeader->element = élément; queue->appended(elementHeader);Multicast :: QueueOrderElement * element = new FooManager_drop_source_Foo_ROTemporalMulticastArgs (m_local_ref.in (), theSourceBlock); element-> element_id = "Test :: FooManager :: drop_source_Foo"; element-> sender = CORBA :: string_dup (sender); element-> order = order; elementHeader-> element = element; tail-> Appended (elementHeader);
try execute = true;try execute = true;
} else if (elementHeader = (Multicast::QueueOrderElementHeader*) 0) { out of range = true;} else if (elementHeader = (Multicast :: QueueOrderElementHeader *) 0) {out of range = true;
}}
} if (try execute) strategy->try_execute(order) ; else if (out of range) strategy->out_of_range();} if (try execute) strategy-> try_execute (order); else if (out of range) strategy-> out_of_range ();
}
// = —} // = -
// FooManager ROTemporalMulticast impl: :drop_source_Foos() //_ = ^^= ^=^ -^-= void FooManager ROTemporalMulticast impl: :drop_source_Foos( const char* sender, Multicast::QueueOrder order, const Block::SourceBlocks& theSourceBlocks) throw (CORBA: : SystemException)// FooManager ROTemporalMulticast impl:: drop_source_Foos () // _ = ^^ = ^ = ^ - ^ - = void FooManager ROTemporalMulticast impl:: drop_source_Foos (const char * sender, Multicast :: QueueOrder order, const Block :: SourceBlocks & theSourceBlocks) throw (CORBA:: SystemException)
{ #ifdef MSDEBUG2 std::cout « "exécute drop source Foos <sender=" « sender « "," « " order=" « order « ">"« std: :endl; #endif{#ifdef MSDEBUG2 std :: cost "" executes drop source Foos <sender = "" sender "" "" "order =" "order" ">" "std:: endl; #endif
Multicast::OrderTemporalReceiverStrategy* strategy =Multicast :: OrderTemporalReceiverStrategy * strategy =
(Multicast::OrderTemporalReceiverStrategy*) m_strategy->get_strategy(sender); if (strategy != (Multicast::OrderTemporalReceiverStrategy*) NULL)(Multicast :: OrderTemporalReceiverStrategy *) m_strategy-> get_strategy (sender); if (strategy! = (Multicast :: OrderTemporalReceiverStrategy *) NULL)
{{
Multicast::OrderedQueue* queue = strategy->getQueue();Multicast :: OrderedQueue * queue = strategy-> getQueue ();
Multicast::MutexType& mutex = queue->getMutex(); bool try execute = false; bool out of range = false;Multicast :: MutexType & mutex = queue-> getMutex (); bool try execute = false; bool out of range = false;
{{
CDMW_MUTEX_GUARD(mutex); Multicast::QueueOrderElementHeader* elementHeader = queue-CDMW_MUTEX_GUARD (mutex); Multicast :: QueueOrderElementHeader * elementHeader = queue-
>try_append(order) ; if (((elementHeader != (Multicast::QueueOrderElementHeader*) NULL) && (elementHeader != (Multicast::QueueOrderElementHeader*) 0))) {> try_append (order); if (((elementHeader! = (Multicast :: QueueOrderElementHeader *) NULL) && (elementHeader! = (Multicast :: QueueOrderElementHeader *) 0))) {
Multicast::QueueOrderElement* élément = new FooManager_drop_source_Foos_ROTemporalMulticastArgs( m_local_ref.in(), theSourceBlocks); element->element_id = "Test::FooManager::drop_source_Foos"; element->sender = CORBA: :string_dup(sender);
element->order = order; elementHeader->element = élément; queue->appended(elementHeader);Multicast :: QueueOrderElement * element = new FooManager_drop_source_Foos_ROTemporalMulticastArgs (m_local_ref.in (), theSourceBlocks); element-> element_id = "Test :: FooManager :: drop_source_Foos";element-> sender = CORBA :: string_dup (sender); element-> order = order; elementHeader-> element = element; tail-> Appended (elementHeader);
try execute = true;try execute = true;
} else if (elementHeader = (Multicast: :QueueOrderElementHeader*) 0)} else if (elementHeader = (Multicast:: QueueOrderElementHeader *) 0)
{ out of range = true;{out of range = true;
} } if (try execute) strategy->try_execute(order) ; else if (out of range) strategy->out_of_range();}} if (try execute) strategy-> try_execute (order); else if (out of range) strategy-> out_of_range ();
} }}}
// Attributes like :// Attributes like:
// virtual void set_attr( value) throw (CORBA: : SystemException) ; // No attribute accessor hère// void virtual void set_attr (value) throw (CORBA:: SystemException); // No attribute accessor hère
ANNEXE 6 /*---=------=-ANNEX 6 / * --- = ------ = -
= FooManager_ROTemporalMulticastServerFactory.hpp = This file has been generated by COBRA (COrba Based Real-time Architecture) Code Generator 1.0= FooManager_ROTemporalMulticastServerFactory.hpp = This file has been generated by COBRA (Code based Real-time Architecture) Code Generator 1.0
= for the fault tolérance and multicast service(s) = on Fri May 07 16:37:01 CEST 2004 = DO NOT EDIT !!!
*/ #iihdef FooManager ROTemporalMulticastServerFactory hpp= tolerance and multicast service (s) = on Fri May 07 16:37:01 CEST 2004 = DO NOT EDIT !!! * / #iihdef FooManager ROTemporalMulticastServerFactory hpp
#defîne FooManager ROTemporalMulticastServerFactory hpp#file FooManager ROTemporalMulticastServerFactory hpp
#include <base/ORBSpecific.hpp> #include "FooManager ROTemporalMulticast impl.hpp" class FooManager ROTemporalMulticastServerFactory { public: FooManager ROTemporalMulticastServerFactoryO; ~FooManager_ROTemporalMulticastServerFactory(); inline void initServerSide(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, FooManagerBehavior_ptr user_impl_object) { m orb = CORBA: :ORB::_duρlicate(orb); if (!CORBA: :is_nil(poa)) m_poa = PortableServer::POA::_duplicate(poa); m user impl object = FooManagerBehavior: :_duplicate(user_impl_object);#include <base / ORBSpecific.hpp> #include "FooManager ROTemporalMulticast impl.hpp" class FooManager ROTemporalMulticastServerFactory {public: FooManager ROTemporalMulticastServerFactoryO; ~ FooManager_ROTemporalMulticastServerFactory (); inline void initServerSide (CORBA :: ORB_ptr orb, PortableServer :: POA_ptr poa, FooManagerBehavior_ptr user_impl_object) {m orb = CORBA :: ORB :: _ duρlicate (orb); if (! CORBA:: is_nil (poa)) m_poa = PortableServer :: POA :: _ duplicate (poa); m user impl object = FooManagerBehavior :: _duplicate (user_impl_object);
}; inline void setInetAddress(const Multicast::InetAddress& inetAddress) { m inetAddress = inetAddress; } ; inline void setTTL(const Multicast::TTL& ttl) { m ttl = ttl; } ; inline void setQueueSize(const Multicast::QueueSize& queue size) { m queue size = queue size; } ; inline void setNumberOfSenders(const Multicast::NumberOfSenders& number of senders) { m number of senders = number of senders; } ; inline void setReliability(const Multicast::Reliability& reliability) { m reliability = reliability; }; inline void setθrdering(const Multicast::Ordering& ordering) { m ordering = ordering; }; inline void setRetransmission(const Multicast::Retransmission& retransmission) { m retransmission = retransmission; } ; inline void setRetransmissionMode(const Multicast::RetransmissionMode& retransmission mode) { m retransmission mode = retransmission mode; } ; inline void setRetransmissionInetAddress(const Multicast::InetAddress& retransmission inetaddress) { m retransmission inetAddress = retransmission inetaddress; } ; inline void setFirstRequestMode(const Multicast::FirstRequestMode& first request mode) { m first request mode = first request mode; } ; inline void setRetries(const Multicast::Retries& retries) { m retries = retries; };
inline void setTimeout(const Multicast::Timeout& timeout) { m timeout = timeout;}; inline void setInetAddress (multicast const :: InetAddress & inetAddress) {m inetAddress = inetAddress; }; inline void setTTL (multicast const :: TTL & ttl) {m ttl = ttl; }; inline void setQueueSize (multicast const :: QueueSize & queue size) {m queue size = queue size; }; inline void setNumberOfSenders (multicast const :: NumberOfSenders & number of senders) {m number of senders = number of senders; }; inline void setReliability (const Multicast :: Reliability & Reliability) {m reliability = reliability; }; inline void setθrdering (Const Multicast :: Ordering & Ordering) {m ordering = ordering; }; inline void setRetransmission (const Multicast :: Retransmission & Retransmission) {m retransmission = retransmission; }; inline void setRetransmissionMode (const Multicast :: RetransmissionMode & retransmission mode) {m retransmission mode = retransmission mode; }; inline void setRetransmissionInetAddress (multicast const :: InetAddress & retransmission inetaddress) {m retransmission inetAddress = retransmission inetaddress; }; inline void setFirstRequestMode (multicast Const :: FirstRequestMode & first request mode) {first request mode = first request mode; }; inline void setRetries (const Multicast :: Retries & Retries) {m retries = retries; }; inline void setTimeout (multicast const :: Timeout & timeout) {m timeout = timeout;
}; inline void setFaultReportFile(const Multicast::FaultReportFile& file) { m file = file; }; inline void setThreadPoolSize(int thread_pool_size) { m_thread_pool_size = thread_pool_size; }; inline void setCorbaloc(const Multicast::Corbaloc& corbaloc) { m corbaloc = corbaloc; }; inline Multicast::InetAddress getInetAddress() { return m inetAddress; }; inline Multicast::TTL getTTL() { return m ttl; }; inline Multicast::QueueSize getQueueSize() { return m queue size; }; inline Multicast::NumberOfSenders getNumberOfSenders() { return m number of senders; }; inline Multicast::Reliability getReliability() { return m reliability; }; inline Multicast::Ordering getθrdering() { return m ordering; }; inline Multicast::Retransmission getRetransmission() { return m retransmission; }; inline Multicast::RetransmissionMode getRetransmissionMode() { return m retransmission mode; } ; inline Multicast: :InetAddress getRetransmissionInetAddress() { return m retransmission inet Address; } ; inline Multicast::FirstRequestMode getFirstRequestMode() { return m first request mode; } ; inline Multicast::Retries getRetries() { return m retries; }; inline Multicast:: Timeout getTimeout() { return m timeout; }; inline Multicast: :FaultReportFile getFaultReportFile() { return m file; }; inline Multicast: :ThreadPoolSize getThreadPoolSize() { return m_thread_pool_size; }; inline Multicast: :Corbaloc getCorbaloc() { return m corbaloc; }; inline Multicast:: TTL getDefaultTTL() { return DEFAULT TTL; }; inline Multicast: :QueueSize getDefaultQueueSize() { return DEFAULT QUEUE SIZE; }; inline Multicast: :NumberOfSenders getDefaultNumberOfSenders() { return DEFAULT NUMBER OF SENDERS; }; inline Multicast: :Reliability getDefaultReliability() { return DEFAULT RELIABILITY; }; inline Multicast: :Ordering getDefaultOrdering() { return DEFAULT ORDERING;}; inline void setFaultReportFile (multicast const :: FaultReportFile & file) {m file = file; }; inline void set ThreadPoolSize (int thread_pool_size) {m_thread_pool_size = thread_pool_size; }; inline void setCorbaloc (Multicast const :: Corbaloc & corbaloc) {m corbaloc = corbaloc; }; inline Multicast :: InetAddress getInetAddress () {return m inetAddress; }; inline Multicast :: TTL getTTL () {return mtt; }; inline Multicast :: QueueSize getQueueSize () {return m queue size; }; inline Multicast :: NumberOfSenders getNumberOfSenders () {return m number of senders; }; inline Multicast :: Reliability getReliability () {return m reliability; }; inline Multicast :: Ordering getθrdering () {return m ordering; }; inline Multicast :: Retransmission getRetransmission () {return m retransmission; }; inline Multicast :: RetransmissionMode getRetransmissionMode () {return m retransmission mode; }; inline Multicast :: InetAddress getRetransmissionInetAddress () {return m retransmission inet Address; }; inline Multicast :: FirstRequestMode getFirstRequestMode () {return m first request mode; }; inline Multicast :: Retries getRetries () {return m retries; }; inline Multicast :: Timeout getTimeout () {return m timeout; }; inline Multicast :: FaultReportFile getFaultReportFile () {return m file; }; inline Multicast :: ThreadPoolSize getThreadPoolSize () {return m_thread_pool_size; }; inline Multicast :: Corbaloc getCorbaloc () {return m corbaloc; }; inline Multicast :: TTL getDefaultTTL () {return DEFAULT TTL; }; inline Multicast :: QueueSize getDefaultQueueSize () {return DEFAULT QUEUE SIZE; }; inline Multicast :: NumberOfSenders getDefaultNumberOfSenders () {return DEFAULT NUMBER OF SENDERS; }; inline Multicast :: Reliability getDefaultReliability () {return DEFAULT RELIABILITY; }; inline Multicast :: Ordering getDefaultOrdering () {return DEFAULT ORDERING;
}; inline Multicast: :Retransmission getDefaultRetransmission() { return DEFAULT RETRANSMISSION; }; inline Multicast: :RetransmissionMode getDefaultRetransmissionMode() { return DEFAULT_RETRANSMISSION_MODE; }; inline Multicast: :InetAddress getDefaultRetransmissionInetAddress() { return ((getRetransmissionQ = Multicast: :MULTICAST_RETRANSMISSION) ?
DEFAULT_MIOP_RELIABLE_INETADDRESS : DEFAULT_IIOP_RELIABLE_INETADDRESS); } ; inline Multicast::FirstRequestMode getDefaultFirstRequestMode() { return DEFAULT FIRST REQUEST MODE; }; inline Multicast::Retries getDefaultRetries() { return DEFAULT LIMITED RETRIES; }; inline Multicast::Timeout getDefaultTimeout() { return DEFAULT RELATIVE REQUEST TIMEOUT; }; inline Multicast::FaultReportFile getDefaultFaultReportFile() { Multicast::FaultReportFile default file; deiàult_file.init(DEFAULT_FAULT_REPORT_FILE("FooManager_ROTemporalS erver")); return default file; }; inline Multicast::ThreadPoolSize getDefaultThreadPoolSize() { return DEFAULT THREAD POOL SIZE; };}; inline Multicast:: Retransmission getDefaultRetransmission () {return DEFAULT RETRANSMISSION; }; inline Multicast :: RetransmissionMode getDefaultRetransmissionMode () {return DEFAULT_RETRANSMISSION_MODE; }; inline Multicast :: InetAddress getDefaultRetransmissionInetAddress () {return ((getRetransmissionQ = Multicast:: MULTICAST_RETRANSMISSION)? DEFAULT_MIOP_RELIABLE_INETADDRESS: DEFAULT_IIOP_RELIABLE_INETADDRESS); }; inline Multicast :: FirstRequestMode getDefaultFirstRequestMode () {return DEFAULT FIRST REQUEST MODE; }; inline Multicast :: Retries getDefaultRetries () {return DEFAULT LIMITED RETRIES; }; inline Multicast :: Timeout getDefaultTimeout () {return DEFAULT RELATIVE REQUEST TIMEOUT; }; inline Multicast :: FaultReportFile getDefaultFaultReportFile () {Multicast :: FaultReportFile default file; deiàult_file.init (DEFAULT_FAULT_REPORT_FILE ("FooManager_ROTemporalS erver")); return default file; }; inline Multicast :: ThreadPoolSize getDefaultThreadPoolSize () {return DEFAULT THREAD POOL SIZE; };
Test: :FooManager_ptr create_object(); inline PortableServer::ServantBase* getServant() { return m remote impl; }; void activate_object_with_id(PortableServer::ServantBase* servant); voiddeactivate_object(PortableServer::ServantBase* servant); bool is_activated(PortableServer::ServantBase* servant); private:Test :: FooManager_ptr create_object (); inline PortableServer :: ServantBase * getServant () {return m remote impl; }; void activate_object_with_id (PortableServer :: ServantBase * serving); voiddeactivate_object (PortableServer :: ServantBase * serving); bool is_activated (PortableServer :: ServantBase * serving); private:
Multicast::InetAddress m inetAddress; Multicast::TTL m ttl;Multicast :: InetAddress m inetAddress; Multicast :: TTL m ttl;
Multicast::QueueSize m queue size;Multicast :: QueueSize m queue size;
Multicast: :NumberOfSenders m number of senders;Multicast :: NumberOfSenders m number of senders;
Multicast: :Reliability m reliability;Multicast:: Reliability m reliability;
Multicast: :Ordering m ordering; Multicast: :Retransmission m retransmission;Multicast:: Ordering m ordering; Multicast:: retransmission m retransmission;
Multicast: :RetransmissionMode m retransmission mode;Multicast:: RetransmissionMode m retransmission mode;
Multicast: :InetAddress m retransmission inetAddress;Multicast :: InetAddress m retransmission inetAddress;
Multicast: :FirstRequestMode m first request mode;Multicast :: FirstRequestMode m first request mode;
Multicast: :Retries m retries; Multicast: :Timeout m timeout;Multicast:: Retries m retries; Multicast:: Timeout m timeout;
Multicast: :FaultReportFile m file;Multicast:: FaultReportFile m file;
Multicast: :ThreadPoolSize m_thread_pool_size;Multicast :: ThreadPoolSize m_thread_pool_size;
Multicast: :Corbaloc m corbaloc; CORBA: :ORB_var m orb;Multicast:: Corbaloc m corbaloc; CORBA:: ORB_var m orb;
PortableServer::POA_var m_poa;PortableServer :: POA_var m_poa;
PortableServer::POA_var m_rt_poa;PortableServer :: POA_var m_rt_poa;
PortableServer: :ObjectId_var m oid;PortableServer :: ObjectId_var m oid;
CORBA: :Object_var m_object_group; FooManagerBehavior var m user impl object;CORBA:: Object_var m_object_group; FooManagerBehavior var m user impl object;
FooManager ROTemporalMulticast impl* m remote impl;
std: : string m corbalocAddress; std: :list<PortableServer: :ObjectId_var> m oid list; typedef std: :list<PortableServer: :ObjectId_var>: :iterator oid LI;FooManager ROTemporalMulticast impl * m remote impl; std:: string m corbalocAddress; std :: list <PortableServer :: ObjectId_var> m oid list; typedef std :: list <PortableServer :: ObjectId_var>:: iterator oid LI;
};};
#endif// FooManager ROTemporalMulticastServerFactory hpp# endif // FooManager ROTemporalMulticastServerFactory hpp
ANNEXE 7ANNEX 7
/*^=^=^=^=^=^=^=^= -= = FooManager ROTemporalMulticastClientFactory.hpp/ * ^ = ^ = ^ = ^ = ^ = ^ = ^ = ^ = - = = FooManager ROTemporalMulticastClientFactory.hpp
= This file has been generated by COBRA (COrba Based Real-time Architecture) Code Generator 1.0= This file has been generated by COBRA (Code based Real-time Architecture) Code Generator 1.0
= for the fault tolérance and multicast service(s) = on Fri May 07 16:37:01 CEST 2004 = DO NOT EDIT !!! ^=^^= = — - =*/= tolerance and multicast service (s) = on Fri May 07 16:37:01 CEST 2004 = DO NOT EDIT !!! ^ = ^^ = = - - = * /
#ifhdef FooManager ROTemporalMulticastClientFactory hpp #define FooManager ROTemporalMulticastClientFactory hpp#ifhdef FooManager ROTemporalMulticastClientFactory hpp #define FooManager ROTemporalMulticastClientFactory hpp
#include <base/ORBSpecific.hpp>#include <base / ORBSpecific.hpp>
#include "FooManager_ROTemporalMulticast_proxy_impl. hpp " class FooManager ROTemporalMulticastClientFactory#include "FooManager_ROTemporalMulticast_proxy_impl.hpp" class FooManager ROTemporalMulticastClientFactory
{ public: FooManager ROTemporalMulticastClientFactoryO; ~FooManager_ROTemporalMulticastClientFactory(); inline void initClientSide(CORBA::ORB_ptr orb) {m orb = CORBA: :ORB::_duρlicate(orb); }; inline void setInetAddress(const Multicast: :InetAddress& inetAddress) { m inetAddress = inetAddress; } ; inline void setTTL(const Multicast: :TTL& ttl) { m ttl = ttl; }; inline void setQueueSize(const Multicast: :QueueSize& queue size) { m queue size = queue size; } ;
inline void setReliability(const Multicast::Reliability& reliability) { m reliability = reliability; }; inline void setθrdering(const Multicast::Ordering& ordering) { m ordering = ordering; }; inline void setRetransmission(const Multicast::Retransmission& retransmission) { m retransmission = retransmission; } ; inline void setRetransmissionInetAddress(const Multicast::InetAddress& retransmission inetaddress) { m retransmission inetAddress = retransmission inetaddress; } ; inline void setRetries(const Multicast::Retries& retries) { m retries = retries; }; inline void setTimeout(const Multicast::Timeout& timeout) { m timeout = timeout;{public: FooManager ROTemporalMulticastClientFactoryO; ~ FooManager_ROTemporalMulticastClientFactory (); inline void initClientSide (CORBA :: ORB_ptr orb) {m orb = CORBA :: ORB :: _ duplicate (orb); }; inline void setInetAddress (multicast const: InetAddress & inetAddress) {m inetAddress = inetAddress; }; inline void setTTL (multicast constant:: TTL & ttl) {m ttl = ttl; }; inline void setQueueSize (const Multicast:: QueueSize & queue size) {m queue size = queue size; }; inline void setReliability (const Multicast :: Reliability & Reliability) {m reliability = reliability; }; inline void setθrdering (Const Multicast :: Ordering & Ordering) {m ordering = ordering; }; inline void setRetransmission (const Multicast :: Retransmission & Retransmission) {m retransmission = retransmission; }; inline void setRetransmissionInetAddress (multicast const :: InetAddress & retransmission inetaddress) {m retransmission inetAddress = retransmission inetaddress; }; inline void setRetries (const Multicast :: Retries & Retries) {m retries = retries; }; inline void setTimeout (multicast const :: Timeout & timeout) {m timeout = timeout;
}; inline void setRepetitionNumber(const Multicast::RepetitionNumber& repetition number) { m repetition number = repetition number; } ; inline void setRepetitionDelay(const Multicast: :RepetitionDelay& repetition delay) { m repetition delay = repetition delay; } ; inline void setFaultReportFile(const Multicast: :FaultReportFile& file) { m file = file; }; inline void setSenderIdentifier(const Multicast: :SenderIdentifier& sender) { m sender = CORBA: : string dup(sender); } ; inline void setCorbaloc(const Multicast: :Corbaloc& corbaloc) { m corbaloc = corbaloc; }; inline Multicast: :InetAddress getInetAddress() { return m inetAddress; }; inline Multicast: :TTL getTTL() { return m ttl; } ; inline Multicast: :QueueSize getQueueSize() { return m queue size; }; inline Multicast: :Reliability getReliability() { return m reliability; }; inline Multicast: :Ordering getθrdering() { return m ordering; }; inline Multicast: :Retransmission getRetransmission() { return m retransmission; }; inline Multicast: :InetAddress getRetransmissionInetAddress() { return m retransmission inet Address; } ; inline Multicast: :Retries getRetries() { return m retries; }; inline Multicast:: Timeout getTimeout() { return m timeout; }; inline Multicast: :RepetitionNumber getRepetitionNumber() { return m repetition number; }; inline Multicast: :RepetitionDelay getRepetitionDelay() { return m repetition delay; }; inline Multicast: :FaultReportFile getFaultReportFile() { return m file; }; inline Multicast: :SenderIdentifier getSenderIdentifier() { return m sender; }; inline Multicast: :Corbaloc getCorbaloc() { return m corbaloc; }; inline Multicast:: TTL getDefaultTTL() { return DEFAULT TTL; }; inline Multicast: :QueueSize getDefaultQueueSize() { return DEFAULT QUEUE SIZE; }; inline Multicast: :Reliability getDefaultReliability() { return DEFAULT RELIABILITY; };
inline Multicast::Ordering getDefaultOrdering() { return DEFAULT ORDERING;}; inline void setRepetitionNumber (const Multicast :: RepetitionNumber & repeatition number) {m repetition number = repetition number; }; inline void setRepetitionDelay (const Multicast:: RepetitionDelay & repetition delay) {m repetition delay = repetition delay; }; inline void setFaultReportFile (const Multicast:: FaultReportFile & file) {m file = file; }; inline void setSenderIdentifier (const Multicast :: SenderIdentifier & sender) {m sender = CORBA :: string dup (sender); }; inline void setCorbaloc (const Multicast:: Corbaloc & Corbaloc) {m corbaloc = corbaloc; }; inline Multicast :: InetAddress getInetAddress () {return m inetAddress; }; inline Multicast :: TTL getTTL () {return m ttl; }; inline Multicast :: QueueSize getQueueSize () {return m queue size; }; inline Multicast :: Reliability getReliability () {return m reliability; }; inline Multicast :: Ordering getθrdering () {return m ordering; }; inline Multicast :: Retransmission getRetransmission () {return m retransmission; }; inline Multicast :: InetAddress getRetransmissionInetAddress () {return m retransmission inet Address; }; inline Multicast :: Retries getRetries () {return m retries; }; inline Multicast :: Timeout getTimeout () {return m timeout; }; inline Multicast:: RepetitionNumber getRepetitionNumber () {return m repetition number; }; inline Multicast:: RepetitionDelay getRepetitionDelay () {return m repetition delay; }; inline Multicast :: FaultReportFile getFaultReportFile () {return m file; }; inline Multicast :: SenderIdentifier getSenderIdentifier () {return m sender; }; inline Multicast :: Corbaloc getCorbaloc () {return m corbaloc; }; inline Multicast :: TTL getDefaultTTL () {return DEFAULT TTL; }; inline Multicast :: QueueSize getDefaultQueueSize () {return DEFAULT QUEUE SIZE; }; inline Multicast :: Reliability getDefaultReliability () {return DEFAULT RELIABILITY; }; inline Multicast :: Ordering getDefaultOrdering () {return DEFAULT ORDERING;
}; inline Multicast::Retransmission getDefaultRetransmission() { return DEFAULT RETRANSMISSION; }; inline Multicast::InetAddress getDefaultRetransmissionInetAddress() { return ((getRetransmissionO = Multicast::MULTICAST_RETRANSMISSION) ? DEFAULT_MIOP_RELIABLE_INETADDRESS : DEFAULT_IIOP_RELIABLE_INETADDRESS); } ; inline Multicast::Retries getDefaultRetries() { return DEFAULT LIMITED RETRIES; }; inline Multicast::Timeout getDefaultTimeout() { return DEFAULT RELATIVE REQUEST TIMEOUT; }; inline Multicast::RepetitionNumber getDefaultRepetitionNumber() { return DEFAULT_REPETITION_NUMBER; }; inline Multicast::RepetitionDelay getDefaultRepetitionDelay() { return DEFAULT_REPETITION_DELAY; }; inline Multicast::FaultReportFile getDefaultFaultReportFile() { Multicast: :FaultReportFile default file; deiàult_file.init(DEFAULT_FAULT_REPORT_FILE("FooManager_ROTemporalC lient")); return default file; }; inline Multicast: :SenderIdentifier getDefaultSenderIdentifier() { INIT SENDER IDENTIFIER; return}; inline Multicast :: Retransmission getDefaultRetransmission () {return DEFAULT RETRANSMISSION; }; inline Multicast :: InetAddress getDefaultRetransmissionInetAddress () {return ((getRetransmissionO = Multicast :: MULTICAST_RETRANSMISSION)? DEFAULT_MIOP_RELIABLE_INETADDRESS: DEFAULT_IIOP_RELIABLE_INETADDRESS); }; inline Multicast :: Retries getDefaultRetries () {return DEFAULT LIMITED RETRIES; }; inline Multicast :: Timeout getDefaultTimeout () {return DEFAULT RELATIVE REQUEST TIMEOUT; }; inline Multicast :: RepetitionNumber getDefaultRepetitionNumber () {return DEFAULT_REPETITION_NUMBER; }; inline Multicast :: RepetitionDelay getDefaultRepetitionDelay () {return DEFAULT_REPETITION_DELAY; }; inline Multicast :: FaultReportFile getDefaultFaultReportFile () {Multicast :: FaultReportFile default file; deiàult_file.init (DEFAULT_FAULT_REPORT_FILE ("FooManager_ROTemporalC bind")); return default file; }; inline Multicast :: SenderIdentifier getDefaultSenderIdentifier () {INIT SENDER IDENTIFIER; return
DEFAULT_SENDER_IDENTIFIER(m_inetAddress,"Test::FooManager","FooMan ager ROTemporal"); };DEFAULT_SENDER_IDENTIFIER (m_inetAddress, "Test :: FooManager", "FooMan ager ROTemporal"); };
Test: :FooManager_ptr create_object(); private:Test :: FooManager_ptr create_object (); private:
Multicast: :InetAddress m inetAddress; Multicast: :TTL m ttl;Multicast :: InetAddress m inetAddress; Multicast :: TTL m ttl;
Multicast: :QueueSize m queue size;Multicast :: QueueSize m queue size;
Multicast: :Reliability m reliability;Multicast:: Reliability m reliability;
Multicast: :Ordering m ordering;Multicast:: Ordering m ordering;
Multicast: :Retransmission m retransmission; Multicast: :InetAddress m retransmission inetAddress;Multicast:: retransmission m retransmission; Multicast :: InetAddress m retransmission inetAddress;
Multicast: :Retries m retries;Multicast:: Retries m retries;
Multicast: : Timeout m timeout;Multicast:: Timeout m timeout;
Multicast: :RepetitionNumber m repetition number;Multicast:: RepetitionNumber m repetition number;
Multicast: :RepetitionDelay m repetition delay; Multicast: :FaultReportFile m file;Multicast:: RepetitionDelay m repetition delay; Multicast:: FaultReportFile m file;
Multicast: : Senderldentifier var m sender;Multicast :: Senderldentifier var m sender;
Multicast: :Corbaloc m corbaloc;Multicast:: Corbaloc m corbaloc;
CORBA: :ORB_var m orb;CORBA:: ORB_var m orb;
};
#endif // FooManager ROTemporalMulticastClientFactory hpp}; #endif // FooManager ROTemporalMulticastClientFactory hpp
ANNEXE 8ANNEX 8
////
// File: Client.cpp// File: Client.cpp
// #include "FooManager ROTemporalMulticastClientFactoryHelper.hpp"// #include "FooManager ROTemporalMulticastClientFactoryHelper.hpp"
// Stimulator include #include <Stimulator/Parser.hpp> #include <Stimulator/DefaultEndCycleCallback.hpp> #include <Stimulator/Stimulator.hpp> #include <Stimulator/ResultWriter.hpp>// Stimulator include #include <Stimulator / Parser.hpp> #include <Stimulator / DefaultEndCycleCallback.hpp> #include <Stimulator / Stimulator.hpp> #include <Stimulator / ResultWriter.hpp>
// Implementation of ail Actions #include "InstAction.hpp"// Implementation of garlic Actions #include "InstAction.hpp"
#include "MulticastEventListener.hpp"#include "MulticastEventListener.hpp"
// perco includes #include <ossupport/OS.hpp> #include <common/System.hpp> #include <testutils/Testable.hpp>// perco includes #include <ossupport / OS.hpp> #include <common / System.hpp> #include <testutils / Testable.hpp>
#include <iostream> #include <string> #include <fstream> using namespace std; static bool M stopped = false;#include <iostream> #include <string> #include <fstream> using namespace std; static bool M stopped = false;
void usage(string exeName)void usage (string exeName)
{ coût « "Usage: " « exeName « " [Properties file] [Server endpoint]" « endl; coût « " Option : [QueueSize] [Timeout] [Retries] [TTL]" « endl; } void instance_stimulator(string parseFile, Test::FooManager_var FooManagerV, CORBA: :ORB_var orb){cost "" Usage: "" exeName "" [Properties file] [Server endpoint] "" endl; cost "" Option: [QueueSize] [Timeout] [Retries] [TTL] "" endl; } void instance_stimulator (string parseFile, Test :: FooManager_var FooManagerV, CORBA :: ORB_var orb)
{
Stimulator* stimu = new Stimulator();{ Stimulator * stimu = new Stimulator ();
// Parse file "Stimulator.properties" Parser* parse = new Parser();// Parse file "Stimulator.properties" Parser * parse = new Parser ();
// conf. the stimu members and ail actions members parse->parseFileIn(parseFile) ;// conf. the parse-> parseFileIn (parseFile)
// instance of de Default call back cycle DefaultEndCycleCallback *decc = new DefaultEndCycleCallback();// instance of Default call back cycle DefaultEndCycleCallback * decc = new DefaultEndCycleCallback ();
// instance of actions CreateSourceFooAction *cal ; UpdateSourceFooKinematicAction *ca2; UpdateFooAction *ca4;// instance of actions CreateSourceFooAction * cal; UpdateSourceFooKinematicAction * ca2; UpdateFooAction * ca4;
DropSourceFooAction *ca3; DropSourceFoosAction *ca5; SetFooNameAction *ca6; // instance of Resuit WriterDropSourceFooAction * ca3; DropSourceFoosAction * ca5; SetFooNameAction * ca6; // instance of Resuit Writer
ResultWriter* resultWriter = new Resuit Writer();ResultWriter * resultWriter = new Resuit Writer ();
// add endcyclecallbacks in the Stimulator stimu->setEndCycleCallback(decc);// add endcyclecallbacks in Stimulator stimu-> setEndCycleCallback (decc);
// set stimulator properties stimu->m_cyclePeriod = parse->getStimulatorProperties() .m cyclePeriod; stimu->m_statisticsType = parse->getStimulatorProperties().m_statisticsType; stimu->m_nbDummyCycles = parse- >getStimulatorProperties().m_nbDummyCycles; stimu->m_nbCycles = parse->getStimulatorProperties().m_nbCycles;// set stimulator properties stimu-> m_cyclePeriod = parse-> getStimulatorProperties () .m cyclePeriod; stimu-> m_statisticsType = parse-> getStimulatorProperties (). m_statisticsType; stimu-> m_nbDummyCycles = parse-> getStimulatorProperties (). m_nbDummyCycles; stimu-> m_nbCycles = parse-> getStimulatorProperties (). m_nbCycles;
// add actions in the stimulator and transfert properties for(int i=0; i < parse->getNumberOfActions(); i++) { switch(parse->getActionProperties(i).m_ActionType)// add actions in the stimulator and transfer properties for (int i = 0; i <parse-> getNumberOfActions (); i ++) {switch (parse-> getActionProperties (i) .m_ActionType)
{ case 1 : cal = new CreateSourceFooAction(FooManagerV); cal->m_info = parse->getActionProperties(i).m_info; cal ->m_startupDelay = parse-{case 1: cal = new CreateSourceFooAction (FooManagerV); cal-> m_info = parse-> getActionProperties (i) .m_info; cal -> m_startupDelay = parse-
>getActionProperties(i).m_startupDelay; cal->m_nbExecutionsPerCycle = parse- >getActionProperties(i).m_nbExecutionsPerCycle; cal->m_executionGroupSize = parse- >getActionProperties(i).m_executionGroupSize;
cal->m_betweenGroupsDelay = parse- >getActionProperties(i).m_betweenGroupsDelay; cal->m_ActionType = parse- >getActionProperties(i).m_ActionType; stimu->addAction(cal); break; case 3 : ca2 = new> GetActionProperties (i) .m_startupDelay; cal-> m_nbExecutionsPerCycle = parse-> getActionProperties (i) .m_nbExecutionsPerCycle; cal-> m_executionGroupSize = parse-> getActionProperties (i) .m_executionGroupSize; cal-> m_betweenGroupsDelay = parse-> getActionProperties (i) .m_betweenGroupsDelay; cal-> m_ActionType = parse-> getActionProperties (i) .m_ActionType; stimu-> addAction (cal); break; box 3: ca2 = new
UpdateSourceFooKinematicAction(FooManagerV); ca2->m_info = parse->getActionProperties(i).m_info; ca2->m_startupDelay = parse- >getActionProperties(i).m_startupDelay; ca2->m_nbExecutionsPerCycle = parse- >getActionProperties(i).m_nbExecutionsPerCycle; ca2->m_executionGroupSize = parse-UpdateSourceFooKinematicAction (FooManagerV); ca2-> m_info = parse-> getActionProperties (i) .m_info; ca2-> m_startupDelay = parse-> getActionProperties (i) .m_startupDelay; ca2-> m_nbExecutionsPerCycle = parse-> getActionProperties (i) .m_nbExecutionsPerCycle; ca2-> m_executionGroupSize = parse-
>getActionProperties(i).m_executionGroupSize; ca2->m_betweenGroupsDelay = parse- >getActionProperties(i).m_betweenGroupsDelay; ca2->m_ActionType = parse- >getActionProperties(i).m_ActionType; stimu->addAction(ca2) ; break; case 2 : ca3 = new DropSourceFooAction(FooManagerV); ca3->m_info = parse->getActionProperties(i).m_info; ca3->m_startupDelay = parse- >getActionProperties(i).m_startupDelay; ca3->m_nbExecutionsPerCycle = parse- >getActionProperties(i).m_nbExecutionsPerCycle; ca3->m_executionGroupSize = parse-> GetActionProperties (i) .m_executionGroupSize; ca2-> m_betweenGroupsDelay = parse-> getActionProperties (i) .m_betweenGroupsDelay; ca2-> m_ActionType = parse-> getActionProperties (i) .m_ActionType; stimu-> addAction (ca2); break; box 2: ca3 = new DropSourceFooAction (FooManagerV); ca3-> m_info = parse-> getActionProperties (i) .m_info; ca3-> m_startupDelay = parse-> getActionProperties (i) .m_startupDelay; ca3-> m_nbExecutionsPerCycle = parse-> getActionProperties (i) .m_nbExecutionsPerCycle; ca3-> m_executionGroupSize = parse-
>getActionProperties(i).m_executionGroupSize; ca3->m_betweenGroupsDelay = parse- >getActionProperties(i).m_betweenGroupsDelay; ca3->m_ActionType = parse- >getActionProperties(i).m_ActionType; stimu->addAction(ca3 ) ; break; case 4 : ca4 = new UpdateFooAction(FooManagerV); ca4->m_info = parse->getActionProperties(i).m_info; ca4->m_startupDelay = parse- >getActionProperties(i).m_startupDelay; ca4->m_nbExecutionsPerCycle = parse- >getActionProperties(i).m_nbExecutionsPerCycle; ca4->m_executionGroupSize = parse-> GetActionProperties (i) .m_executionGroupSize; ca3-> m_betweenGroupsDelay = parse-> getActionProperties (i) .m_betweenGroupsDelay; ca3-> m_ActionType = parse-> getActionProperties (i) .m_ActionType; stimu-> addAction (ca3); break; box 4: ca4 = new UpdateFooAction (FooManagerV); ca4-> m_info = parse-> getActionProperties (i) .m_info; ca4-> m_startupDelay = parse-> getActionProperties (i) .m_startupDelay; ca4-> m_nbExecutionsPerCycle = parse-> getActionProperties (i) .m_nbExecutionsPerCycle; ca4-> m_executionGroupSize = parse-
>getActionProperties(i).m_executionGroupSize;
ca4->m_betweenGroupsDelay = parse- >getActionProperties(i).m_betweenGroupsDelay; ca4->m_ActionType = parse- >getActionProperties(i).m_ActionType; stimu->addAction(ca4); break; case 5 : ca5 = new DropSourceFoosAction(FooManagerV); ca5->m_info = parse->getActionProperties(i).m_info; ca5 ->m_startupDelay = parse-> GetActionProperties (i) .m_executionGroupSize; ca4-> m_betweenGroupsDelay = parse-> getActionProperties (i) .m_betweenGroupsDelay; ca4-> m_ActionType = parse-> getActionProperties (i) .m_ActionType; stimu-> addAction (ca4); break; box 5: ca5 = new DropSourceFoosAction (FooManagerV); ca5-> m_info = parse-> getActionProperties (i) .m_info; ca5 -> m_startupDelay = parse-
>getActionProperties(i).m_startupDelay; ca5->m_nbExecutionsPerCycle = parse- >getActionProperties(i).m_nbExecutionsPerCycle; ca5->m_executionGroupSize = parse- >getActionProperties(i).m_executionGroupSize; ca5->m_betweenGroupsDelay = parse- >getActionProperties(i).m_betweenGroupsDelay; ca5->m_ActionType = parse- >getActionProperties(i).m_ActionType; stimu->addAction(ca5); break; case 6 : ca6 = new SetFooNameAction(FooManagerV); ca6->m_info = parse->getActionProperties(i).m_info; ca6->m_startupDelay = parse-> GetActionProperties (i) .m_startupDelay; ca5-> m_nbExecutionsPerCycle = parse-> getActionProperties (i) .m_nbExecutionsPerCycle; ca5-> m_executionGroupSize = parse-> getActionProperties (i) .m_executionGroupSize; ca5-> m_betweenGroupsDelay = parse-> getActionProperties (i) .m_betweenGroupsDelay; ca5-> m_ActionType = parse-> getActionProperties (i) .m_ActionType; stimu-> addAction (CA5); break; box 6: ca6 = new SetFooNameAction (FooManagerV); ca6-> m_info = parse-> getActionProperties (i) .m_info; ca6-> m_startupDelay = parse-
>getActionProperties(i).m_startupDelay; ca6->m_nbExecutionsPerCycle = parse- >getActionProperties(i).m_nbExecutionsPerCycle; ca6->m_executionGroupSize = parse- >getActionProperties(i).m_executionGroupSize; ca6->m_betweenGroupsDelay = parse- >getActionProperties(i).m_betweenGroupsDelay; ca6->m_ActionType = parse- >getActionProperties(i).m_ActionType; stimu->addAction(ca6); break;> GetActionProperties (i) .m_startupDelay; ca6-> m_nbExecutionsPerCycle = parse-> getActionProperties (i) .m_nbExecutionsPerCycle; ca6-> m_executionGroupSize = parse-> getActionProperties (i) .m_executionGroupSize; ca6-> m_betweenGroupsDelay = parse-> getActionProperties (i) .m_betweenGroupsDelay; ca6-> m_ActionType = parse-> getActionProperties (i) .m_ActionType; stimu-> addAction (ca6); break;
deiàult : coût « "Error in Type of actions !!!" « endl; exit(O); break;deiàult: cost "" Error in Type of actions !!! " "Endl; exit (O); break;
}}
} // start the stimulator stimu->start();
// get out a resuit file if(ρarse->getResultOutρutFile() != "") resultWriter->writeFileOut(parse->getResultOutputFile(), stimu); delete stimu; delete resultWriter; delete parse; orb->shutdown(false) ;} // start the stimulator stimu-> start (); // get out a file resume if (ρarse-> getResultOutρutFile ()! = "") resultWriter-> writeFileOut (parse-> getResultOutputFile (), stimu); delete stimu; delete resultWriter; delete parse; orb-> shutdown (false);
}}
// Stimulator thread class StimulatorThread : Cdmw::OsSupport::Thread { public:// Stimulator thread class StimulatorThread: Cdmw :: OsSupport :: Thread {public:
StimulatorThread(string parseFile, Test::FooManager_ptr FooManagerV, CORBA: :ORB_ptr orb)StimulatorThread (parseFile string, Test :: FooManager_ptr FooManagerV, CORBA :: ORB_ptr orb)
: m_parseFile(parseFile), m FooManager V(Test: :FooManager: :_duplicate(FooManagerV)), m_orb(CORBA::ORB::_duρlicate(orb)) { start(); }; ~StimulatorThread() throw() { }; inline void run() throw() { instance_stimulator(m_parseFile, m FooManagerV, m orb); }; inline void wait() { join(); } ; private: string m_parseFile;: m_parseFile (parseFile), m FooManager V (Test :: FooManager :: _duplicate (FooManagerV)), m_orb (CORBA :: ORB :: _ duplicate (orb)) {start (); }; ~ StimulatorThread () throw () {}; inline void run () throw () {instance_stimulator (m_parseFile, m FooManagerV, m orb); }; inline void wait () {join (); }; private: string m_parseFile;
Test::FooManager_var m FooManagerV; CORBA: :ORB_var m orb; };Test :: FooManager_var m FooManagerV; CORBA:: ORB_var m orb; };
void network_interruptor()void network_interruptor ()
{ string interruptor filename = ".interruptor"; const int MAX = 100; char bufIMAX]; char interrupted[l]; coût « "Interruptor initialized." « endl; while (ÎM stopped) { // open file and read Line ifstream ifileln(interruptor_filename.c_str());
if (!ifileln.good()){string interruptor filename = ".interruptor"; const int MAX = 100; bufIMAX tank]; char interrupted [l]; cost "" Interruptor initialized. ""Endl; while (ÎM stopped) {// open file and read Line ifstream ifileln (interruptor_filename.c_str ()); if (! ifileln.good ())
{ coût « "Exception \"FileError\" :" « interruptor_filename.c_str() « " not open ..." « endl; exit(O);{cost "" Exception \ "FileError \": "" interrupt_filename.c_str () "" not open ... "" endl; exit (O);
} ifileln.getline(buf, MAX); if(ifileln.eof()) break; if(ifileln.fail()) { coût « "Exception \"ReadError\" :" « " can't read file " « interruptor_filename.c_str() « " ..." « endl; exit(O);} ifileln.getline (buf, MAX); if (ifileln.eof ()) break; if (ifileln.fail ()) {cost "" Exception \ "ReadError \": "" "can not read file" "interrupt_filename.c_str ()" "..." "endl; exit (O);
} int rc = sscani(buf, "%s", interrupted); if (rc > 0) { if (strcmp(interrupted, " 1 ") = 0)} int rc = sscani (buf, "% s", interrupted); if (rc> 0) {if (strcmp (interrupted, "1") = 0)
{{
Multicast::M_debug_failure_percentage = 100; coût « "»>»» Interruptor off now !" « endl;Multicast :: M_debug_failure_percentage = 100; cost "" »>» »Interruptor off now!" "Endl;
} else} else
{ Multicast::M_debug_failure_percentage = 0;{Multicast :: M_debug_failure_percentage = 0;
} } ifileln.close();}} ifileln.close ();
// Wait int timescale = Cdmw: :TestUtils: :Testable: :get_timescale();// Wait int timescale = Cdmw :: TestUtils :: Testable :: get_timescale ();
Cdmw: :OsSupport: :OS: :sleep(timescale* 100);Cdmw :: OsSupport :: OS:: sleep (timescale * 100);
} }
// Interruptor thread to change the state of network class InterruptorThread : Cdmw::OsSupport::Thread { public: InterruptorThreadO { start(); }; ~InterruptorThread() throw() { } ; inline void run() throw() { network_interruptor(); } ; inline void wait() { join(); } ; private:}} // Interruptor thread to change the state of network class InterruptorThread: Cdmw :: OsSupport :: Thread {public: InterruptorThreadO {start (); }; ~ InterruptorThread () throw () {}; inline void run () throw () {network_interruptor (); }; inline void wait () {join (); }; private:
}; int main(int argc, char* argv[], char* envp[])}; int main (int argc, char * argv [], char * envp [])
{ bool interruptor mode = false;{bool interruptor mode = false;
// Usage Method call. if(argc < 3) { usage(string(argv[0])); return 1;// Usage Method call. if (argc <3) {usage (string (argv [0])); return 1;
}}
// Interruptor mode ? if (strcmp(argv[8], "interruptor") = 0) { interruptor mode = true; } coût « endl; coût « "— Starting Foo Manager Client — " « endl; coût « endl;// Interruptor mode? if (strcmp (argv [8], "interruptor") = 0) {interrupt mode = true; } cost "endl; cost "" - Starting Foo Manager Client - "" endl; cost "endl;
Test::FooManager_var FooManagerV; FooManager ROTemporalMulticastClientFactory factory; try {Test :: FooManager_var FooManagerV; FooManager ROTemporalMulticastClientFactory factory; try {
// Initialize ORB// Initialize ORB
CORBA: :ORB_var orb = CORBA: :ORB_init(argc, argv); // Bind to FooManager Server.CORBA:: ORB_var orb = CORBA:: ORB_init (argc, argv); // Bind to FooManager Server.
// filter to catch ail multicast events Multicast::M_print_events = true; Multicast: :M_print_no_fault_events = true;// filter to catch garlic multicast events Multicast :: M_print_events = true; Multicast :: M_print_no_fault_events = true;
// create a multicast event listener
MulticastEventListener* multicast event listener = new MulticastEventListener() ; multicast_event_listener->init_file(argv[3]); factory.initClientSide(orb.in()); factory.setInetAddress(argv[2]); factory.setQueueSize((Multicast::QueueSize)atoi(argv[4])); factory.setTimeout((Multicast::Timeout)atoi(argv[5])); factory.setRetries((Multicast::Retries)atoi(argv[6])); factory.setTTL((Multicast: :TTL)atoi(argv[7]));// create a multicast event listener MulticastEventListener * multicast event listener = new MulticastEventListener (); multicast_event_listener-> init_file (argv [3]); factory.initClientSide (orb.in ()); factory.setInetAddress (argv [2]); factory.setQueueSize ((Multicast :: QueueSize) atoi (argv [4])); factory.setTimeout ((Multicast :: Timeout) atoi (argv [5])); factory.setRetries ((Multicast :: Retries) atoi (argv [6])); factory.setTTL ((Multicast:: TTL) atoi (argv [7]));
// override the default report file on the multicast event listener factory.setFaultReportFile(*multicast_event_listener); // current failure percentage to simulate the lost of requests// override the default report file on the multicast event listener factory.setFaultReportFile (* multicast_event_listener); // current failure percentage to simulate the lost of requests
// fix failure percentage to simulate the lost of requests if (! interruptor mode) {// fix failure percentage to simulate the lost of requests if (! interrupt mode) {
Multicast: :M_debug_failure_percentage = (unsigned int)atoi(argv[8]); } else {Multicast :: M_debug_failure_percentage = (unsigned int) atoi (argv [8]); } else {
Multicast: :M_debug_failure_percentage = 0; coût « "Interruptor mode activated." « endl; } cout « "The current theorical failure percentage is " «Multicast :: M_debug_failure_percentage = 0; cost "" Interruptor mode activated. " "Endl; } cost "" The current theorical failure percentage is ""
Multicast: :M_debug_failure_percentage « endl;Multicast :: M_debug_failure_percentage "endl;
FooManagerV = factory.create_object();FooManagerV = factory.create_object ();
// instance_stimulator() Method set ail derived Actions precised in properties file in the stimulator,// instance_stimulator () Method set garlic derived Actions specified in properties file in the stimulator,
// in our test case, we choose as if ACTION TYPE Tag in propertie file equal to : // 1 we set a create With 3 Blocks in parameter,// in our test case, we choose as if ACTION TYPE Tag in propertie file equal to: // 1 we set a create With 3 Blocks in parameter,
// 2 we set a drop With 1 Block in parameter, // 3 we set an update With 2 Blocks in parameter, // 4 we set an update With a séquence of MultiBlocks in parameter, // 5 we set an drop With a séquence of SourceBlocks in parameter. // Stimulator thread// 2 we set a drop With 1 Block in parameter, // 3 we set an update With 2 Blocks in parameter, // 4 we set an update With a sequence of MultiBlocks in parameter, // 5 we set a drop With a sequence of SourceBlocks in parameter. // Stimulator thread
StimulatorThread* stimulator thread = new StimulatorThread(string(argv[l]), FooManagerV.in(), orb.in());StimulatorThread * stimulator thread = new StimulatorThread (string (argv [l]), FooManagerV.in (), orb.in ());
InterruptorThread* interruptor thread = NULL; if (interruptor mode) {
interruptor thread = new InterruptorThread();InterruptorThread * interruptor thread = NULL; if (interrupt mode) { interruptor thread = new InterruptorThread ();
} orb->run(); stimulator_thread->wait() ; delete stimulator thread; if (interruptor mode) {} orb-> run (); stimulator_thread-> wait (); delete stimulator thread; if (interrupt mode) {
M stopped = true; interruptor_thread->wait() ; delete interruptor thread; }M stopped = true; interruptor_thread-> wait (); delete interruptor thread; }
} catch(CORBA::Exception &e) { cerr « "Client Détection: Caught CORBA Exception " « e « endl; return 1; } cout « endl; coût « " — Successfully Bound to FooManager Server" « endl; cout « endl; return 0; } // End main} catch (CORBA :: Exception & e) {cerr "" Client Detection: Caught CORBA Exception "" e "endl; return 1; } cost "endl; cost "" - Successfully Bound to FooManager Server "" endl; cost "endl; return 0; } // End main
ANNEXE 9ANNEX 9
////
// File : server.cpp// File: server.cpp
// #include "ValuetypeBlock_impl.hpp"// #include "ValuetypeBlock_impl.hpp"
#include "FooManager ROTemporalMulticastServerFactoryHelper.hpp" #include "FooManagerBehavior impl.hpp" #include "MulticastEventListener.hpp" #include <string> #include <stdlib.h>
#include <iostream> using namespace std; void usage(string exeName)#include "FooManager ROTemporalMulticastServerFactoryHelper.hpp"#include"FooManagerBehaviorimpl.hpp"#include"MulticastEventListener.hpp"#include<string>#include<stdlib.h> #include <iostream> using namespace std; void usage (string exeName)
{ coût « "Usage : " « exeName « " [-trace] | [-notrace] [display frequency]{cost "" Usage: "" exeName "" [-trace] | [-notrace] [display frequency]
[InetAdress] [id]" « endl; coût « " Option : [QueueSize] [ThreadPool] [Timeout] [QueueSizeList] [Retries] [TTL]" « endl; } int main(int argc, char* argv[], char* envp[])[InetAdress] [id] "" endl; cost "" Option: [QueueSize] [ThreadPool] [Timeout] [QueueSizeList] [Retries] [TTL] "" endl;} int main (int argc, char * argv [], char * envp [])
{ cout « endl; coût « " starting Foo Manager server " « endl; coût « endl;{cost "endl; cost "" starting Foo Manager server "" endl; cost "endl;
Test::FooManager_var FooManagerV; FooManager ROTemporalMulticastServerFactory factory; try {Test :: FooManager_var FooManagerV; FooManager ROTemporalMulticastServerFactory factory; try {
// Initialize ORB CORBA: :ORB_var orb = CORBA: :ORB_init(argc, argv);// Initialize ORB CORBA :: ORB_var orb = CORBA :: ORB_init (argc, argv);
// Register ail factories// Register garlic factories
SourceBlockFactory* srcBlockFactory = new SourceBlockFactory(); orb->register_value_factory("IDL:Block/SourceBlock: 1.0", srcBlockFactory);SourceBlockFactory * srcBlockFactory = new SourceBlockFactory (); orb-> register_value_factory ("IDL: Block / SourceBlock: 1.0", srcBlockFactory);
IdentityCharactFactory* identCharactFactory = new IdentityCharactFactoryO ; orb->register_value_factory("IDL:Block/IdentityCharact: 1.0", identCharactFactory);IdentityCharactFactory * identCharactFactory = new IdentityCharactFactoryO; orb-> register_value_factory ("IDL: Block / IdentityCharact: 1.0", identCharactFactory);
IdentityBlockFactory* identBlockFactory = new IdentityBlockFactory(); orb->register_value_factory("IDL:Block/IdentityBlock: 1.0", identBlockFactory) ;IdentityBlockFactory * identBlockFactory = new IdentityBlockFactory (); orb-> register_value_factory ("IDL: Block / IdentityBlock: 1.0", identBlockFactory);
NonPonctualKinematicBlockFactory* npkinBlockFactory = new NonPonctualKinematicBlockFactoryO ; orb->register_value_factory("IDL:Block/NonPonctualKinematicBlock:1.0", npkinBlockFactory) ;
PonctualKinematicBlockFactory* pkinBlockFactory = new PonctualKinematicBlockFactoryO ; orb->register_value_factory("IDL:Block/PonctualKinematicBlock:1.0", pkinBlockFactory) ;NonPonctualKinematicBlockFactory * npkinBlockFactory = new NonPonctualKinematicBlockFactoryO; orb-> register_value_factory ("IDL: Block / NonPonctualKinematicBlock: 1.0", npkinBlockFactory); PonctualKinematicBlockFactory * pkinBlockFactory = new PonctualKinematicBlockFactoryO; orb-> register_value_factory ("IDL: Block / PonctualKinematicBlock: 1.0", pkinBlockFactory);
// Get référence to Root POA// Get reference to Root POA
CORBA: :Object_var obj = orb->resolve_initial_references("RootPOA");CORBA :: Object_var obj = orb-> resolve_initial_references ("RootPOA");
PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in()); // Test if to output trace or no if (!((strcmp(argv[l], "-trace")=O ScSc argc>=4) || (strcmp(argv[l], "- notrace")=0 ScSc argc>=3))) { usage(argv[O]); orb->shutdo wn(true) ; return 1;PortableServer :: POA_var poa = PortableServer :: POA :: _ narrow (obj.in ()); // Test if to output trace or no if (! ((Strcmp (argv [l], "-trace") = O ScSc argc> = 4) || (strcmp (argv [l], "- notrace") = 0 ScSc argc> = 3))) {use (argv [O]); orb-> shutdo wn (true); return 1;
}}
// filter to catch ail multicast events Multicast::M_print_events = true; Multicast: :M_print_no_fault_events = true;// filter to catch garlic multicast events Multicast :: M_print_events = true; Multicast :: M_print_no_fault_events = true;
// create a multicast event listener MulticastEventListener* multicast event listener = new MulticastEventListener() ; string file;// create a multicast event listener MulticastEventListener * multicast event listener = new MulticastEventListener (); string file;
// Create a servant// Create a servant
FooManagerBehavior impl* FooManager impl = new FooManagerBehavior_impl(argc, argv); factory.initServerSide(orb.in(), poa.in(), FooManager impl); if ((strcmp(argv[l], "-trace")=O ScSc argc >= 4)) { factory.setInetAddress(argv[3]); file = argv[4];FooManagerBehavior impl * FooManager impl = new FooManagerBehavior_impl (argc, argv); factory.initServerSide (orb.in (), poa.in (), FooManager impl); if ((strcmp (argv [l], "-trace") = O ScSc argc> = 4)) {factory.setInetAddress (argv [3]); file = argv [4];
// argv[2] is display frequency factory.setThreadPoolSize((Multicast::ThreadPoolSize)atoi(argv[5])); factory.setNumberOfSenders((Multicast::NumberOfSenders)atoi(argv[6])); factory.setQueueSize((Multicast::QueueSize)atoi(argv[7])); factory.setTimeout((Multicast: :Timeout)atoi(argv[8])); factory.setRetries((Multicast::Retries)atoi(argv[9])); factory.setTTL((Multicast::TTL)atoi(argv[10])); } else { factory.setInetAddress(argv[2]); file = argv[3]; factory.setThreadPoolSize((Multicast::ThreadPoolSize)atoi(argv[4]));
factory.setNumberOfôenders((Multicast::NumberOfSenders)atoi(argv[5])); factory.setQueueSize((Multicast::QueueSize)atoi(argv[6])); factory.setTimeout((Multicast::Timeout)atoi(argv[7])); factory.setRetries((Multicast::Retries)atoi(argv[8])); factory.setTTL((Multicast: :TTL)atoi(argv[9]));// argv [2] is display frequency factory.setThreadPoolSize ((Multicast :: ThreadPoolSize) atoi (argv [5])); factory.setNumberOfSenders ((Multicast :: NumberOfSenders) atoi (argv [6])); factory.setQueueSize ((Multicast :: QueueSize) atoi (argv [7])); factory.setTimeout ((Multicast:: Timeout) atoi (argv [8])); factory.setRetries ((Multicast :: Retries) atoi (argv [9])); factory.setTTL ((Multicast :: TTL) atoi (argv [10])); } else {factory.setInetAddress (argv [2]); file = argv [3]; factory.setThreadPoolSize ((Multicast :: ThreadPoolSize) atoi (argv [4])); factory.setNumberOfôenders ((Multicast :: NumberOfSenders) atoi (argv [5])); factory.setQueueSize ((Multicast :: QueueSize) atoi (argv [6])); factory.setTimeout ((Multicast :: Timeout) atoi (argv [7])); factory.setRetries ((Multicast :: Retries) atoi (argv [8])); factory.setTTL ((Multicast:: TTL) atoi (argv [9]));
} multicast_event_listener->init_file(file.c_str()); // override the default report file on the multicast event listener factory.setFaultReportFile(*multicast_event_listener);} multicast_event_listener-> init_file (file.c_str ()); // override the default report file on the multicast event listener factory.setFaultReportFile (* multicast_event_listener);
FooManagerV = factory.create_object(); // Activate PAO managerFooManagerV = factory.create_object (); // Activate PAO manager
PortableServer::POAManager_var poa mgr = poa -> the_POAManager(); poa mgr -> activate();PortableServer :: POAManager_var poa mgr = poa -> the_POAManager (); poa mgr -> activate ();
// Accept requests orb->run();// Accept requests orb-> run ();
} catch (CORBA: :Exception &e) { cerr « "Server Détection: Caught CORBA Exception " « e « endl; return 1; } cout « endl; coût « " server is terminating " « endl; cout « endl; return 0;
} catch (CORBA:: Exception & e) {cerr "" Server Detection: Caught CORBA Exception "" e "endl; return 1; } cost "endl; cost "" server is terminating "" endl; cost "endl; return 0;