org.apache.ode.test
Class MockExtensionContext

java.lang.Object
  extended by org.apache.ode.test.MockExtensionContext
All Implemented Interfaces:
java.io.Serializable, ExtensionContext

public class MockExtensionContext
extends java.lang.Object
implements ExtensionContext

Very simple mock implementation of the ExtensionContext interface.

Author:
Tammo van Lessen (University of Stuttgart)
See Also:
Serialized Form

Field Summary
 boolean completed
           
 java.net.URI duDir
           
 FaultException fault
           
 boolean faulted
           
 java.util.List<java.lang.String> msgs
           
 
Constructor Summary
MockExtensionContext()
           
 
Method Summary
 void complete(java.lang.String cid)
           
 void completeWithFault(java.lang.String cid, FaultException fault)
           
 void completeWithFault(java.lang.String cid, java.lang.Throwable t)
           
 java.lang.String getActivityName()
           
 java.lang.String[] getCorrelationValues()
           
 java.lang.String getCorrelatorId()
           
 java.net.URI getDUDir()
           
 BpelRuntimeContext getInternalInstance()
           
 OActivity getOActivity()
           
 ParentScopeChannel getParentScopeChannel()
           
 org.w3c.dom.Node getPartData(org.w3c.dom.Element element, java.lang.String variable)
           
 PartnerLinkInstance getPartnerLinkInstance(OPartnerLink partnerLink)
          Get the partner link
 PartnerLinkInstance getPartnerLinkInstance(java.lang.String partnerLinkName)
          Get the partner link
 java.lang.Long getProcessId()
           
 OProcess getProcessModel()
          Get the Process Model
 TerminationChannel getTerminationChannel()
           
 java.util.Map<java.lang.String,org.w3c.dom.Node> getVariables()
           
 java.util.Map<java.lang.String,OScope.Variable> getVisibleVariables()
           
 boolean isLinkActive(OLink olink)
           
 boolean isPartnerLinkVisible(java.lang.String partnerLinkName)
          Check whether the partner link is visible in the current scope or not
 boolean isVariableVisible(java.lang.String varName)
           
 void printToConsole(java.lang.String msg)
           
 java.lang.String readMessageProperty(OScope.Variable variable, OProcess.OProperty property)
           
 org.w3c.dom.Node readVariable(OScope.Variable variable)
           
 org.w3c.dom.Node readVariable(java.lang.String variableName)
           
 void setCorrelationValues(java.lang.String[] values)
          Set correlation values in order to find a route
 void setCorrelatorId(java.lang.String correlatorId)
          Set Correlator value This should be set in LongRunning extensions in-order to receive the response
 void writeVariable(OScope.Variable variable, org.w3c.dom.Node value)
           
 void writeVariable(java.lang.String variableName, org.w3c.dom.Node value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

completed

public boolean completed

faulted

public boolean faulted

fault

public FaultException fault

duDir

public java.net.URI duDir

msgs

public java.util.List<java.lang.String> msgs
Constructor Detail

MockExtensionContext

public MockExtensionContext()
Method Detail

getVariables

public java.util.Map<java.lang.String,org.w3c.dom.Node> getVariables()

getProcessId

public java.lang.Long getProcessId()
Specified by:
getProcessId in interface ExtensionContext

readVariable

public org.w3c.dom.Node readVariable(java.lang.String variableName)
                              throws FaultException
Specified by:
readVariable in interface ExtensionContext
Throws:
FaultException

writeVariable

public void writeVariable(java.lang.String variableName,
                          org.w3c.dom.Node value)
                   throws FaultException
Specified by:
writeVariable in interface ExtensionContext
Throws:
FaultException

isVariableVisible

public boolean isVariableVisible(java.lang.String varName)
Specified by:
isVariableVisible in interface ExtensionContext

getActivityName

public java.lang.String getActivityName()
Specified by:
getActivityName in interface ExtensionContext

getOActivity

public OActivity getOActivity()
Specified by:
getOActivity in interface ExtensionContext

getVisibleVariables

public java.util.Map<java.lang.String,OScope.Variable> getVisibleVariables()
                                                                    throws FaultException
Specified by:
getVisibleVariables in interface ExtensionContext
Throws:
FaultException

isLinkActive

public boolean isLinkActive(OLink olink)
                     throws FaultException
Throws:
FaultException

readMessageProperty

public java.lang.String readMessageProperty(OScope.Variable variable,
                                            OProcess.OProperty property)
                                     throws FaultException
Specified by:
readMessageProperty in interface ExtensionContext
Throws:
FaultException

readVariable

public org.w3c.dom.Node readVariable(OScope.Variable variable)
                              throws FaultException
Specified by:
readVariable in interface ExtensionContext
Throws:
FaultException

writeVariable

public void writeVariable(OScope.Variable variable,
                          org.w3c.dom.Node value)
                   throws FaultException
Specified by:
writeVariable in interface ExtensionContext
Throws:
FaultException

complete

public void complete(java.lang.String cid)
Specified by:
complete in interface ExtensionContext

completeWithFault

public void completeWithFault(java.lang.String cid,
                              java.lang.Throwable t)
Specified by:
completeWithFault in interface ExtensionContext

completeWithFault

public void completeWithFault(java.lang.String cid,
                              FaultException fault)
Specified by:
completeWithFault in interface ExtensionContext

getInternalInstance

public BpelRuntimeContext getInternalInstance()
Specified by:
getInternalInstance in interface ExtensionContext

getPartnerLinkInstance

public PartnerLinkInstance getPartnerLinkInstance(java.lang.String partnerLinkName)
                                           throws FaultException
Get the partner link

Specified by:
getPartnerLinkInstance in interface ExtensionContext
Parameters:
partnerLinkName - name of the partner link
Returns:
PartnerLinkInstance
Throws:
FaultException

isPartnerLinkVisible

public boolean isPartnerLinkVisible(java.lang.String partnerLinkName)
Check whether the partner link is visible in the current scope or not

Specified by:
isPartnerLinkVisible in interface ExtensionContext
Parameters:
partnerLinkName - name of the partner link
Returns:
true if the partner link is visible

getPartnerLinkInstance

public PartnerLinkInstance getPartnerLinkInstance(OPartnerLink partnerLink)
                                           throws FaultException
Get the partner link

Specified by:
getPartnerLinkInstance in interface ExtensionContext
Parameters:
partnerLink -
Returns:
PartnerLinkInstance
Throws:
FaultException

getProcessModel

public OProcess getProcessModel()
Get the Process Model

Specified by:
getProcessModel in interface ExtensionContext
Returns:
ProcessModel

setCorrelationValues

public void setCorrelationValues(java.lang.String[] values)
Set correlation values in order to find a route

Specified by:
setCorrelationValues in interface ExtensionContext
Parameters:
values - values

getCorrelationValues

public java.lang.String[] getCorrelationValues()
Specified by:
getCorrelationValues in interface ExtensionContext

setCorrelatorId

public void setCorrelatorId(java.lang.String correlatorId)
Set Correlator value This should be set in LongRunning extensions in-order to receive the response

Specified by:
setCorrelatorId in interface ExtensionContext
Parameters:
correlatorId - partnerlink.operation

getCorrelatorId

public java.lang.String getCorrelatorId()
Specified by:
getCorrelatorId in interface ExtensionContext

getPartData

public org.w3c.dom.Node getPartData(org.w3c.dom.Element element,
                                    java.lang.String variable)
Specified by:
getPartData in interface ExtensionContext

getTerminationChannel

public TerminationChannel getTerminationChannel()
Specified by:
getTerminationChannel in interface ExtensionContext

getParentScopeChannel

public ParentScopeChannel getParentScopeChannel()
Specified by:
getParentScopeChannel in interface ExtensionContext

getDUDir

public java.net.URI getDUDir()
Specified by:
getDUDir in interface ExtensionContext

printToConsole

public void printToConsole(java.lang.String msg)
Specified by:
printToConsole in interface ExtensionContext


Copyright © 2015 WSO2. All Rights Reserved.