com.tibco.bw.poa.runtime
Class SyncAdvice<I,U,N extends I,A extends I,S,T,X>

java.lang.Object
  extended by com.tibco.bw.poa.runtime.Advice<I,U,N,A,S,T,X>
      extended by com.tibco.bw.poa.runtime.SyncAdvice<I,U,N,A,S,T,X>

public abstract class SyncAdvice<I,U,N extends I,A extends I,S,T,X>
extends Advice<I,U,N,A,S,T,X>

The base class of all synchronous advice implementations.

The synchronous advice invocation model is designed for advice implementations that execute almost instantaneously. These are usually advice implementation that do not communicate with external systems, do not perform I/O operations during their execution and do not perform tasks that could potentially bring down the performance of a BW application.

A synchronous advice implementation executes its business logic on the engine job thread. The BusinessWorks engine holds the job thread until an advice instance completes its execution, which means that no other advices or activities are executed on the job thread during that time. Therefore, an advice that is slow in generating its response can significantly affect the performance of a BW application if it is implemented as a synchronous advice implementation.

An advice implementation that communicates with external systems, performs I/O operations or execute tasks that take some time to execute should be implemented as an asynchronous advice implementation. For more information, see AsyncAdvice.

Since:
1.0
See Also:
AsyncAdvice, Advice

Constructor Summary
SyncAdvice()
           
 
Method Summary
abstract  N execute(N input, AspectProcessContext<I,U,N,A,S,T,X> context)
          Executes the advice implementation.
 boolean isSynchronous()
          Always returns true since this is a synchronous advice implementation.
 
Methods inherited from class com.tibco.bw.poa.runtime.Advice
destroy, getAdviceContext, init, resumeFromHibernate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncAdvice

public SyncAdvice()
Method Detail

isSynchronous

public final boolean isSynchronous()
Always returns true since this is a synchronous advice implementation.

Specified by:
isSynchronous in class Advice<I,U,N extends I,A extends I,S,T,X>
Returns:
true if the advice implementation is synchronous; false otherwise.

execute

public abstract N execute(N input,
                          AspectProcessContext<I,U,N,A,S,T,X> context)
                             throws AspectException
Executes the advice implementation.

An advice implementation must pay very close attention to concurrency issues since it executes in a multi-threaded environment. The BusinessWorks engine can call this method multiple times simultaneously, on the same advice instance, usually once for each job that gets executed (for the process this advice belong to). If the advice instance is not in the execution path of a job, this method is not called for that particular job. If the advice instance executes in a loop, this method may be called multiple times for the same job.

The XML document that is passed as an input parameter is the document that is available in the join point where the advice instance is executing.

An advice implementation that mutates the input XML document must ensure that the new XML document is still valid against the XML schema that describes the incoming XML document.

An advice implementation that does not mutate the incoming XML document must return the input XML document.

Parameters:
input - the input XML document
context - the context associated with the job (i.e. process instance)
Throws:
AspectException


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