Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / bindings / java / org / simgrid / msg / Host.java
index a1d5736..c15b2af 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.simgrid.msg;
 
+import org.simgrid.msg.Storage;
+
 /**
  * A host object represents a location (any possible place) where a process may run. 
  * Thus it is represented as a physical resource with computing capabilities, some 
@@ -47,26 +49,19 @@ public class Host {
         * @see                         Host.getByName().
         */ 
        private long bind;
-       /**
-        * Host name
-        */
        protected String name;
 
-       /**
-        * User data.
-        */ 
+       /** User data. */ 
        private Object data;
-    /**
-     *
-     */
-    protected Host() {
+       protected Host() {
                this.bind = 0;
                this.data = null;
        };
-       
+
+       @Override
        public String toString (){
                return this.name; 
-               
+
        }
 
        /**
@@ -76,135 +71,82 @@ 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;
-       /**
-        * This static method returns the count of the installed hosts.
-        *
-        * @return                      The count of the installed hosts.
-        */ 
+                       throws HostNotFoundException, NullPointerException;
+       /** Counts the installed hosts. */ 
        public native static int getCount();
 
-       /**
-        * This static method return an instance to the host of the current process.
-        *
-        * @return                      The host on which the current process is executed.
-        */ 
+       /** Returns the host of the current process. */ 
        public native static Host currentHost();
 
-       /**
-        * This static method returns all of the hosts of the installed platform.
-        *
-        * @return                      An array containing all the hosts installed.
-        *
-        */ 
+       /** Returns all hosts of the installed platform. */ 
        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);
 
 
-       /**
-        * This method returns the name of a host.
-        * @return                      The name of the host.
-        *
-        */ 
+       /** Returns the name of an host. */ 
        public String getName() {
                return name;
        }
 
-       /**
-        * Sets the data of the host.
-     * @param data
-     */
+       /** Sets the user data of the host. */
        public void setData(Object data) {
                this.data = data;
        } 
-       /**
-        * Gets the data of the host.
-     *
-     * @return The data object associated with the host.
-     */
+       /** Gets the user data of the host. */
        public Object getData() {
                return this.data;
        }
-
-       /**
-        * Checks whether a host has data.
-     *
-     * @return True if the host has an associated data object.
-     */
+       /** Returns true if the host has an associated data object. */
        public boolean hasData() {
                return null != this.data;
        }
 
-       /**
-        * This method start the host if it is off
-        */ 
+       /** Starts the host if it is off */ 
        public native void on();
-
-       /**
-        * This method stop the host if it is on
-        */ 
+       /** Stops the host if it is on */ 
        public native void off();
 
 
        /**
-        * This method returns the number of tasks currently running on a host.
-        * The external load is not taken in account.
-        *
-        * @return                      The number of tasks currently running on a host.
-        */ 
-       public native int getLoad();
-
-       /**
-        * This method returns the speed of the processor of a host,
+        * This method returns the speed of the processor of a host (in flops),
         * regardless of the current load of the machine.
-        *
-        * @return                      The speed of the processor of the host in flops.
-        *
         */ 
        public native double getSpeed();
-
-       /**
-        * This method returns the number of core of a host.
-        *
-        * @return                      The speed of the processor of the host in flops.
-        *
-        */ 
+       /** Returns the number of core of a host. */ 
        public native double getCoreNumber();
 
-       /**
-        * Returns the value of a given host property. 
-        */
+       /** Returns the value of a given host property. */
        public native String getProperty(String name);
-       
-       /**
-        * Change the value of a given host property. 
-        */
+       /** Changes the value of a given host property. */
        public native void setProperty(String name, String value);
-    
-       /** This method tests if a host is available.
-     * @return True if the host is available.
-     */
-       public native boolean isAvail();
-       
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
+       /** Tests if an host is up and running. */
+       public native boolean isOn();
+
+       /** Returns the list of mount point names on an host */
+       public native Storage[] getMountedStorage();
+       /** This methods returns the list of storages (names) attached to an host */
+       public native String[] getAttachedStorage();
+
+       /** Returns the amount of Joules consumed by that host so far */
+       public native double getConsumedEnergy();
+
+       /** Class initializer, to initialize various JNI stuff */
        public static native void nativeInit();
        static {
                nativeInit();