Comm
Date: 2013-11-17

org.simgrid.msg

## Class Comm

- java.lang.Object
- - org.simgrid.msg.Comm

-     public class Comm
      extends java.lang.Object

  Communication action, representing an ongoing communication between processes.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `finished` Indicates if the communication is finished
    `protected boolean` | `receiving` Indicates if the communication is a receiving communication
    `protected Task` | `task` Task associated with the comm.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Comm()` Protected constructor, used by Comm factories in Task.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `destroy()` Unbind the communication object
    `protected void` | `finalize()` Finalize the communication object, destroying it.
    `Task` | `getTask()` Returns the task associated with the communication.
    `static void` | `nativeInit()` Class initializer, to initialize various JNI stuff
    `boolean` | `test()` Returns if the communication is finished or not.
    `void` | `waitCompletion()` Wait for the complemetion of the communication for an indefinite time
    `void` | `waitCompletion(double timeout)` Wait for the completion of the communication.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### receiving

          protected boolean receiving

      Indicates if the communication is a receiving communication

    - #### finished

          protected boolean finished

      Indicates if the communication is finished

    - #### task

          protected Task task

      Task associated with the comm. Beware, it can be null

  - ### Constructor Detail

    - #### Comm

          protected Comm()

      Protected constructor, used by Comm factories in Task.

  - ### Method Detail

    - #### finalize

          protected void finalize()
                           throws java.lang.Throwable

      Finalize the communication object, destroying it.
      Overrides:
        `finalize` in class `java.lang.Object`
      Throws:
        `java.lang.Throwable`

    - #### destroy

          protected void destroy()
                          throws NativeException

      Unbind the communication object
      Throws:
        `NativeException`

    - #### test

          public boolean test()
                       throws TransferFailureException,
                              HostFailureException,
                              TimeoutException

      Returns if the communication is finished or not. If the communication has finished and there was an error, raise an exception.
      Throws:
        `TransferFailureException`
        `HostFailureException`
        `TimeoutException`

    - #### waitCompletion

          public void waitCompletion()
                              throws TransferFailureException,
                                     HostFailureException,
                                     TimeoutException

      Wait for the complemetion of the communication for an indefinite time
      Throws:
        `TransferFailureException`
        `HostFailureException`
        `TimeoutException`

    - #### waitCompletion

          public void waitCompletion(double timeout)
                              throws TransferFailureException,
                                     HostFailureException,
                                     TimeoutException

      Wait for the completion of the communication. Throws an exception if there were an error in the communication.
      Parameters:
        `timeout` - Time before giving up
      Throws:
        `TransferFailureException`
        `HostFailureException`
        `TimeoutException`

    - #### getTask

          public Task getTask()

      Returns the task associated with the communication. if the communication isn't finished yet, will return null.

    - #### nativeInit

          public static void nativeInit()

      Class initializer, to initialize various JNI stuff