From 0f79ce0045593840376e9e9decde077bd0effc5d Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 9 Feb 2010 16:36:12 +0000 Subject: [PATCH] reindent git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7067 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/java/simgrid/msg/ApplicationHandler.java | 258 +++++++++---------- 1 file changed, 129 insertions(+), 129 deletions(-) diff --git a/src/java/simgrid/msg/ApplicationHandler.java b/src/java/simgrid/msg/ApplicationHandler.java index 37c6e66285..bdc53fe026 100644 --- a/src/java/simgrid/msg/ApplicationHandler.java +++ b/src/java/simgrid/msg/ApplicationHandler.java @@ -29,39 +29,39 @@ import java.util.Hashtable; */ public final class ApplicationHandler{ - /* - * This class is used to create the processes descibed in the deployment file. - */ - static class ProcessFactory { - /** + /* + * This class is used to create the processes descibed in the deployment file. + */ + static class ProcessFactory { + /** * The vector which contains the arguments of the main function * of the process object. */ - public Vector args; - - public Hashtable properties; + public Vector args; - /** + public Hashtable properties; + + /** * The name of the host of the process. */ - private String hostName; + private String hostName; - /** + /** * The function of the process. */ - private String function; - + private String function; + - /** + /** * Default constructor. */ - public ProcessFactory() { - this.args = new Vector(); - this.properties = new Hashtable(); - this.hostName = null; - this.function = null; - } - /** + public ProcessFactory() { + this.args = new Vector(); + this.properties = new Hashtable(); + this.hostName = null; + this.function = null; + } + /** * This method is called by the start element handler. * It sets the host and the function of the process to create, * and clear the vector containing the arguments of the @@ -71,17 +71,17 @@ public final class ApplicationHandler{ * @function The function of the process to create. * */ - public void setProcessIdentity(String hostName, String function) { - this.hostName = hostName; - this.function = function; - - if (!args.isEmpty()) - args.clear(); - - if(!properties.isEmpty()) - properties.clear(); - } - /** + public void setProcessIdentity(String hostName, String function) { + this.hostName = hostName; + this.function = function; + + if (!args.isEmpty()) + args.clear(); + + if(!properties.isEmpty()) + properties.clear(); + } + /** * This method is called by the startElement() handler. * It stores the argument of the function of the next * process to create in the vector of arguments. @@ -89,102 +89,102 @@ public final class ApplicationHandler{ * @arg The argument to add. * */ public void registerProcessArg(String arg) { - args.add(arg); - } - - public void setProperty(String id, String value) - { - properties.put(id,value); - } - - public String getHostName() - { - return hostName; - } - - public void createProcess() { - try { - - Class cls = Class.forName(this.function); - - simgrid.msg.Process process = (simgrid.msg.Process) cls.newInstance(); - process.name = /*process.getName();*/ this.function; - process.id = simgrid.msg.Process.nextProcessId++; - Host host = Host.getByName(this.hostName); - - MsgNative.processCreate(process, host); - Vector args = processFactory.args; - int size = args.size(); - - for (int index = 0; index < size; index++) - process.args.add(args.get(index)); - - process.properties = this.properties; - this.properties = new Hashtable(); - - } catch(JniException e) { - System.out.println(e.toString()); - e.printStackTrace(); - - } catch(NativeException e) { - System.out.println(e.toString()); - e.printStackTrace(); - - } catch(HostNotFoundException e) { - System.out.println(e.toString()); - e.printStackTrace(); - - } catch(ClassNotFoundException e) { - System.out.println(this.function + - " class not found\n The attribut function of the element process of your deployment file\n must correspond to the name of a Msg Proces class)"); - e.printStackTrace(); - - } catch(InstantiationException e) { - System.out.println("instantiation exception"); - e.printStackTrace(); - } catch(IllegalAccessException e) { - System.out.println("illegal access exception"); - e.printStackTrace(); - } catch(IllegalArgumentException e) { - System.out.println("illegal argument exception"); - e.printStackTrace(); - } - - } - } - - /* - * the ProcessFactory object used to create the processes. - */ - public static ProcessFactory processFactory; - - public ApplicationHandler() { - super(); - } - /** - * instanciates the process factory - */ - public static void onStartDocument() { - processFactory = new ProcessFactory(); - } - - public static void onBeginProcess(String hostName, String function) - { - processFactory.setProcessIdentity(hostName, function); -} + args.add(arg); + } + + public void setProperty(String id, String value) + { + properties.put(id,value); + } + + public String getHostName() + { + return hostName; + } + + public void createProcess() { + try { + + Class cls = Class.forName(this.function); + + simgrid.msg.Process process = (simgrid.msg.Process) cls.newInstance(); + process.name = this.function; + process.id = simgrid.msg.Process.nextProcessId++; + Host host = Host.getByName(this.hostName); + + MsgNative.processCreate(process, host); + Vector args = processFactory.args; + int size = args.size(); + + for (int index = 0; index < size; index++) + process.args.add(args.get(index)); + + process.properties = this.properties; + this.properties = new Hashtable(); + + } catch(JniException e) { + System.out.println(e.toString()); + e.printStackTrace(); + + } catch(NativeException e) { + System.out.println(e.toString()); + e.printStackTrace(); + + } catch(HostNotFoundException e) { + System.out.println(e.toString()); + e.printStackTrace(); + + } catch(ClassNotFoundException e) { + System.out.println(this.function + + " class not found\n The attribut function of the element process of your deployment file\n must correspond to the name of a Msg Proces class)"); + e.printStackTrace(); + + } catch(InstantiationException e) { + System.out.println("instantiation exception"); + e.printStackTrace(); + } catch(IllegalAccessException e) { + System.out.println("illegal access exception"); + e.printStackTrace(); + } catch(IllegalArgumentException e) { + System.out.println("illegal argument exception"); + e.printStackTrace(); + } + + } + } + + /* + * the ProcessFactory object used to create the processes. + */ + public static ProcessFactory processFactory; + + public ApplicationHandler() { + super(); + } + /** + * instanciates the process factory + */ + public static void onStartDocument() { + processFactory = new ProcessFactory(); + } + + public static void onBeginProcess(String hostName, String function) + { + processFactory.setProcessIdentity(hostName, function); + } public static void onProperty(String id, String value) { - processFactory.setProperty(id, value); - } - - public static void onProcessArg(String arg) { - processFactory.registerProcessArg(arg); - } - - public static void onEndProcess() { - - processFactory.createProcess(); - } - - public static void onEndDocument() { - } // NOTHING TODO + processFactory.setProperty(id, value); + } + + public static void onProcessArg(String arg) { + processFactory.registerProcessArg(arg); + } + + public static void onEndProcess() { + + processFactory.createProcess(); + } + + public static void onEndDocument() { + } // NOTHING TODO } -- 2.20.1