Examples of TerminateProcessException


Examples of ptolemy.actor.process.TerminateProcessException

     * is interrupted while waiting.
     */
    public static void waitForChange(RendezvousDirector director)
            throws TerminateProcessException {
        if (director.isStopRequested() || director._inWrapup) {
            throw new TerminateProcessException("Thread terminated.");
        }

        try {
            director.wait();
        } catch (InterruptedException e) {
            throw new TerminateProcessException("Thread interrupted.");
        }

        if (director.isStopRequested() || director._inWrapup) {
            throw new TerminateProcessException("Thread terminated.");
        }
    }
View Full Code Here

Examples of ptolemy.actor.process.TerminateProcessException

                return (RendezvousDirector) container.getExecutiveDirector();
            }
        } catch (NullPointerException ex) {
            // If a thread has a reference to a receiver with no director it
            // is an error so terminate the process.
            throw new TerminateProcessException(
                    "RendezvousReceiver: trying to "
                            + "rendezvous with a receiver with no "
                            + "director => terminate.");
        }
    }
View Full Code Here

Examples of ptolemy.actor.process.TerminateProcessException

            throws IllegalActionException {
        try {
            Thread.sleep(100);
        } catch (InterruptedException ex) {
            if (((ProcessDirector) actor.getDirector()).isStopFireRequested()) {
                throw new TerminateProcessException(actor, ex.getMessage());

                // Ignore
            } else {
                throw new IllegalActionException(actor, ex,
                        "InterruptedException during a sleeping thread.");
View Full Code Here

Examples of ptolemy.actor.process.TerminateProcessException

                            + "have the earliest time stamp.");
        }

        synchronized (_director) {
            if (_terminate) {
                throw new TerminateProcessException("");
            }

            Token token = super.get();

            // Need to mark any thread that is write blocked on
View Full Code Here

Examples of ptolemy.actor.process.TerminateProcessException

                    _director.threadUnblocked(_readPending, this,
                            DDEDirector.READ_BLOCKED);
                    _readPending = null;
                }

                throw new TerminateProcessException("");
            }
        }

        if (sendNullTokens) {
            timeKeeper.sendOutNullTokens(this);
View Full Code Here

Examples of ptolemy.actor.process.TerminateProcessException

                    _director.threadUnblocked(_writePending, this,
                            DDEDirector.WRITE_BLOCKED);
                    _writePending = null;
                }

                throw new TerminateProcessException(getContainer(),
                        "This receiver has been terminated during _put()");
            }
        }

        put(token, time);
View Full Code Here

Examples of ptolemy.actor.process.TerminateProcessException

                    }

                    if (_cancelDelay) {
                        // Throwing this exception is really not
                        // not necessary for a "well" written actor.
                        throw new TerminateProcessException("delay cancelled");
                    }
                }
            }
        } catch (InterruptedException ex) {
            throw new TerminateProcessException("CSPActor interrupted "
                    + "while delayed.");
        }
    }
View Full Code Here

Examples of ptolemy.actor.process.TerminateProcessException

                while (_delayed) {
                    director.wait();
                }
            }
        } catch (InterruptedException ex) {
            throw new TerminateProcessException("CSPActor interrupted "
                    + "while waiting for deadlock.");
        }
    }
View Full Code Here

Examples of ptolemy.actor.process.TerminateProcessException

                    director.wait();
                }
            }
            if (_successfulBranch == -1) {
                // Conditional construct was ended prematurely
                throw new TerminateProcessException(((Nameable) getParent())
                        .getName()
                        + ": exiting conditional"
                        + " branching due to TerminateProcessException.");
            }

            _threadList = null;

            // Is it necessary to copy this? Note the finally clause below.
            int result = _successfulBranch;
            if (_debugging) {
                _debug("** Succeessful branch: " + result);
            }
            return result;
        } catch (InterruptedException ex) {
            throw new TerminateProcessException(((Nameable) getParent())
                    .getName()
                    + ".chooseBranch interrupted.");
        } finally {
            _branches = null;
            _successfulBranch = -1;
View Full Code Here

Examples of ptolemy.actor.process.TerminateProcessException

                if (successfulBranch == -1) {
                    // all guards false so exit CDO
                    continueCDO = false;
                } else if (!flag) {
                    throw new TerminateProcessException(getName() + ": "
                            + "invalid branch id returned during execution "
                            + "of CDO.");
                }

                count++;
            }
        } catch (IllegalActionException ex) {
            throw new TerminateProcessException(getName() + ": could not "
                    + "create all branches for CDO.");
        }

        return;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.