package simgrid.msg;
-import java.lang.Thread;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.Vector;
/**
* A process may be defined as a code, with some private data, executing
* @param name The name of the process.
*
* @exception HostNotFoundException if no host with this name exists.
- * NativeException
+ *
*
*/
- public Process(String hostname, String name) throws HostNotFoundException, NativeException {
+ public Process(String hostname, String name) throws HostNotFoundException {
this(Host.getByName(hostname), name, null);
}
/**
* Suspends the process by suspending the task on which it was
* waiting for the completion.
*
- * @exception NativeException on error in the native SimGrid code
*/
- public void pause() throws NativeException {
+ public void pause() {
MsgNative.processSuspend(this);
}
/**
* Resumes a suspended process by resuming the task on which it was
* waiting for the completion.
*
- * @exception NativeException on error in the native SimGrid code
*
*/
- public void restart() throws NativeException {
+ public void restart() {
MsgNative.processResume(this);
}
/**
* @exception NativeException on error in the native SimGrid code
*
*/
- public Host getHost() throws NativeException {
+ public Host getHost() {
return MsgNative.processGetHost(this);
}
/**
*
* @return The PID of the process.
*
- * @exception NativeException on error in the native SimGrid code
*/
- public int getPID() throws NativeException {
+ public int getPID() {
return MsgNative.processGetPID(this);
}
/**
*
* @return The PID of the parent of the process.
*
- * @exception NativeException on error in the native SimGrid code
*/
- public int getPPID() throws NativeException {
+ public int getPPID() {
return MsgNative.processGetPPID(this);
}
/**
*
* @return The current process.
*
- * @exception NativeException on error in the native SimGrid code
*/
- public static Process currentProcess() throws NativeException {
+ public static Process currentProcess() {
return MsgNative.processSelf();
}
/**
*
* @param host The host where to migrate the process.
*
- * @exception NativeException on error in the native SimGrid code
*/
- public void migrate(Host host) throws NativeException {
+ public void migrate(Host host) {
MsgNative.processChangeHost(this, host);
}
/**
*
* @param seconds The time the current process must sleep.
*
- * @exception NativeException on error in the native SimGrid code
+ * @exception HostFailureException on error in the native SimGrid code
*/
- public static void waitFor(double seconds) throws NativeException {
+ public static void waitFor(double seconds) throws HostFailureException {
MsgNative.processWaitFor(seconds);
}
public void showArgs() {
* @throws TimeoutException
* @throws HostFailureException
* @throws TransferFailureException */
- public void taskSend(String mailbox, Task task, double timeout) throws NativeException, TransferFailureException, HostFailureException, TimeoutException {
+ public void taskSend(String mailbox, Task task, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
MsgNative.taskSend(mailbox, task, timeout);
}
* @throws TimeoutException
* @throws HostFailureException
* @throws TransferFailureException */
- public void taskSend(String mailbox, Task task) throws NativeException, TransferFailureException, HostFailureException, TimeoutException {
+ public void taskSend(String mailbox, Task task) throws TransferFailureException, HostFailureException, TimeoutException {
MsgNative.taskSend(mailbox, task, -1);
}
/** Receive a task on mailbox associated with the specified mailbox */
- public Task taskReceive(String mailbox) throws NativeException {
+ public Task taskReceive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
return MsgNative.taskReceive(mailbox, -1.0, null);
}
/** Receive a task on mailbox associated with the specified alias (waiting at most given time) */
- public Task taskReceive(String mailbox, double timeout) throws NativeException {
+ public Task taskReceive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
return MsgNative.taskReceive(mailbox, timeout, null);
}
/** Receive a task on mailbox associated with the specified alias from given sender */
- public Task taskReceive(String mailbox, double timeout, Host host) throws NativeException {
+ public Task taskReceive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
return MsgNative.taskReceive(mailbox, timeout, host);
}
/** Receive a task on mailbox associated with the specified alias from given sender*/
- public Task taskReceive(String mailbox, Host host) throws NativeException {
+ public Task taskReceive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
return MsgNative.taskReceive(mailbox, -1.0, host);
}
}