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


public interface AspectProcessContext<I,U,N extends I,A extends I,S,T,X>

The context associated with a particular BusinessWorks process instance (i.e job). An advice instance can use this context to get access to job specific information.

This class is not thread safe. Asynchronous advice implementations should not access objects of this class on parallel threads.

Since:
1.0
See Also:
AspectProcessContextListener

Method Summary
 void addListener(AspectProcessContextListener listener)
          Adds a listener to the AspectProcessContext.
 AdviceContext<I,U,N,A,S,T,X> getCurrentRunningAdviceContext()
          Returns the advice context of the advice instance that is currently being executed in this process instance.
 long getHibernateDelay()
          Returns the maxdelay specified while calling setHibernateJobEnabled()
 java.lang.String getInvocationPath()
          Returns the Invocation path for advice being executed.
 long getProcessInstanceID()
          Returns the job's ID, which is unique in the context of the engine.
 java.io.Serializable getProcessObject(java.lang.String key)
          Retrieves the object identified by the key
 boolean isHibernateJobEnabled()
          Called to check if an advice has called for the job to be hibernated.
 boolean removeListener(AspectProcessContextListener listener)
          Removes the listener from the AspectProcessContext.
 java.io.Serializable removeProcessObject(java.lang.String key)
          Removes the object identified by the key from storage
 void setHibernateJobEnabled(long timedelay)
          An advice implementation that hibernates jobs calls this method to trigger the hibernation of a particular job.
 void storeProcessObject(java.lang.String key, java.io.Serializable obj)
          Stores an object, by key, so that object will be available elsewhere in the process
 

Method Detail

getProcessInstanceID

long getProcessInstanceID()
Returns the job's ID, which is unique in the context of the engine.

Returns:
the job's ID

setHibernateJobEnabled

void setHibernateJobEnabled(long timedelay)
An advice implementation that hibernates jobs calls this method to trigger the hibernation of a particular job. Once called this cannot be reversed.

The job may not get hibernated right away. The engine must finish executing all advices that are part of the same join point before initiating the hibernate procedure. Even after that, the job may still not get hibernated right away. The advice that triggers the hibernation may choose to delay it, in order to give the chance to any asynchronous advice or any asynchronous activity that might exist in the job on parallel tracks to finish executing. To accomplish that, the advice implementation must call this method by passing a timedelay greater than 0. A 0 timedelay ensures that the hibernation is initiated right after the engine finishes executing all advices that are running in that particular join point.

Parameters:
timedelay - the time, in millisecond, to wait once all advices in the join point are executed, before the job is hibernated

isHibernateJobEnabled

boolean isHibernateJobEnabled()
Called to check if an advice has called for the job to be hibernated.


storeProcessObject

void storeProcessObject(java.lang.String key,
                        java.io.Serializable obj)
Stores an object, by key, so that object will be available elsewhere in the process

XML Documents can be stored by using XmlDocumentWrapper objects.

Parameters:
key - unique id for the object
obj - the object to store
See Also:
XmlDocumentWrapper

getProcessObject

java.io.Serializable getProcessObject(java.lang.String key)
Retrieves the object identified by the key

Parameters:
key - unique id for the object
Returns:
the object identified by the key, or null if no such object exists

removeProcessObject

java.io.Serializable removeProcessObject(java.lang.String key)
Removes the object identified by the key from storage

Parameters:
key - unique if of the object to be removed
Returns:
the object that was removed, or null if no such object existed, and therefore, was not removed

addListener

void addListener(AspectProcessContextListener listener)
Adds a listener to the AspectProcessContext. The listener will be notified when the job finishes executing.

Parameters:
listener - the listener to add

removeListener

boolean removeListener(AspectProcessContextListener listener)
Removes the listener from the AspectProcessContext.

Parameters:
listener - the listener to be removed
Returns:
true if listener was removed, otherise, false

getHibernateDelay

long getHibernateDelay()
Returns the maxdelay specified while calling setHibernateJobEnabled()

Returns:
maxdelay set for hibernation
See Also:
setHibernateJobEnabled()

getCurrentRunningAdviceContext

AdviceContext<I,U,N,A,S,T,X> getCurrentRunningAdviceContext()
Returns the advice context of the advice instance that is currently being executed in this process instance.

This method must be used to get the advice context by all advices that don't have the ADVICE scope.

Returns:

getInvocationPath

java.lang.String getInvocationPath()
Returns the Invocation path for advice being executed.

Returns:
Since:
1.1


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