org.apache.ode.bpel.runtime.extension
Class AbstractLongRunningExtensionOperation

java.lang.Object
  extended by org.apache.ode.jacob.JacobObject
      extended by org.apache.ode.jacob.JacobRunnable
          extended by org.apache.ode.bpel.runtime.BpelJacobRunnable
              extended by org.apache.ode.bpel.runtime.extension.AbstractLongRunningExtensionOperation
All Implemented Interfaces:
java.io.Serializable, ExtensionOperation

public abstract class AbstractLongRunningExtensionOperation
extends BpelJacobRunnable
implements ExtensionOperation

See Also:
Serialized Form

Field Summary
protected  java.lang.String _cid
           
protected  org.w3c.dom.Element _element
           
protected  ExtensionContext _extensionContext
           
protected static org.apache.commons.logging.Log _log
           
 
Constructor Summary
AbstractLongRunningExtensionOperation()
           
 
Method Summary
abstract  void onRequestReceived(java.lang.String mexId)
          Called when the response for the above service is received
 void registerForNotification(java.lang.String notificationChannelId)
          Extension should be registered with correlation values, notification id in order to find a route for the response message TODO we may remove this method by introducing another method to set correlatorID.
 void run()
           
 void run(java.lang.Object context, java.lang.String cid, org.w3c.dom.Element element)
           
abstract  void runAsync(ExtensionContext context, java.lang.String cid, org.w3c.dom.Element element)
          Implementation of the extension.
 void setCid(java.lang.String cid)
           
 void setElement(org.w3c.dom.Element tempElement)
           
 void setExtensionContext(ExtensionContext extensionContext)
           
 void updateExtensionContext(BpelRuntimeContext context)
           
 
Methods inherited from class org.apache.ode.bpel.runtime.BpelJacobRunnable
createChild, createFault, createFault, createFault, genMonotonic, getBpelRuntimeContext, initializeCorrelation, log
 
Methods inherited from class org.apache.ode.jacob.JacobRunnable
getImplementedMethods, toString
 
Methods inherited from class org.apache.ode.jacob.JacobObject
getClassName, getExtension, getMethod, importChannel, instance, newChannel, newChannel, object, object, object, object, replication, replication
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_log

protected static org.apache.commons.logging.Log _log

_extensionContext

protected ExtensionContext _extensionContext

_cid

protected java.lang.String _cid

_element

protected org.w3c.dom.Element _element
Constructor Detail

AbstractLongRunningExtensionOperation

public AbstractLongRunningExtensionOperation()
Method Detail

setExtensionContext

public void setExtensionContext(ExtensionContext extensionContext)

setCid

public void setCid(java.lang.String cid)

setElement

public void setElement(org.w3c.dom.Element tempElement)

runAsync

public abstract void runAsync(ExtensionContext context,
                              java.lang.String cid,
                              org.w3c.dom.Element element)
                       throws FaultException
Implementation of the extension. i.e: Calling an external service which causes to send back a response in an indefinite time. Corelation values should be set within this method.

Parameters:
context - ExtensionContext
cid - cid
element - ExtensionActivity
Throws:
FaultException - If an error occurs

registerForNotification

public void registerForNotification(java.lang.String notificationChannelId)
Extension should be registered with correlation values, notification id in order to find a route for the response message TODO we may remove this method by introducing another method to set correlatorID. so this can be done by this class itself by calling _extensionContext.getInternalInstance().registerForExtensionNotification();

Parameters:
notificationChannelId - Channel id

onRequestReceived

public abstract void onRequestReceived(java.lang.String mexId)
                                throws FaultException
Called when the response for the above service is received

Parameters:
mexId - MessageExchange id
Throws:
FaultException

updateExtensionContext

public void updateExtensionContext(BpelRuntimeContext context)

run

public void run()
Specified by:
run in class JacobRunnable

run

public void run(java.lang.Object context,
                java.lang.String cid,
                org.w3c.dom.Element element)
         throws FaultException
Specified by:
run in interface ExtensionOperation
Throws:
FaultException


Copyright © 2015 WSO2. All Rights Reserved.