ptolemy.domains.pn.kernel.event
Class PNProcessEvent

java.lang.Object
  extended byptolemy.domains.pn.kernel.event.PNProcessEvent

public class PNProcessEvent
extends java.lang.Object

An 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: PNProcessEvent.java,v 1.19 2004/04/13 03:34:13 cxh Exp $
Author:
Mudit Goel
Accepted Rating:
Red
Proposed Rating:
Yellow (mudit)

Field Summary
static int BLOCKED_ON_DELAY
           
static int BLOCKED_ON_MUTATION
           
static int BLOCKED_ON_READ
           
static int BLOCKED_ON_WRITE
           
static int FINISHED_ABRUPTLY
           
static int FINISHED_PROPERLY
           
static int FINISHED_WITH_EXCEPTION
           
static int PROCESS_BLOCKED
           
static int PROCESS_FINISHED
           
static int PROCESS_PAUSED
           
static int PROCESS_RUNNING
           
 
Constructor Summary
PNProcessEvent(Actor actor, java.lang.Exception exception)
           
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.
 
Method Summary
 Actor getActor()
          Return the actor corresponding to the process that generated the event.
 int getBlockingCause()
           
 int getCurrentState()
           
 java.lang.Exception getException()
          Return the exception associated with the event.
 int getFinishingCause()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLOCKED_ON_DELAY

public static final int BLOCKED_ON_DELAY
See Also:
Constant Field Values

BLOCKED_ON_MUTATION

public static final int BLOCKED_ON_MUTATION
See Also:
Constant Field Values

BLOCKED_ON_READ

public static final int BLOCKED_ON_READ
See Also:
Constant Field Values

BLOCKED_ON_WRITE

public static final int BLOCKED_ON_WRITE
See Also:
Constant Field Values

FINISHED_ABRUPTLY

public static final int FINISHED_ABRUPTLY
See Also:
Constant Field Values

FINISHED_PROPERLY

public static final int FINISHED_PROPERLY
See Also:
Constant Field Values

FINISHED_WITH_EXCEPTION

public static final int FINISHED_WITH_EXCEPTION
See Also:
Constant Field Values

PROCESS_BLOCKED

public static final int PROCESS_BLOCKED
See Also:
Constant Field Values

PROCESS_FINISHED

public static final int PROCESS_FINISHED
See Also:
Constant Field Values

PROCESS_PAUSED

public static final int PROCESS_PAUSED
See Also:
Constant Field Values

PROCESS_RUNNING

public static final int PROCESS_RUNNING
See Also:
Constant Field Values
Constructor Detail

PNProcessEvent

public PNProcessEvent(Actor actor,
                      int state)
Create a new event

Parameters:
actor - The actor
state - 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.

PNProcessEvent

public PNProcessEvent(Actor actor,
                      java.lang.Exception exception)
Method Detail

getActor

public Actor getActor()
Return the actor corresponding to the process that generated the event.


getBlockingCause

public int getBlockingCause()

getCurrentState

public int getCurrentState()

getException

public java.lang.Exception getException()
Return the exception associated with the event.


getFinishingCause

public int getFinishingCause()

toString

public java.lang.String toString()