+/*\r
+ * ApplicationHandler.cxx\r
+ *\r
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier \r
+ * All right reserved. \r
+ *\r
+ * This program is free software; you can redistribute \r
+ * it and/or modify it under the terms of the license \r
+ *(GNU LGPL) which comes with this package. \r
+ *\r
+ */\r
+ \r
+ /* ApplicationHandler member functions implementation.\r
+ */ \r
+ \r
#include <ApplicationHandler.hpp>\r
\r
namespace SimGrid\r
{\r
return *this;\r
}\r
- \r
+ \r
void ApplicationHandler::onStartDocument(void)\r
{\r
// instanciate the factory at the begining of the parsing\r
\r
// create the cxx process wrapper.\r
void ApplicationHandler::ProcessFactory::createProcess() \r
+ throw (ClassNotFoundException, HostNotFoundException)\r
{\r
Host host;\r
Process* process;\r
\r
- // dynamic creation of a instance fo the process from its name (which is specified by the element function\r
+ // try to dynamicaly create an instance fo the process from its name (which is specified by the element function\r
// in the xml application file.\r
- try\r
- {\r
- process = (Process*)Class::fromName(this->function);\r
- }\r
- catch(ClassNotFoundException e)\r
- {\r
- cerr << e.toString(); \r
- }\r
+ // if this static method fails, it throws an exception of the class ClassNotFoundException\r
+ process = (Process*)Class::fromName(this->function);\r
\r
// try to retrieve the host of the process from its name\r
- try\r
- {\r
- host = Host::getByName(this->hostName); \r
- }\r
- catch(HostNotFoundException(this->hostName))\r
- {\r
- cerr << e.toString();\r
- }\r
- \r
+ // if this method fails, it throws an exception of the class HostNotFoundException\r
+ host = Host::getByName(this->hostName); \r
\r
// build the list of the arguments of the newly created process.\r
int argc = xbt_dynar_length(this->args);\r