1 package org.simgrid.msg;
3 * Copyright 2012 The SimGrid team. All right reserved.
5 * This program is free software; you can redistribute
6 * it and/or modify it under the terms of the license
7 * (GNU LGPL) which comes with this package.
11 * Communication action, representing an ongoing communication
16 * Indicates if the communication is a receiving communication
20 * Represents the bind between the java comm and the
21 * native C comm. You must never access it, since it is
26 * Represents the bind for the task object pointer. Don't touch it.
28 public long taskBind = 0;
30 * Task associated with the comm. Beware, it can be null
32 protected Task task = null;
34 * Protected constructor, used by Comm factories
41 * Finalize the communication object, destroying it.
43 protected void finalize() throws Throwable {
47 * Unbind the communication object
49 public native void unbind() throws NativeException;
51 * Returns if the communication is finished or not.
52 * If the communication has finished and there was an error,
55 public native boolean test() throws TransferFailureException, HostFailureException, TimeoutException ;
57 * Wait for the completion of the communication.
58 * Throws an exception if there were an error in the communication.
60 public native void waitCompletion(double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
62 * Returns the task associated with the communication.
63 * if the communication isn't finished yet, will return null.
65 public Task getTask() {
70 * Class initializer, to initialize various JNI stuff
72 public static native void nativeInit();