com.tibco.bw.poa.runtime
Interface AdviceController<N>


public interface AdviceController<N>

Provides methods to suspend and resume the execution of an asynchronous advice instance. An advice instance uses the setPending() method to signal the engine when it starts executing its business logic on a separate thread. This usually happens just before the advice implementation returns from its execute() method. While the asynchronous advice implementation is executing, the engine can execute other advice instances or activities, if such exist on parallel tracks in the process. The engine will not execute the next advice instance in the pipeline or the next activity on the same track before the asynchronous advice instance finishes executing. When the asynchronous advice instance finishes its business logic on the parallel thread, it signals back the engine this event by calling setReady().

Since:
1.0
See Also:
AsyncAdvice

Method Summary
 void setPending(long maxDelay)
          The advice instance should call this method from within its execute() method, right after it starts executing its business logic on a parallel thread and just before it returns from execute().
 boolean setReady(ReturnWrapper<N> result)
          The advice instance should call this method, from a parallel thread, once its business logic is completed.
 

Method Detail

setPending


void setPending(long maxDelay)
The advice instance should call this method from within its execute() method, right after it starts executing its business logic on a parallel thread and just before it returns from execute().

Once this method is called, the advice instance is placed into the pending state after it returns from its execute() method.

Parameters:
maxDelay - The maximum amount of time, in milliseconds, that the advice needs to finish executing its business logic. If this period expires prior to calling setReady(), the advice implementation's cancelled() method will be called.

setReady


boolean setReady(ReturnWrapper<N> result)

                 throws AspectException
The advice instance should call this method, from a parallel thread, once its business logic is completed. The advice implementation's postExecute() method will be invoked as a result of this call.

A call to this method would eventually cause an advice instance to leave the pending state and enter the ready state.

Parameters:
result - the result of the advice implementation
Returns:
returns true unless this call has been ignored because the advice is no longer in the pending state.
Throws:
AspectException


Copyright @ 2010, TIBCO Softwares (Inc). All right reserved