org.apache.ode.bpel.engine.replayer
Class ReplayerBpelRuntimeContextImpl

java.lang.Object
  extended by org.apache.ode.bpel.engine.BpelRuntimeContextImpl
      extended by org.apache.ode.bpel.engine.replayer.ReplayerBpelRuntimeContextImpl
All Implemented Interfaces:
BpelRuntimeContext

public class ReplayerBpelRuntimeContextImpl
extends BpelRuntimeContextImpl

This class intercepts invocations on BpelRuntimeContextImpl and substitutes them as necessary during replaying. For exaple when INVOKE activity calls invoke on BpelRuntimeContextImpl then ReplayerBpelRuntimeContextImpl intercepts this call and provides specific answer.


Nested Class Summary
static class ReplayerBpelRuntimeContextImpl.TimerResume
           
 
Nested classes/interfaces inherited from interface org.apache.ode.bpel.runtime.BpelRuntimeContext
BpelRuntimeContext.ValueReferencePair
 
Field Summary
 
Fields inherited from class org.apache.ode.bpel.engine.BpelRuntimeContextImpl
_bpelProcess, _dao, _imaManager, _outstandingRequests, _soup, _vpu
 
Constructor Summary
ReplayerBpelRuntimeContextImpl(BpelProcess bpelProcess, ProcessInstanceDAO dao, PROCESS PROCESS, MyRoleMessageExchangeImpl instantiatingMessageExchange, ReplayerContext context)
           
 
Method Summary
static void assign(MessageDAO m, org.apache.xmlbeans.XmlObject o)
           
 void cancel(TimerResponseChannel timerResponseChannel)
          Cancel a timer, or pick.
 void checkInvokeExternalPermission()
           
 void completedFault(FaultData faultData)
          Should be invoked by process template, signalling process completion with fault.
static MyRoleMessageExchangeImpl createMyRoleMex(CommunicationType.Exchange e, BpelEngineImpl engine)
           
 ProcessInstanceDAO getDAO()
           
 void handleIncomingRequest(MyRoleMessageExchangeImpl mex, java.util.Date currentEventDateTime)
           
 java.lang.String invoke(int aid, PartnerLinkInstance partnerLink, javax.wsdl.Operation operation, org.w3c.dom.Element outgoingMessage, InvokeResponseChannel channel)
          Called back when the process executes an invokation.
 void registerActivityForRecovery(ActivityRecoveryChannel channel, long activityId, java.lang.String reason, java.util.Date dateTime, org.w3c.dom.Element details, java.lang.String[] actions, int retries)
           
 void registerTimer(TimerResponseChannel timerChannel, java.util.Date timeToFire)
          Registers a timer for future notification.
 void reply(PartnerLinkInstance plinkInstnace, java.lang.String opName, java.lang.String mexId, org.w3c.dom.Element msg, javax.xml.namespace.QName fault)
          Send a reply to an open message-exchange.
 void select(PickResponseChannel pickResponseChannel, java.util.Date timeout, boolean createInstance, Selector[] selectors)
          Non-deterministic selection on incoming message-exchanges.
 void updateMyRoleMex(MyRoleMessageExchangeImpl m)
           
 
Methods inherited from class org.apache.ode.bpel.engine.BpelRuntimeContextImpl
buildOutgoingMessage, cancelOutstandingRequests, completedOk, convertEndpointReference, createPartnerRoleMessageExchangeImpl, createScopeInstance, doAsyncReply, execute, fetchEndpointSessionId, fetchMyRoleEndpointReferenceData, fetchMySessionId, fetchPartnerLinkDAO, fetchPartnerRoleEndpointReferenceData, fetchPartnersSessionId, genId, getBaseResourceURI, getBpelProcess, getConfigForPartnerLink, getCurrentEventDateTime, getExpLangRuntime, getMyRequest, getPartnerFault, getPartnerFaultExplanation, getPartnerResponse, getPartnerResponseType, getPid, getProcessClassLoader, getProcessProperty, getProcessQName, getSourceEPR, getSourceSessionId, initializeCorrelation, initializePartnerLinks, initializePartnersSessionId, inputMsgMatch, invocationResponse, isCorrelationInitialized, isPartnerRoleEndpointInitialized, isVariableInitialized, matcherEvent, processOutstandingRequest, readCorrelation, readExtVar, readProperty, readVariable, recoverActivity, releasePartnerMex, reply2, sendEvent, setCurrentEventDateTime, terminate, timerEvent, unregisterActivityForRecovery, writeCorrelation, writeEndpointReference, writeExtVar, writeVariable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplayerBpelRuntimeContextImpl

