/*
* 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
* (GNU LGPL) which comes with this package.
*/
-package simgrid.msg;
+package org.simgrid.msg;
import java.util.Hashtable;
import java.util.Vector;
*/
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.
* 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.
*
*/
* 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<simgrid.msg.Process> cls = (Class<Process>) Class.forName(function);
+ Class<Process> cls = (Class<Process>) Class.forName(function);
- simgrid.msg.Process process = cls.newInstance();
+ Process process = cls.newInstance();
process.name = function;
- process.id = simgrid.msg.Process.nextProcessId++;
- Host host = Host.getByName(hostName);
+ process.id = org.simgrid.msg.Process.nextProcessId++;
- MsgNative.processCreate(process, host);
+ MsgNative.processCreate(process, hostName);
Vector<String> args_ = args;
int size = args_.size();
process.args.add(args_.get(index));
process.properties = properties;
- properties = new Hashtable();
+ properties = new Hashtable<String,String>();
} catch(HostNotFoundException e) {
System.out.println(e.toString());
}
- 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() {
}
}