Package ptolemy.domains.pn.kernel.event
Class PNProcessEvent
- java.lang.Object
-
- ptolemy.domains.pn.kernel.event.PNProcessEvent
-
public class PNProcessEvent extends java.lang.ObjectAn event passed from a process executing under the PN semantics to a PNProcessListener. This is used to represent an event that happened during the execution of a topology. This event contains two pieces of information: the actor under the control of the process and an exception that might be thrown. The exception might not be a valid reference.- Since:
- Ptolemy II 0.3
- Version:
- $Id$
- Author:
- Mudit Goel
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Yellow (mudit)
-
-
Field Summary
Fields Modifier and Type Field Description static intBLOCKED_ON_DELAYA process is blocked on a delay.static intBLOCKED_ON_MUTATIONA process is blocked on a mutation.static intBLOCKED_ON_READA process is blocked on a read.static intBLOCKED_ON_WRITEA process is blocked on a write.static intFINISHED_ABRUPTLYA process finished abruptly.static intFINISHED_PROPERLYA process finished properly.static intFINISHED_WITH_EXCEPTIONA process finished with an exception.static intPROCESS_BLOCKEDThe process is in the blocked state.static intPROCESS_FINISHEDThe process is in the finished state.static intPROCESS_PAUSEDThe process is in the paused state.static intPROCESS_RUNNINGThe process is in the running state.
-
Constructor Summary
Constructors Constructor Description PNProcessEvent(Actor actor, int state)Create a new event.PNProcessEvent(Actor actor, int state, int cause)Create a new event that corresponds to an exception caught by the process.PNProcessEvent(Actor actor, java.lang.Exception exception)Create a new event that corresponds to an exception caught by the process.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActorgetActor()Return the actor corresponding to the process that generated the event.intgetBlockingCause()Return the cause of the blocking state.intgetCurrentState()Return the current state.java.lang.ExceptiongetException()Return the exception associated with the event.intgetFinishingCause()Return the cause of the finishing state.java.lang.StringtoString()Return the string value of this event.
-
-
-
Field Detail
-
BLOCKED_ON_DELAY
public static final int BLOCKED_ON_DELAY
A process is blocked on a delay.- See Also:
- Constant Field Values
-
BLOCKED_ON_MUTATION
public static final int BLOCKED_ON_MUTATION
A process is blocked on a mutation.- See Also:
- Constant Field Values
-
BLOCKED_ON_READ
public static final int BLOCKED_ON_READ
A process is blocked on a read.- See Also:
- Constant Field Values
-
BLOCKED_ON_WRITE
public static final int BLOCKED_ON_WRITE
A process is blocked on a write.- See Also:
- Constant Field Values
-
FINISHED_ABRUPTLY
public static final int FINISHED_ABRUPTLY
A process finished abruptly.- See Also:
- Constant Field Values
-
FINISHED_PROPERLY
public static final int FINISHED_PROPERLY
A process finished properly.- See Also:
- Constant Field Values
-
FINISHED_WITH_EXCEPTION
public static final int FINISHED_WITH_EXCEPTION
A process finished with an exception.- See Also:
- Constant Field Values
-
PROCESS_BLOCKED
public static final int PROCESS_BLOCKED
The process is in the blocked state.- See Also:
- Constant Field Values
-
PROCESS_FINISHED
public static final int PROCESS_FINISHED
The process is in the finished state.- See Also:
- Constant Field Values
-
PROCESS_PAUSED
public static final int PROCESS_PAUSED
The process is in the paused state.- See Also:
- Constant Field Values
-
PROCESS_RUNNING
public static final int PROCESS_RUNNING
The process is in the running state.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PNProcessEvent
public PNProcessEvent(Actor actor, int state)
Create a new event.- Parameters:
actor- The actorstate- The state of the actor, should be one of PROCESS_BLOCKED, PROCESS_FINISHED, PROCESS_PAUSED or PROCESS_RUNNING.
-
PNProcessEvent
public PNProcessEvent(Actor actor, int state, int cause)
Create a new event that corresponds to an exception caught by the process.- Parameters:
actor- The actor.state- The state of the actor, should be one of PROCESS_BLOCKED, PROCESS_FINISHED, PROCESS_PAUSED or PROCESS_RUNNING.cause- The cause of the state.
-
PNProcessEvent
public PNProcessEvent(Actor actor, java.lang.Exception exception)
Create a new event that corresponds to an exception caught by the process.- Parameters:
actor- The actor.exception- The exception.
-
-
Method Detail
-
getActor
public Actor getActor()
Return the actor corresponding to the process that generated the event.- Returns:
- the actor corresponding to the process that generated the event.
-
getBlockingCause
public int getBlockingCause()
Return the cause of the blocking state.- Returns:
- an integer representing the cause of the blocking state.
-
getCurrentState
public int getCurrentState()
Return the current state.- Returns:
- an integer representing the current state.
-
getException
public java.lang.Exception getException()
Return the exception associated with the event.- Returns:
- The exception associated with the event.
-
getFinishingCause
public int getFinishingCause()
Return the cause of the finishing state.- Returns:
- an integer representing the cause of the finishing state
-
toString
public java.lang.String toString()
Return the string value of this event.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string value of this event.
-
-