/* $Id: $ * Creation date: November 3, 2007 * License: * Copyright: * Authors: */ @mainClass "ClientServeurUtil::Main" @mainOperation "main" package ClientServeurUtil; require kermeta require "ClientServeur.ecore" using kermeta::standard using kermeta::persistence using ClientServeur class Main { operation chargerModele(fichier : String) : Serveur is do var serveur : Serveur var repository : EMFRepository init EMFRepository.new var resource : EMFResource resource ?= repository.createResource(fichier, "platform:/resource/Architecture/meta-models/ClientServeur.ecore") resource.load serveur ?= resource.instances.one result := serveur end operation afficherModele(serveur : Serveur) : Void is do stdio.write(" *** Serveur : "+serveur.nom) stdio.writeln(" connecte a : ") serveur.connecteA.each{ c | stdio.writeln(" --- " + c.nom+" via " + c.utilise.nom) } end operation main() : Void is do stdio.writeln("\n +++++++ Modele +++++++\n") var serveur : Serveur serveur := chargerModele("platform:/resource/Architecture/models/ModeleCS.xmi") afficherModele(serveur) end }