Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Deleted simulatedSleep, use waitFor instead. Moved everything from MsgNative to their...
[simgrid.git] / org / simgrid / msg / ApplicationHandler.java
index f983b9a..3003ec3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * These are the upcalls used by the FleXML parser for application files
  *
- * Copyright 2006,2007,2010 The SimGrid team.           
+ * Copyright 2006,2007,2010,2011 The SimGrid team.           
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
@@ -23,7 +23,10 @@ public final class ApplicationHandler {
                 */
                public  static Vector<String> args;
 
-               public  static Hashtable<String,String> properties;
+        /**
+         *
+         */
+        public  static Hashtable<String,String> properties;
 
                /**
                 * The name of the host of the process.
@@ -41,7 +44,9 @@ public final class ApplicationHandler {
                 * and clear the vector containing the arguments of the 
                 * previouse process function if needed.
                 *
-                * @host                                The host of the process to create.
+         * @param hostName_
+         * @param function_
+         * @host                               The host of the process to create.
                 * @function                    The function of the process to create.
                 *
                 */
@@ -60,23 +65,36 @@ public final class ApplicationHandler {
                 * It stores the argument of the function of the next
                 * process to create in the vector of arguments.
                 *
-                * @arg                                 The argument to add.
+         * @param arg
+         * @arg                                        The argument to add.
                 *
                 */ public  static void registerProcessArg(String arg) {
                         args.add(arg);
                 }
 
-                public  static void setProperty(String id, String value)
+         /**
+          *
+          * @param id
+          * @param value
+          */
+         public  static void setProperty(String id, String value)
                 {
                         properties.put(id,value);      
                 }
 
-                public  static String getHostName()
+         /**
+          *
+          * @return
+          */
+         public  static String getHostName()
                 {
                         return hostName;
                 }
 
-                @SuppressWarnings("unchecked")
+         /**
+          *
+          */
+         @SuppressWarnings("unchecked")
                 public  static void createProcess() {
                         try {
                                 Class<Process> cls = (Class<Process>) Class.forName(function);
@@ -84,9 +102,8 @@ public final class ApplicationHandler {
                                 Process process = cls.newInstance();
                                 process.name = function;
                                 process.id = org.simgrid.msg.Process.nextProcessId++;
-                                Host host = Host.getByName(hostName);
 
-                                MsgNative.processCreate(process, host);
+                               process.create(hostName);
                                 Vector<String> args_ = args;
                                 int size = args_.size();
 
@@ -116,29 +133,52 @@ public final class ApplicationHandler {
                 }
        
 
-       public  static void onStartDocument() {
+         /**
+          *
+          */
+         public  static void onStartDocument() {
                        args = new Vector<String>();
                        properties = new Hashtable<String,String>();
                        hostName = null;
                        function = null;
        }
 
-       public  static void onBeginProcess(String hostName, String function) {
+         /**
+          *
+          * @param hostName
+          * @param function
+          */
+         public  static void onBeginProcess(String hostName, String function) {
                setProcessIdentity(hostName, function);
                
        }
-       public  static void onProperty(String id, String value) {
+    /**
+     *
+     * @param id
+     * @param value
+     */
+    public  static void onProperty(String id, String value) {
                setProperty(id, value);
        }
 
-       public  static void onProcessArg(String arg) {
+    /**
+     *
+     * @param arg
+     */
+    public  static void onProcessArg(String arg) {
                registerProcessArg(arg);
        }
 
-       public  static void onEndProcess() {
+    /**
+     *
+     */
+    public  static void onEndProcess() {
                createProcess();
        }        
 
-       public static void onEndDocument() {
+    /**
+     *
+     */
+    public static void onEndDocument() {
        }  
 }