-
- /**
- *
- */
- public void unschedule() {
- //Process.ifInterruptedStop();
- try {
- schedEnd.release();
- schedBegin.acquire();
- } catch (InterruptedException e) {
- }
- }
-
- /**
- *
- */
- public void schedule() {
- //System.err.println("Scheduling process in Java");
- //Process.ifInterruptedStop();
- try {
- schedBegin.release();
- schedEnd.acquire();
- } catch(InterruptedException e) {
- System.err.println("Got an interuption while scheduling process in Java");
- e.printStackTrace();
- }
- }
-
- /** Send the given task in the mailbox associated with the specified alias (waiting at most given time)
- * @param mailbox
- * @param task
- * @param timeout
- * @throws TimeoutException
- * @throws HostFailureException
- * @throws TransferFailureException */
- public void taskSend(String mailbox, Task task, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
- MsgNative.taskSend(mailbox, task, timeout);
- }
-
- /** Send the given task in the mailbox associated with the specified alias
- * @param mailbox
- * @param task
- * @throws TimeoutException
- * @throws HostFailureException
- * @throws TransferFailureException */
- public void taskSend(String mailbox, Task task) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
- MsgNative.taskSend(mailbox, task, -1);
- }
-
- /** Receive a task on mailbox associated with the specified mailbox
- * @param mailbox
- * @return
- * @throws TransferFailureException
- * @throws HostFailureException
- * @throws TimeoutException
- */
- public Task taskReceive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
- return MsgNative.taskReceive(mailbox, -1.0, null);
- }
-
- /** Receive a task on mailbox associated with the specified alias (waiting at most given time)
- * @param mailbox
- * @param timeout
- * @return
- * @throws TransferFailureException
- * @throws HostFailureException
- * @throws TimeoutException
- */
- public Task taskReceive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
- return MsgNative.taskReceive(mailbox, timeout, null);
- }
-
- /** Receive a task on mailbox associated with the specified alias from given sender
- * @param mailbox
- * @param host
- * @param timeout
- * @return
- * @throws TransferFailureException
- * @throws HostFailureException
- * @throws TimeoutException
- */
- public Task taskReceive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
- return MsgNative.taskReceive(mailbox, timeout, host);
- }
-
- /** Receive a task on mailbox associated with the specified alias from given sender
- * @param mailbox
- * @param host
- * @return
- * @throws TransferFailureException
- * @throws HostFailureException
- * @throws TimeoutException
- */
- public Task taskReceive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
- return MsgNative.taskReceive(mailbox, -1.0, host);