From ffb152ddb9e70873da098de4577e64a2595f4697 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 5 Apr 2015 18:53:03 +0200 Subject: [PATCH] reindent the java sources --- src/bindings/java/org/simgrid/msg/As.java | 36 +- src/bindings/java/org/simgrid/msg/Comm.java | 2 +- src/bindings/java/org/simgrid/msg/File.java | 2 +- src/bindings/java/org/simgrid/msg/Host.java | 72 ++-- src/bindings/java/org/simgrid/msg/Msg.java | 5 - .../java/org/simgrid/msg/MsgException.java | 32 +- src/bindings/java/org/simgrid/msg/Mutex.java | 4 +- .../java/org/simgrid/msg/Process.java | 64 +-- .../java/org/simgrid/msg/RngStream.java | 26 +- .../java/org/simgrid/msg/Semaphore.java | 126 +++--- .../java/org/simgrid/msg/Storage.java | 38 +- src/bindings/java/org/simgrid/msg/Task.java | 129 +++--- src/bindings/java/org/simgrid/msg/VM.java | 62 ++- .../java/org/simgrid/trace/Trace.java | 386 +++++++++--------- 14 files changed, 488 insertions(+), 496 deletions(-) diff --git a/src/bindings/java/org/simgrid/msg/As.java b/src/bindings/java/org/simgrid/msg/As.java index e8a7a983d6..35248f8cb0 100644 --- a/src/bindings/java/org/simgrid/msg/As.java +++ b/src/bindings/java/org/simgrid/msg/As.java @@ -8,29 +8,29 @@ package org.simgrid.msg; public class As { - private long bind; - - protected As() { + private long bind; + + protected As() { }; - public String toString (){ - return this.getName(); - } - public native String getName(); + public String toString (){ + return this.getName(); + } + public native String getName(); - public native As[] getSons(); + public native As[] getSons(); - public native String getProperty(String name); + public native String getProperty(String name); - public native String getModel(); + public native String getModel(); - public native Host[] getHosts(); + public native Host[] getHosts(); - /** - * Class initializer, to initialize various JNI stuff - */ - public static native void nativeInit(); - static { - nativeInit(); - } + /** + * Class initializer, to initialize various JNI stuff + */ + public static native void nativeInit(); + static { + nativeInit(); + } } diff --git a/src/bindings/java/org/simgrid/msg/Comm.java b/src/bindings/java/org/simgrid/msg/Comm.java index 672e70289c..ebe63fc16a 100644 --- a/src/bindings/java/org/simgrid/msg/Comm.java +++ b/src/bindings/java/org/simgrid/msg/Comm.java @@ -68,7 +68,7 @@ public class Comm { * @param timeout Time before giving up */ public native void waitCompletion(double timeout) throws TransferFailureException, HostFailureException, TimeoutException; - + /** * Returns the task associated with the communication. * if the communication isn't finished yet, will return null. diff --git a/src/bindings/java/org/simgrid/msg/File.java b/src/bindings/java/org/simgrid/msg/File.java index f0c78eb5e4..bd19252e4d 100644 --- a/src/bindings/java/org/simgrid/msg/File.java +++ b/src/bindings/java/org/simgrid/msg/File.java @@ -44,7 +44,7 @@ public class File { * Close the file. */ public native void close(); - + /** * Class initializer, to initialize various JNI stuff */ diff --git a/src/bindings/java/org/simgrid/msg/Host.java b/src/bindings/java/org/simgrid/msg/Host.java index 07dace87a8..bfa1997a57 100644 --- a/src/bindings/java/org/simgrid/msg/Host.java +++ b/src/bindings/java/org/simgrid/msg/Host.java @@ -58,17 +58,17 @@ public class Host { * User data. */ private Object data; - /** - * - */ - protected Host() { + /** + * + */ + protected Host() { this.bind = 0; this.data = null; }; - + public String toString (){ return this.name; - + } /** @@ -78,11 +78,11 @@ public class Host { * @param name The name of the host to get. * * @return The host object with the given name. - * @exception HostNotFoundException if the name of the host is not valid. + * @exception HostNotFoundException if the name of the host is not valid. * NativeException if the native version of this method failed. */ public native static Host getByName(String name) - throws HostNotFoundException, NullPointerException; + throws HostNotFoundException, NullPointerException; /** * This static method returns the count of the installed hosts. * @@ -105,18 +105,18 @@ public class Host { */ public native static Host[] all(); - /** - * This static method sets a mailbox to receive in asynchronous mode. - * - * All messages sent to this mailbox will be transferred to - * the receiver without waiting for the receive call. - * The receive call will still be necessary to use the received data. - * If there is a need to receive some messages asynchronously, and some not, - * two different mailboxes should be used. - * - * @param mailboxName The name of the mailbox - */ - public static native void setAsyncMailbox(String mailboxName); + /** + * This static method sets a mailbox to receive in asynchronous mode. + * + * All messages sent to this mailbox will be transferred to + * the receiver without waiting for the receive call. + * The receive call will still be necessary to use the received data. + * If there is a need to receive some messages asynchronously, and some not, + * two different mailboxes should be used. + * + * @param mailboxName The name of the mailbox + */ + public static native void setAsyncMailbox(String mailboxName); /** @@ -130,25 +130,25 @@ public class Host { /** * Sets the data of the host. - * @param data - */ + * @param data + */ public void setData(Object data) { this.data = data; } /** * Gets the data of the host. - * - * @return The data object associated with the host. - */ + * + * @return The data object associated with the host. + */ public Object getData() { return this.data; } /** * Checks whether a host has data. - * - * @return True if the host has an associated data object. - */ + * + * @return True if the host has an associated data object. + */ public boolean hasData() { return null != this.data; } @@ -193,28 +193,28 @@ public class Host { * Returns the value of a given host property. */ public native String getProperty(String name); - + /** * Change the value of a given host property. */ public native void setProperty(String name, String value); - + /** This method tests if a host is up and running. * @return True if the host is available. */ public native boolean isOn(); /** This methods returns the list of mount point names on an host - * @return An array containing all mounted storages on the host - */ + * @return An array containing all mounted storages on the host + */ public native Storage[] getMountedStorage(); /** This methods returns the list of storages attached to an host - * @return An array containing all storages (name) attached to the host - */ + * @return An array containing all storages (name) attached to the host + */ public native String[] getAttachedStorage(); - - + + /** * Class initializer, to initialize various JNI stuff */ diff --git a/src/bindings/java/org/simgrid/msg/Msg.java b/src/bindings/java/org/simgrid/msg/Msg.java index 6cdc8944e1..8153a4241d 100644 --- a/src/bindings/java/org/simgrid/msg/Msg.java +++ b/src/bindings/java/org/simgrid/msg/Msg.java @@ -9,11 +9,6 @@ package org.simgrid.msg; import org.simgrid.NativeLib; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.File; - public final class Msg { /* Statically load the library which contains all native functions used in here */ diff --git a/src/bindings/java/org/simgrid/msg/MsgException.java b/src/bindings/java/org/simgrid/msg/MsgException.java index 166d5e3a76..bebfe327f4 100644 --- a/src/bindings/java/org/simgrid/msg/MsgException.java +++ b/src/bindings/java/org/simgrid/msg/MsgException.java @@ -19,21 +19,21 @@ package org.simgrid.msg; * --> */ public abstract class MsgException extends Exception { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * Constructs an MsgException without a - * detail message. - */ - public MsgException() { - super(); - } - /** - * Constructs an MsgException with a detail message. - * - * @param s the detail message. - */ - public MsgException(String s) { - super(s); - } + /** + * Constructs an MsgException without a + * detail message. + */ + public MsgException() { + super(); + } + /** + * Constructs an MsgException with a detail message. + * + * @param s the detail message. + */ + public MsgException(String s) { + super(s); + } } diff --git a/src/bindings/java/org/simgrid/msg/Mutex.java b/src/bindings/java/org/simgrid/msg/Mutex.java index 96dca06a4b..fbcb6340a2 100644 --- a/src/bindings/java/org/simgrid/msg/Mutex.java +++ b/src/bindings/java/org/simgrid/msg/Mutex.java @@ -12,7 +12,7 @@ package org.simgrid.msg; */ public class Mutex { private long bind; // The C object -- don't touch it - + public Mutex() { init(); } @@ -23,7 +23,7 @@ public class Mutex { private native void init(); public native void acquire(); public native void release(); - + /** * Class initializer, to initialize various JNI stuff */ diff --git a/src/bindings/java/org/simgrid/msg/Process.java b/src/bindings/java/org/simgrid/msg/Process.java index d5678d7e8c..abfcef99d6 100644 --- a/src/bindings/java/org/simgrid/msg/Process.java +++ b/src/bindings/java/org/simgrid/msg/Process.java @@ -5,7 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; - + import java.util.Arrays; import java.util.Vector; @@ -56,14 +56,14 @@ public abstract class Process implements Runnable { * It is used to compute the id of an MSG process. */ public static long nextProcessId = 0; - + /** * Even if this attribute is public you must never access to it. * It is compute automatically during the creation of the object. * The native functions use this identifier to synchronize the process. */ public long id; - + /** * Start time of the process */ @@ -72,14 +72,14 @@ public abstract class Process implements Runnable { * Kill time of the process */ public double killTime = -1; - + /** * The name of the process. */ protected String name; /** - * The PID of the process - */ + * The PID of the process + */ protected int pid = -1; /** * The PPID of the process @@ -93,7 +93,7 @@ public abstract class Process implements Runnable { /** The arguments of the method function of the process. */ public Vector args; - + /** * Default constructor */ @@ -128,8 +128,8 @@ public abstract class Process implements Runnable { * @param args The arguments of the main function of the process. * * @exception HostNotFoundException if no host with this name exists. - * NativeException - * @throws NativeException + * NativeException + * @throws NativeException * */ public Process(String hostname, String name, String args[]) throws HostNotFoundException, NativeException { @@ -186,7 +186,7 @@ public abstract class Process implements Runnable { this.args = new Vector(); if (null != args) this.args.addAll(Arrays.asList(args)); - + this.startTime = startTime; this.killTime = killTime; } @@ -291,13 +291,13 @@ public abstract class Process implements Runnable { * Returns the value of a given process property. */ public native String getProperty(String name); - + /** * Set the kill time of the process * @param killTime the time when the process is killed */ public native void setKillTime(double killTime); - + /** * This static method returns the currently running process. * @@ -336,27 +336,27 @@ public abstract class Process implements Runnable { */ public native void waitFor(double seconds) throws HostFailureException; /** - * - */ - public void showArgs() { + * + */ + public void showArgs() { Msg.info("[" + this.name + "/" + this.getHost().getName() + "] argc=" + this.args.size()); for (int i = 0; i < this.args.size(); i++) Msg.info("[" + this.msgName() + "/" + this.getHost().getName() + "] args[" + i + "]=" + this.args.get(i)); } - /** - * This method actually creates and run the process. - * It is a noop if the process is already launched. - * @throws HostNotFoundException - */ - public final void start() throws HostNotFoundException { - if (!started) { - started = true; - create(host.getName()); - } - } - + /** + * This method actually creates and run the process. + * It is a noop if the process is already launched. + * @throws HostNotFoundException + */ + public final void start() throws HostNotFoundException { + if (!started) { + started = true; + create(host.getName()); + } + } + /** * This method runs the process. Il calls the method function that you must overwrite. */ @@ -377,17 +377,17 @@ public abstract class Process implements Runnable { Msg.info("Unexpected behavior. Stopping now"); System.exit(1); } - catch(ProcessKilledError pk) { + catch(ProcessKilledError pk) { } exit(); } /** * The main function of the process (to implement). - * - * @param args - * @throws MsgException - */ + * + * @param args + * @throws MsgException + */ public abstract void main(String[]args) throws MsgException; public native void exit(); diff --git a/src/bindings/java/org/simgrid/msg/RngStream.java b/src/bindings/java/org/simgrid/msg/RngStream.java index 6d5638c0f1..c7d3a5d837 100644 --- a/src/bindings/java/org/simgrid/msg/RngStream.java +++ b/src/bindings/java/org/simgrid/msg/RngStream.java @@ -51,7 +51,7 @@ public class RngStream { * Release the C RngStream object */ private native void destroy(); - + /** * Sets the initial seed of the package RngStreams to the six integers in the vector seed. This will * be the seed (initial state) of the first stream. If this procedure is not called, the default initial @@ -79,21 +79,21 @@ public class RngStream { */ public native void setAntithetic(boolean a); /** - * Sets the initial seed Ig of stream g to the vector seed. This vector must satisfy the same - * conditions as in setPackageSeed. The stream is then reset to this initial seed. The - * states and seeds of the other streams are not modified. As a result, after calling this procedure, - * the initial seeds of the streams are no longer spaced Z values apart. We discourage the use of - * this procedure. Returns false for invalid seeds, and true otherwise. + * Sets the initial seed Ig of stream g to the vector seed. This vector must satisfy the same + * conditions as in setPackageSeed. The stream is then reset to this initial seed. The + * states and seeds of the other streams are not modified. As a result, after calling this procedure, + * the initial seeds of the streams are no longer spaced Z values apart. We discourage the use of + * this procedure. Returns false for invalid seeds, and true otherwise. */ public native boolean setSeed(int seed[]); /** - * Advances the state of the stream by k values, without modifying the states of other streams (as - * in RngStream_SetSeed), nor the values of Bg and Ig associated with this stream. If e > 0, then - * k = 2e + c; if e < 0, then k = -2-e + c; and if e = 0, then k = c. Note: c is allowed to take - * negative values. We discourage the use of this procedure. - */ + * Advances the state of the stream by k values, without modifying the states of other streams (as + * in RngStream_SetSeed), nor the values of Bg and Ig associated with this stream. If e > 0, then + * k = 2e + c; if e < 0, then k = -2-e + c; and if e = 0, then k = c. Note: c is allowed to take + * negative values. We discourage the use of this procedure. + */ public native void advanceState(int e, int g); - + /** * Returns a (pseudo)random number from the uniform distribution over the interval (0, 1), after advancing the state by one step. The returned number has 32 bits of precision * in the sense that it is always a multiple of 1/(232 - 208), unless RngStream_IncreasedPrecis @@ -105,7 +105,7 @@ public class RngStream { * {i, i + 1, . . . , j} */ public native int randInt(int i, int j); - + /** * Class initializer, to initialize various JNI stuff */ diff --git a/src/bindings/java/org/simgrid/msg/Semaphore.java b/src/bindings/java/org/simgrid/msg/Semaphore.java index f8e4e1444c..d74a8bcc9d 100644 --- a/src/bindings/java/org/simgrid/msg/Semaphore.java +++ b/src/bindings/java/org/simgrid/msg/Semaphore.java @@ -12,73 +12,73 @@ package org.simgrid.msg; */ public class Semaphore { - private long bind; // The C object -- don't touch it - /** - * Semaphore capacity, defined when the semaphore is created. At most capacity - * process can acquire this semaphore at the same time. - */ - protected final int capacity; - /** - * Creates a new semaphore with the given capacity. At most capacity - * process can acquire this semaphore at the same time. - */ - public Semaphore(int capacity) { - init(capacity); - this.capacity = capacity; - } - /** The native implementation of semaphore initialization - */ - private native void init(int capacity); + private long bind; // The C object -- don't touch it + /** + * Semaphore capacity, defined when the semaphore is created. At most capacity + * process can acquire this semaphore at the same time. + */ + protected final int capacity; + /** + * Creates a new semaphore with the given capacity. At most capacity + * process can acquire this semaphore at the same time. + */ + public Semaphore(int capacity) { + init(capacity); + this.capacity = capacity; + } + /** The native implementation of semaphore initialization + */ + private native void init(int capacity); - /** Locks on the semaphore object until the provided timeout expires - * @exception TimeoutException if the timeout expired before - * the semaphore could be acquired. - */ - public native void acquire(double timeout) throws TimeoutException; - /** Locks on the semaphore object with no timeout - */ - public void acquire() { - try { - acquire(-1); - } catch (TimeoutException e) { - // This should not happen. - assert(false); + /** Locks on the semaphore object until the provided timeout expires + * @exception TimeoutException if the timeout expired before + * the semaphore could be acquired. + */ + public native void acquire(double timeout) throws TimeoutException; + /** Locks on the semaphore object with no timeout + */ + public void acquire() { + try { + acquire(-1); + } catch (TimeoutException e) { + // This should not happen. + assert(false); + } } - } - /** Releases the semaphore object - */ - public native void release(); - /** returns a boolean indicating it this semaphore would block at this very specific time - * - * Note that the returned value may be wrong right after the - * function call, when you try to use it... But that's a - * classical semaphore issue, and SimGrid's semaphores are not - * different to usual ones here. - */ - public native boolean wouldBlock(); + /** Releases the semaphore object + */ + public native void release(); + /** returns a boolean indicating it this semaphore would block at this very specific time + * + * Note that the returned value may be wrong right after the + * function call, when you try to use it... But that's a + * classical semaphore issue, and SimGrid's semaphores are not + * different to usual ones here. + */ + public native boolean wouldBlock(); - /** Returns the semaphore capacity - */ - public int getCapacity(){ - return this.capacity; - } + /** Returns the semaphore capacity + */ + public int getCapacity(){ + return this.capacity; + } - /** Deletes this semaphore - */ - protected void finalize() { - destroy(); - } - /** The native implementation for destroying a semaphore - */ - private native void destroy(); - /** - * Class initializer, to initialize various JNI stuff - */ - public static native void nativeInit(); - static { - Msg.nativeInit(); - nativeInit(); - } + /** Deletes this semaphore + */ + protected void finalize() { + destroy(); + } + /** The native implementation for destroying a semaphore + */ + private native void destroy(); + /** + * Class initializer, to initialize various JNI stuff + */ + public static native void nativeInit(); + static { + Msg.nativeInit(); + nativeInit(); + } } \ No newline at end of file diff --git a/src/bindings/java/org/simgrid/msg/Storage.java b/src/bindings/java/org/simgrid/msg/Storage.java index 9f5a45a2e4..1b7950163c 100644 --- a/src/bindings/java/org/simgrid/msg/Storage.java +++ b/src/bindings/java/org/simgrid/msg/Storage.java @@ -16,7 +16,7 @@ public class Storage { * access to it. */ private long bind; - + /** * Storage name */ @@ -26,19 +26,19 @@ public class Storage { * User data. */ private Object data; - /** - * - */ - protected Storage() { + /** + * + */ + protected Storage() { this.bind = 0; this.data = null; }; - + public String toString (){ return this.name; - + } - + /** * This static method gets a storage instance associated with a native * storage of your platform. This is the best way to get a java storage object. @@ -46,11 +46,11 @@ public class Storage { * @param name The name of the storage to get. * * @return The storage object with the given name. - * @exception StorageNotFoundException if the name of the storage is not valid. + * @exception StorageNotFoundException if the name of the storage is not valid. * NativeException if the native version of this method failed. */ public native static Storage getByName(String name) - throws HostNotFoundException, NullPointerException; + throws HostNotFoundException, NullPointerException; /** * This method returns the name of a storage. @@ -60,7 +60,7 @@ public class Storage { public String getName() { return name; } - + /** * This method returns the size (in bytes) of a storage element. * @@ -76,7 +76,7 @@ public class Storage { * */ public native long getFreeSize(); - + /** * This method returns the used size (in bytes) of a storage element. * @@ -84,18 +84,18 @@ public class Storage { * */ public native long getUsedSize(); - + /** * Returns the value of a given storage property. */ public native String getProperty(String name); - + /** * Change the value of a given storage property. */ public native void setProperty(String name, String value); - - + + /** * * Returns the host name the storage is attached to @@ -103,7 +103,7 @@ public class Storage { * @return the host name the storage is attached to */ public native String getHost(); - + /** * This static method returns all of the storages of the installed platform. * @@ -111,7 +111,7 @@ public class Storage { * */ public native static Storage[] all(); - + /** * Class initializer, to initialize various JNI stuff */ @@ -119,5 +119,5 @@ public class Storage { static { nativeInit(); } - + } \ No newline at end of file diff --git a/src/bindings/java/org/simgrid/msg/Task.java b/src/bindings/java/org/simgrid/msg/Task.java index c76e911deb..d3e2894337 100644 --- a/src/bindings/java/org/simgrid/msg/Task.java +++ b/src/bindings/java/org/simgrid/msg/Task.java @@ -72,7 +72,7 @@ public class Task { public Task(String name, Host[]hosts, double[]flopsAmount, double[]bytesAmount) { parallelCreate(name, hosts, flopsAmount, bytesAmount); } - + /** * The natively implemented method to create a MSG task. * @@ -89,7 +89,7 @@ public class Task { private final native void create(String name, double flopsAmount, double bytesAmount) - throws IllegalArgumentException; + throws IllegalArgumentException; /** * The natively implemented method to create a MSG parallel task. * @@ -104,21 +104,21 @@ public class Task { Host[]hosts, double[]flopsAmount, double[]bytesAmount) - throws NullPointerException, IllegalArgumentException; + throws NullPointerException, IllegalArgumentException; /* * * * * * Getters / Setters * * * * * */ - /** Gets the name of a task */ + /** Gets the name of a task */ public String getName() { return name; } - + /** Gets the sender of the task (or null if not sent yet) */ public native Process getSender(); - + /** Gets the source of the task (or null if not sent yet). */ public native Host getSource(); - + /** Gets the remaining amount of flops to execute in this task * * If it's ongoing, you get the exact amount at the present time. If it's already done, it's 0. @@ -138,7 +138,7 @@ public class Task { * @param priority The new priority of the task. */ public native void setPriority(double priority); - + /** Set the computation amount needed to process the task * * Warning if the execution is already started and ongoing, this call does nothing. @@ -157,12 +157,12 @@ public class Task { * * * */ /** * Executes a task on the location on which the current process is running. - * - * @throws HostFailureException - * @throws TaskCancelledException - */ + * + * @throws HostFailureException + * @throws TaskCancelledException + */ public native void execute() throws HostFailureException,TaskCancelledException; - + /** Bound a computation to a certain load */ public native void setBound(double load); @@ -184,24 +184,24 @@ public class Task { * * Communication-related * * * * * */ - /** Send the task asynchronously on the mailbox identified by the specified name, + /** Send the task asynchronously on the specified mailbox, * with no way to retrieve whether the communication succeeded or not * */ public native void dsendBounded(String mailbox, double maxrate); - /** Send the task asynchronously on the mailbox identified by the specified name, + /** Send the task asynchronously on the specified mailbox, * with no way to retrieve whether the communication succeeded or not * */ public native void dsend(String mailbox); - + /** - * Sends the task on the mailbox identified by the specified name + * Sends the task on the specified mailbox * - * @param mailbox - * @throws TimeoutException + * @param mailbox where to send the message + * @throws TimeoutException * @throws HostFailureException * @throws TransferFailureException */ @@ -210,41 +210,40 @@ public class Task { } /** - * Sends the task on the mailbox identified by the specified name (wait at most \a timeout seconds) + * Sends the task on the specified mailbox (wait at most \a timeout seconds) * - * @param mailbox - * @param timeout - * @exception NativeException if the retrieval fails. + * @param mailbox where to send the message + * @param timeout + * @exception NativeException if the retrieval fails. * @throws TimeoutException * @throws HostFailureException * @throws TransferFailureException */ public native void send(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException; - /** - * Sends the task on the mailbox identified by the specified alias (capping the sending rate to \a maxrate) + + /** Sends the task on the specified mailbox (capping the sending rate to \a maxrate) * - * @param alias - * @param maxrate - * @throws TransferFailureException - * @throws HostFailureException - * @throws TimeoutException + * @param mailbox where to send the message + * @param maxrate + * @throws TransferFailureException + * @throws HostFailureException + * @throws TimeoutException */ - public void sendBounded(String alias, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException { - sendBounded(alias,-1,maxrate); - } + public void sendBounded(String mailbox, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException { + sendBounded(mailbox,-1,maxrate); + } -/** - * Sends the task on the mailbox identified by the specified alias (capping the sending rate to \a maxrate) with a timeout + /** Sends the task on the specified mailbox (capping the sending rate to \a maxrate) with a timeout * - * @param alias - * @param timeout - * @param maxrate - * @throws TransferFailureException - * @throws HostFailureException - * @throws TimeoutException + * @param mailbox where to send the message + * @param timeout + * @param maxrate + * @throws TransferFailureException + * @throws HostFailureException + * @throws TimeoutException */ - public native void sendBounded(String alias, double timeout, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException; + public native void sendBounded(String mailbox, double timeout, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException; /** @@ -256,7 +255,7 @@ public class Task { * Sends the task on the mailbox asynchronously (capping the sending rate to \a maxrate) */ public native Comm isendBounded(String mailbox, double maxrate); - + /** * Starts listening for receiving a task from an asynchronous communication @@ -266,7 +265,7 @@ public class Task { /** * Retrieves next task from the mailbox identified by the specified name * - * @param mailbox + * @param mailbox */ public static Task receive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException { @@ -276,8 +275,8 @@ public class Task { /** * Retrieves next task on the mailbox identified by the specified name (wait at most \a timeout seconds) * - * @param mailbox - * @param timeout + * @param mailbox + * @param timeout */ public static Task receive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException { return receive(mailbox, timeout, null); @@ -286,8 +285,8 @@ public class Task { /** * Retrieves next task sent by a given host on the mailbox identified by the specified alias * - * @param mailbox - * @param host + * @param mailbox + * @param host */ public static Task receive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException { @@ -297,9 +296,9 @@ public class Task { /** * Retrieves next task sent by a given host on the mailbox identified by the specified alias (wait at most \a timeout seconds) * - * @param mailbox - * @param timeout - * @param host + * @param mailbox + * @param timeout + * @param host */ public native static Task receive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException; @@ -311,7 +310,7 @@ public class Task { /** * Retrieves next task from the mailbox identified by the specified name with a capped rate * - * @param mailbox + * @param mailbox */ public static Task receiveBounded(String mailbox, double rate) throws TransferFailureException, HostFailureException, TimeoutException { @@ -321,8 +320,8 @@ public class Task { /** * Retrieves next task on the mailbox identified by the specified name (wait at most \a timeout seconds) with a capped rate * - * @param mailbox - * @param timeout + * @param mailbox + * @param timeout */ public static Task receiveBounded(String mailbox, double timeout, double rate) throws TransferFailureException, HostFailureException, TimeoutException { return receiveBounded(mailbox, timeout, null, rate); @@ -331,8 +330,8 @@ public class Task { /** * Retrieves next task sent by a given host on the mailbox identified by the specified alias with a capped rate * - * @param mailbox - * @param host + * @param mailbox + * @param host */ public static Task receiveBounded(String mailbox, Host host, double rate) throws TransferFailureException, HostFailureException, TimeoutException { @@ -343,28 +342,28 @@ public class Task { * Retrieves next task sent by a given host on the mailbox identified by the specified alias (wait at most \a timeout seconds) * with a capped rate * - * @param mailbox - * @param timeout - * @param host + * @param mailbox + * @param timeout + * @param host */ public native static Task receiveBounded(String mailbox, double timeout, Host host, double rate) throws TransferFailureException, HostFailureException, TimeoutException; - - + + /** * Tests whether there is a pending communication on the mailbox identified by the specified alias, and who sent it - */ + */ public native static int listenFrom(String mailbox); /** * Listen whether there is a waiting task on the mailbox identified by the specified alias - */ + */ public native static boolean listen(String mailbox); /** * Counts the number of tasks waiting to be received on the \a mailbox identified by the specified alia and sended by the specified \a host. - */ + */ public native static int listenFromHost(String alias, Host host); - + /** * Class initializer, to initialize various JNI stuff */ diff --git a/src/bindings/java/org/simgrid/msg/VM.java b/src/bindings/java/org/simgrid/msg/VM.java index b858c49694..5efe9f2254 100644 --- a/src/bindings/java/org/simgrid/msg/VM.java +++ b/src/bindings/java/org/simgrid/msg/VM.java @@ -8,22 +8,20 @@ package org.simgrid.msg; -import org.simgrid.msg.Host; -import org.simgrid.msg.Process; public class VM extends Host{ // Please note that we are not declaring a new bind variable //(the bind variable has been inherited from the super class Host) - + /* Static functions */ // GetByName is inherited from the super class Host - - private static VM[] vms=null; - private Host currentHost; + + private static VM[] vms=null; + private Host currentHost; /* Constructors / destructors */ - /** + /** * Create a `basic' VM (i.e. 1 core, 1GB of RAM, other values are not taken into account). */ public VM(Host host, String name) { @@ -53,41 +51,41 @@ public class VM extends Host{ private static void addVM(VM vm){ VM[] vmsN=null; - int i=0; + int i=0; if(VM.vms == null) vmsN = new VM[1]; else vmsN = new VM[vms.length+1]; - + for (i=0; i