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
18 protected boolean receiving;
20 * Indicates if the communication is finished
22 protected boolean finished = false;
24 * Represents the bind between the java comm and the
25 * native C comm. You must never access it, since it is
30 * Represents the bind for the task object pointer. Don't touch it.
32 public long taskBind = 0;
34 * Task associated with the comm. Beware, it can be null
36 protected Task task = null;
38 * Protected constructor, used by Comm factories
45 * Finalize the communication object, destroying it.
47 protected void finalize() throws Throwable {
51 * Unbind the communication object
53 protected native void destroy() throws NativeException;
55 * Returns if the communication is finished or not.
56 * If the communication has finished and there was an error,
59 public native boolean test() throws TransferFailureException, HostFailureException, TimeoutException ;
61 * Wait for the completion of the communication.
62 * Throws an exception if there were an error in the communication.
64 public native void waitCompletion(double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
66 * Returns the task associated with the communication.
67 * if the communication isn't finished yet, will return null.
69 public Task getTask() {
74 * Class initializer, to initialize various JNI stuff
76 public static native void nativeInit();