File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
ITS-commandline/fr.lip6.move.gal.itscl.application/src/fr/lip6/move/gal/itscl/application
ahg/fr.lip6.move.ahg/src/fr/lip6/move/serialization Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ public Object start(IApplicationContext context) throws Exception {
102102 spec = SerializationUtil .fileToGalSystem (inputff );
103103 System .out .println ("Successfully read input file : " + inputff +" in " + (time - System .currentTimeMillis ()) + " ms." );
104104 } else if (ff .getName ().endsWith (".ahg" )) {
105+ AHGSerializationUtil .setStandalone (true );
105106 AttackHyperGraph ahg = AHGSerializationUtil .fileToAttackHyperGraph (inputff );
106107 spec = AHGToGALTransformer .transformToGAL (ahg , modelName );
107108 System .out .println ("Successfully read input file : " + inputff + " and translated to GAL in "
Original file line number Diff line number Diff line change 1717import com .google .inject .Injector ;
1818
1919import fr .lip6 .move .AhgRuntimeModule ;
20+ import fr .lip6 .move .AhgStandaloneSetup ;
2021import fr .lip6 .move .ahg .AttackHyperGraph ;
2122
2223/**
2324 * Utility class for serialization of gal system
2425 */
2526public class AHGSerializationUtil {
2627
28+ private static boolean isStandalone = false ;
29+
30+ public static void setStandalone (boolean isStandalone ) {
31+ AHGSerializationUtil .isStandalone = isStandalone ;
32+ }
2733
2834 /**
2935 * Create a new file and return a Resource from this file.
@@ -46,14 +52,17 @@ private static Resource createResource(String filename)
4652 return null ;
4753 }
4854 }
49-
5055 private static Injector createInjector () {
51- return Guice .createInjector (new AhgRuntimeModule ());
56+ if (isStandalone ) {
57+ AhgStandaloneSetup gs = new AhgStandaloneSetup ();
58+ return gs .createInjectorAndDoEMFRegistration ();
59+ } else {
60+ return Guice .createInjector (new AhgRuntimeModule ());
61+ }
5262 }
53-
5463
5564 /**
56- * This method serialize a Divine System in the file {@code filename}
65+ * This method serialize a AHG System in the file {@code filename}
5766 * @param system The root of Gal system
5867 * @param filename The output filename.
5968 */
You can’t perform that action at this time.
0 commit comments