public ReplayerBpelRuntimeContextImpl(BpelProcess bpelProcess,
                                      ProcessInstanceDAO dao,
                                      PROCESS PROCESS,
                                      MyRoleMessageExchangeImpl instantiatingMessageExchange,
                                      ReplayerContext context)
Method Detail

cancel

public void cancel(TimerResponseChannel timerResponseChannel)
Description copied from interface: BpelRuntimeContext
Cancel a timer, or pick.

Specified by:
cancel in interface BpelRuntimeContext
Overrides:
cancel in class BpelRuntimeContextImpl

checkInvokeExternalPermission

public void checkInvokeExternalPermission()
Overrides:
checkInvokeExternalPermission in class BpelRuntimeContextImpl

invoke

public java.lang.String invoke(int aid,
                               PartnerLinkInstance partnerLink,
                               javax.wsdl.Operation operation,
                               org.w3c.dom.Element outgoingMessage,
                               InvokeResponseChannel channel)
                        throws FaultException
Description copied from class: BpelRuntimeContextImpl
Called back when the process executes an invokation.

Specified by:
invoke in interface BpelRuntimeContext
Overrides:
invoke in class BpelRuntimeContextImpl
Parameters:
aid - The activity id in the process definition (id of OInvoke)
partnerLink - The partner link variable instance
operation - The wsdl operation.
outgoingMessage - The message sent outside as a DOM
channel - Object called back when the response is received.
Returns:
The instance id of the message exchange.
Throws:
FaultException - When the response is a fault or when the invoke could not be executed in which case it is one of the bpel standard fault.

registerTimer

public void registerTimer(TimerResponseChannel timerChannel,
                          java.util.Date timeToFire)
Description copied from interface: BpelRuntimeContext
Registers a timer for future notification.

Specified by:
registerTimer in interface BpelRuntimeContext
Overrides:
registerTimer in class BpelRuntimeContextImpl
Parameters:
timerChannel - channel for timer notification
timeToFire - future time to fire timer notification

registerActivityForRecovery

public void registerActivityForRecovery(ActivityRecoveryChannel channel,
                                        long activityId,
                                        java.lang.String reason,
                                        java.util.Date dateTime,
                                        org.w3c.dom.Element details,
                                        java.lang.String[] actions,
                                        int retries)
Specified by:
registerActivityForRecovery in interface BpelRuntimeContext
Overrides:
registerActivityForRecovery in class BpelRuntimeContextImpl

completedFault

public void completedFault(FaultData faultData)
Description copied from interface: BpelRuntimeContext
Should be invoked by process template, signalling process completion with fault.

Specified by:
completedFault in interface BpelRuntimeContext
Overrides:
completedFault in class BpelRuntimeContextImpl
See Also:
BpelRuntimeContext.completedFault(org.apache.ode.bpel.runtime.channels.FaultData)

reply

public void reply(PartnerLinkInstance plinkInstnace,
                  java.lang.String opName,
                  java.lang.String mexId,
                  org.w3c.dom.Element msg,
                  javax.xml.namespace.QName fault)
           throws FaultException
Description copied from interface: BpelRuntimeContext
Send a reply to an open message-exchange.

Specified by:
reply in interface BpelRuntimeContext
Overrides:
reply in class BpelRuntimeContextImpl
msg - response message
fault - fault name, if this is a fault reply, otherwise null
Throws:
FaultException

select

public void select(PickResponseChannel pickResponseChannel,
                   java.util.Date timeout,
                   boolean createInstance,
                   Selector[] selectors)
            throws FaultException
Description copied from interface: BpelRuntimeContext
Non-deterministic selection on incoming message-exchanges.

Specified by:
select in interface BpelRuntimeContext
Overrides:
select in class BpelRuntimeContextImpl
Throws:
FaultException

getDAO

public ProcessInstanceDAO getDAO()

createMyRoleMex

public static MyRoleMessageExchangeImpl createMyRoleMex(CommunicationType.Exchange e,
                                                        BpelEngineImpl engine)
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

updateMyRoleMex

public void updateMyRoleMex(MyRoleMessageExchangeImpl m)

assign

public static void assign(MessageDAO m,
                          org.apache.xmlbeans.XmlObject o)
                   throws java.lang.Exception
Throws:
java.lang.Exception

handleIncomingRequest

public void handleIncomingRequest(MyRoleMessageExchangeImpl mex,
                                  java.util.Date currentEventDateTime)