|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tibco.bw.poa.runtime.Advice<I,U,N,A,S,T,X>
public abstract class Advice<I,U,N extends I,A extends I,S,T,X>
The base runtime class of all Java advice implementations that execute in BusinessWorks. An advice implementation must not extend this class directly. Instead, an advice implementation must extend one of the two extensions of this class, described bellow.
There are two flavors of advice implementations:
The Advice class is extended by two classes, SyncAdvice
and AsyncAdvice
, which are the base classes of all
advice implementations that are deployed in BusinessWorks. An advice implementation must extend one of these two classes.
An advice implementation Java class must have the AdviceImpl
annotation
defined at the class level. The BusinessWorks engine throws an exception at runtime if it finds an advice implemented with
a class that is not properly annotated. Here is an example of a properly annotated advice implementation java class:
@AdviceImpl
public class MyAdviceImplementation ... { }
At runtime, the BusinessWorks engine instantiates an advice implementation class based on the scope parameter specified
in the AdviceImpl
annotation.
SyncAdvice
,
AsyncAdvice
,
AdviceImpl
Constructor Summary | |
---|---|
Advice()
|
Method Summary | |
---|---|
void |
destroy(AdviceContext<I,U,N,A,S,T,X> context)
Destroys the advice instance. |
AdviceContext<I,U,N,A,S,T,X> |
getAdviceContext()
Returns the context associated with this advice instance. |
void |
init(AdviceContext<I,U,N,A,S,T,X> context)
Initializes the advice instance. |
abstract boolean |
isSynchronous()
Returns true if the advice is executed synchronously on the job thread. |
N |
resumeFromHibernate(N input,
AspectProcessContext<I,U,N,A,S,T,X> context)
This method is called when a job is resumed from the hibernate state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Advice()
Method Detail |
---|
public abstract boolean isSynchronous()
true
if the advice implementation is synchronous;
false
otherwise.public void init(AdviceContext<I,U,N,A,S,T,X> context) throws AspectException
The BusinessWorks engine can call this method multiple times, once for each advice instance that is associated with this advice implementation java object. This happens when two or more advices share the same implementation and the implementation class is stateful (i.e. is configured with scope APPLICATION). The engine never calls this method concurrently, though.
This method is always called right after the advice instance has been configured and before the advice instance is executed.
An advice implementation must call super.init()
if it overrides this method.
context
- the context of the advice instance that is being initialized
AspectException
public AdviceContext<I,U,N,A,S,T,X> getAdviceContext()
A stateful advice implementation cannot use this method to get access to the advice context. It must use
AspectProcessContext.getCurrentRunningAdviceContext()
instead.
public N resumeFromHibernate(N input, AspectProcessContext<I,U,N,A,S,T,X> context) throws AspectException
Any exception thrown by the advice implementation in this method will not be propagated back to the job that is about to be resumed.
This method is called by the engine only on the advice instance that has triggered the hibernation.
An advice implementation that receives this event cannot interact with the engine in an asynchronous way. The
AspectProcessContext
does not have an AdviceController
that could be used to interact with the engine.
input
- the XML document that was available in the join point where hibernate was triggered, just before the process
instance was hibernatedcontext
- the context associated with the process instance that is about to be resumed
AspectException
public void destroy(AdviceContext<I,U,N,A,S,T,X> context) throws AspectException
This method is always called by the engine before the advice instance is destroyed, in order to give it the opportunity to react to the destroy event.
context
- the context of the advice instance that is being destroyed
AspectException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |