bluej.extensions.event
Class InvocationEvent

java.lang.Object
  extended bybluej.extensions.event.InvocationEvent
All Implemented Interfaces:
ExtensionEvent

public class InvocationEvent
extends java.lang.Object
implements ExtensionEvent

This class encapsulates events generated when the construction or invocation of a BlueJ object finishes. An invocation may finish in a normal way or it may be interrupted. From this event you can extract the actual result of the invocation, and access the BlueJ classes and objects involved.

Version:
$Id: InvocationEvent.java,v 1.17 2003/08/04 20:36:21 iau Exp $

Field Summary
static int EXCEPTION_EXIT
          The execution finished due to an exception
static int FORCED_EXIT
          The execution finished through a call to System.exit()
static int NORMAL_EXIT
          The execution finished normally.
static int TERMINATED_EXIT
          The execution finished because the user forcefully terminated it
static int UNKNOWN_EXIT
           
 
Constructor Summary
InvocationEvent(bluej.debugmgr.ExecutionEvent exevent)
          Constructor for the event.
 
Method Summary
 java.lang.String getClassName()
          Returns the class name on which this invocation took place.
 int getInvocationStatus()
          Returns the invocation status.
 java.lang.String getMethodName()
          Returns the method name being called.
 java.lang.String getObjectName()
          Returns the instance name of the invoked object on the object bench.
 BPackage getPackage()
          Returns the package in which this invocation took place.
 java.lang.String[] getParameters()
          Returns the parameters of the invocation in string form.
 java.lang.Object getResult()
          Returns the newly created object (if any).
 java.lang.Class[] getSignature()
          Returns the signature of the invoked method or constructor.
 java.lang.String toString()
          Returns a meaningful description of this Event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_EXIT

public static final int UNKNOWN_EXIT
See Also:
Constant Field Values

NORMAL_EXIT

public static final int NORMAL_EXIT
The execution finished normally.

See Also:
Constant Field Values

FORCED_EXIT

public static final int FORCED_EXIT
The execution finished through a call to System.exit()

See Also:
Constant Field Values

EXCEPTION_EXIT

public static final int EXCEPTION_EXIT
The execution finished due to an exception

See Also:
Constant Field Values

TERMINATED_EXIT

public static final int TERMINATED_EXIT
The execution finished because the user forcefully terminated it

See Also:
Constant Field Values
Constructor Detail

InvocationEvent

public InvocationEvent(bluej.debugmgr.ExecutionEvent exevent)
Constructor for the event.

Method Detail

getInvocationStatus

public int getInvocationStatus()
Returns the invocation status. One of the values listed above.


getPackage

public BPackage getPackage()
Returns the package in which this invocation took place. Further information about the context of the event can be retrieved via the package object.


getClassName

public java.lang.String getClassName()
Returns the class name on which this invocation took place. If you need further information about this class you can obtain a BClass from BPackage.getBClass() using this name as a reference.


getObjectName

public java.lang.String getObjectName()
Returns the instance name of the invoked object on the object bench. If you need further information about this object you can obtain a BObject using BPackage.getObject() using this name as a reference. For a static method invocation, this method will return null. For a constructor call it will return the new instance name of the object on the object bench. For a method call it will return the name of the object on which the operation was invoked.


getMethodName

public java.lang.String getMethodName()
Returns the method name being called. Returns null if this is an invocation of a constructor.


getSignature

public java.lang.Class[] getSignature()
Returns the signature of the invoked method or constructor.


getParameters

public java.lang.String[] getParameters()
Returns the parameters of the invocation in string form. If a parameter really is a string, this will be either the name of the string instance, or a literal string enclosed in double quotes.


getResult

public java.lang.Object getResult()
Returns the newly created object (if any). If the object is one that can be put on the object bench it will be an instance of BObject.

Returns:
an Object of various types or null if the result type is void.

toString

public java.lang.String toString()
Returns a meaningful description of this Event.



BlueJ homepage