Class TerminateProcessException

  • All Implemented Interfaces:
    java.io.Serializable

    public class TerminateProcessException
    extends java.lang.RuntimeException
    This exception is thrown to terminate a process. This is only a notification exception that a ProcessDirector uses to terminate all the processes gracefully. It is not an exception that indicates an error in the code or model.

    In the process domains (PN and CSP for example), a simulation is terminated only when a deadlock is detected. During a deadlock, the threads corresponding to actors are normally blocked on a method call to the receiver. This exception is normally thrown from these methods, so that the threads can return from the call and terminate themselves.

    This class is a standalone class and not derived from the Ptolemy Runtime exceptions as those exceptions indicate an error in the model, while this exception is used for passing of information to the threads.

    Since:
    Ptolemy II 0.2
    Version:
    $Id$
    Author:
    Neil Smyth, Mudit Goel
    See Also:
    Serialized Form
    Pt.AcceptedRating:
    Yellow (mudit)
    Pt.ProposedRating:
    Green (mudit)
    • Constructor Summary

      Constructors 
      Constructor Description
      TerminateProcessException​(java.lang.String detail)
      Constructs an Exception with only a detail message.
      TerminateProcessException​(Nameable object, java.lang.String detail)
      Constructs an Exception with a detail message that includes the name of the first argument and the second argument string.
      TerminateProcessException​(Nameable object1, Nameable object2, java.lang.String detail)
      Constructs an Exception with a detail message that includes the names of the first two arguments plus the third argument string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String _getFullName​(Nameable object)
      Get the name of a Nameable object.
      protected java.lang.String _getName​(Nameable object)
      Get the name of a Nameable object.
      protected void _setMessage​(java.lang.String message)
      Sets the error message to the specified string.
      java.lang.String getMessage()
      Get the detail message.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TerminateProcessException

        public TerminateProcessException​(java.lang.String detail)
        Constructs an Exception with only a detail message.
        Parameters:
        detail - The message.
      • TerminateProcessException

        public TerminateProcessException​(Nameable object,
                                         java.lang.String detail)
        Constructs an Exception with a detail message that includes the name of the first argument and the second argument string.
        Parameters:
        object - The object.
        detail - The message.
      • TerminateProcessException

        public TerminateProcessException​(Nameable object1,
                                         Nameable object2,
                                         java.lang.String detail)
        Constructs an Exception with a detail message that includes the names of the first two arguments plus the third argument string.
        Parameters:
        object1 - The first object.
        object2 - The second object.
        detail - The message.
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
        Get the detail message.
        Overrides:
        getMessage in class java.lang.Throwable
      • _getFullName

        protected java.lang.String _getFullName​(Nameable object)
        Get the name of a Nameable object. This method attempts to use getFullName(), if it is defined, and resorts to getName() if it is not. If the argument is a null reference, return an empty string.
        Parameters:
        object - An object with a full name.
        Returns:
        The full name of the argument.
      • _getName

        protected java.lang.String _getName​(Nameable object)
        Get the name of a Nameable object. If the argument is a null reference, return an empty string.
        Parameters:
        object - An object with a name.
        Returns:
        The name of the argument.
      • _setMessage

        protected void _setMessage​(java.lang.String message)
        Sets the error message to the specified string.
        Parameters:
        message - The message.