startMethodTracking

startMethodTracking(targetMethod:    Method;
                    preambleMethod:  Method;
                    postambleMethod: Method;
                    receiver:        Object);

The startMethodTracking method of the Process class initiates method tracking for the receiving process by automatically invoking a specified method just before the specified target method is called and invoking another method just after the target method has returned from execution.

The receiving Process instance can be any current process including the current process. The parameters of the startMethodTracking method are listed in the following table.

Parameter Description
targetMethod Method to be tracked
preambleMethod Method to be invoked just before calling the target method
postambleMethod Method to be invoked just after returning from executing the target method (that is, after any epilog code in the target method has been executed)
receiver Receiver for the preamble and postamble methods

The preambleMethod and postambleMethod methods must have the following signature:

method(paramList: ParamListType);

When invoked, the paramList parameter contains a list of parameters matching those of the method being tracked.

The following methods cannot be tracked.

Method tracking is not currently supported for serverExecution methods.

To avoid repeated calls and kernel stack overflow exceptions, the tracking method should not track itself or any of the methods it calls.

For more details about method tracking, see Chapter 17, "Tracking Methods", in the Developer's Reference.