Package ptolemy.actor.process
Class TerminateProcessException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- ptolemy.actor.process.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.
-
-
-
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 classjava.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.
-
-