Package org.apache.ode.jacob

Examples of org.apache.ode.jacob.ReceiveProcess


                final String mexId = getBpelRuntimeContext().invoke(_oinvoke.getId(),
                        _scopeFrame.resolve(_oinvoke.partnerLink), _oinvoke.operation,
                        outboundMsg, invokeResponseChannel);

                object(false, compose(new ReceiveProcess() {
                    private static final long serialVersionUID = 4496880438819196765L;
                }.setChannel(invokeResponseChannel).setReceiver(new InvokeResponse() {
                    public void onResponse() {
                        // we don't have to write variable data -> this already
                        // happened in the nativeAPI impl
                        FaultData fault = null;

                        Element response;
                        try {
                            response = getBpelRuntimeContext().getPartnerResponse(mexId);
                        } catch (Exception e) {
                            __log.error("Exception while processing invoke response", e);
                            throw new RuntimeException(e);
                        }

                        try {
                            initializeVariable(outputVar, response);
                        } catch (ExternalVariableModuleException e) {
                            __log.error("Exception while initializing external variable", e);
                            _self.parent.failure(e.toString(), null);
                            return;
                        }

                        // Generating event
                        VariableModificationEvent se = new VariableModificationEvent(outputVar.declaration.name);
                        se.setNewValue(response);
                        if (_oinvoke.debugInfo != null)
                            se.setLineNo(_oinvoke.debugInfo.startLine);
                        sendEvent(se);

                        try {
                            for (OScope.CorrelationSet anInitCorrelationsOutput : _oinvoke.initCorrelationsOutput) {
                                initializeCorrelation(_scopeFrame.resolve(anInitCorrelationsOutput), outputVar);
                            }
                            for (OScope.CorrelationSet aJoinCorrelationsOutput : _oinvoke.joinCorrelationsOutput) {
                                // will be ignored if already initialized
                                initializeCorrelation(_scopeFrame.resolve(aJoinCorrelationsOutput), outputVar);
                            }
                            if (_oinvoke.partnerLink.hasPartnerRole()) {
                                // Trying to initialize partner epr based on a message-provided epr/session.
                                if (!getBpelRuntimeContext().isPartnerRoleEndpointInitialized(_scopeFrame
                                        .resolve(_oinvoke.partnerLink)) || !_oinvoke.partnerLink.initializePartnerRole) {

                                    Node fromEpr = getBpelRuntimeContext().getSourceEPR(mexId);
                                    if (fromEpr != null) {
                                        getBpelRuntimeContext().writeEndpointReference(
                                                _scopeFrame.resolve(_oinvoke.partnerLink), (Element) fromEpr);
                                    }
                                }

                                String partnersSessionId = getBpelRuntimeContext().getSourceSessionId(mexId);
                                if (partnersSessionId != null)
                                    getBpelRuntimeContext().initializePartnersSessionId(_scopeFrame.resolve(_oinvoke.partnerLink),
                                            partnersSessionId);

                            }
                        } catch (FaultException e) {
                            fault = createFault(e.getQName(), _oinvoke);
                        }

                        // TODO update output variable with data from non-initiate correlation sets

                        _self.parent.completed(fault, CompensationHandler.emptySet());
                        getBpelRuntimeContext().releasePartnerMex(mexId, fault == null);
                    }

                    public void onFault() {
                        QName faultName = getBpelRuntimeContext().getPartnerFault(mexId);
                        Element msg = getBpelRuntimeContext().getPartnerResponse(mexId);
                        QName msgType = getBpelRuntimeContext().getPartnerResponseType(mexId);
                        FaultData fault = createFault(faultName, msg,
                                _oinvoke.getOwner().messageTypes.get(msgType), _self.o);
                        _self.parent.completed(fault, CompensationHandler.emptySet());
                        getBpelRuntimeContext().releasePartnerMex(mexId, false);
                    }

                    public void onFailure() {
                        // This indicates a communication failure. We don't throw a fault,
                        // because there is no fault, instead we'll re-incarnate the invoke
                        // and either retry or indicate failure condition.
                        // admin to resume the process.
                        String reason = getBpelRuntimeContext().getPartnerFaultExplanation(mexId);
                        __log.error("Failure during invoke: " + reason);
                        try {
                            Element el = DOMUtils.stringToDOM("<invokeFailure><![CDATA["+reason+"]]></invokeFailure>");
                            _self.parent.failure(reason, el);
                        } catch (Exception e) {
                            _self.parent.failure(reason, null);
                        }
                        // Resuming the process creates a new invoke
                        getBpelRuntimeContext().releasePartnerMex(mexId, false);
                    }

                })).or(new ReceiveProcess() {
                    private static final long serialVersionUID = 4219496341785922396L;
                }.setChannel(_self.self).setReceiver(new Termination() {
                    public void terminate() {
                        _self.parent.completed(null, CompensationHandler.emptySet());
                    }
View Full Code Here


        }

        public void run() {
            Calendar now = Calendar.getInstance();

            CompositeProcess listeners = compose(new ReceiveProcess() {
                private static final long serialVersionUID = -7750428941445331236L;
            }.setChannel(_cc).setReceiver(new EventHandlerControl() {
                public void stop() {
                    _psc.completed(null, _comps);
                }
            })).or(new ReceiveProcess() {
                private static final long serialVersionUID = 6100105997983514609L;
            }.setChannel(_tc).setReceiver(new Termination() {
                public void terminate() {
                    _psc.completed(null, _comps);
                }
            }));

            if (_alarm == null) {
                object(false, listeners);
            } else if (now.before(_alarm)) {
                TimerResponse trc = newChannel(TimerResponse.class);
                getBpelRuntimeContext().registerTimer(trc,_alarm.getTime());

                listeners.or(new ReceiveProcess() {
                    private static final long serialVersionUID = 1110683632756756017L;
                }.setChannel(trc).setReceiver(new TimerResponse(){
                    public void onTimeout() {
                        // This is what we are waiting for, fire the activity
                        instance(new FIRE());
View Full Code Here

        ACTIVE(ActivityInfo activity) {
            _activity = activity;
        }

        public void run() {
            object(false, compose(new ReceiveProcess() {
                private static final long serialVersionUID = -3357030137175178040L;
            }.setChannel(_activity.parent).setReceiver(new ParentScope() {
                public void compensate(OScope scope, Synch ret) {
                    _psc.compensate(scope,ret);
                    instance(ACTIVE.this);
                }

                public void completed(FaultData faultData, Set<CompensationHandler> compensations) {
                    _comps.addAll(compensations);
                    if (!_stopped && _oalarm.repeatExpr != null) {
                        Calendar next = Calendar.getInstance();
                        try {
                            getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(_oalarm.repeatExpr, getEvaluationContext()).addTo(next);
                        } catch (EvaluationException e) {
                            throw new InvalidProcessException(e);
                        } catch (FaultException e) {
                            __log.error(e);
                            _psc.completed(createFault(e.getQName(),_oalarm.forExpr), _comps);
                            return;
                        }
                        instance(new WAIT(next));
                    } else {
                        if (faultData != null) {
                            //propagate completion into bounding scope only if we got fault during processing onAlarm
                            _psc.completed(faultData, _comps);
                        } else {
                            instance(new WAIT(null));
                        }
                    }
                }

                public void cancelled() { completed(null, CompensationHandler.emptySet()); }
                public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
            })).or(new ReceiveProcess() {
                private static final long serialVersionUID = -3873619538789039424L;
            }.setChannel(_cc).setReceiver(new EventHandlerControl() {
                public void stop() {
                    _stopped = true;
                    instance(ACTIVE.this);
                }
            })).or(new ReceiveProcess() {
                private static final long serialVersionUID = -4566956567870652885L;
            }.setChannel(_tc).setReceiver(new Termination() {
                public void terminate() {
                    replication(_activity.self).terminate();
                    _stopped = true;
View Full Code Here

        public void run() {
            Iterator<ChildInfo> active = active();
            // Continuing as long as a child is active
            if (active().hasNext()) {
                CompositeProcess mlSet = ProcessUtil.compose(new ReceiveProcess() {
                    private static final long serialVersionUID = 2554750257484084466L;
                }.setChannel(_self.self).setReceiver(new Termination() {
                    public void terminate() {
                        // Terminating all children before sepuku
                        for (Iterator<ChildInfo> i = active(); i.hasNext(); )
                            replication(i.next().activity.self).terminate();
                        _terminateRequested = true;
                        instance(ACTIVE.this);
                    }
                }));
                for (;active.hasNext();) {
                    // Checking out our children
                    final ChildInfo child = active.next();
                    mlSet.or(new ReceiveProcess() {
                        private static final long serialVersionUID = -8027205709961438172L;
                    }.setChannel(child.activity.parent).setReceiver(new ParentScope() {
                        public void compensate(OScope scope, Synch ret) {
                            // Forward compensation to parent
                            _self.parent.compensate(scope, ret);
View Full Code Here

                // Dead path activity.
                dpe(_oactivity);
            }
        } else /* don't know all our links statuses */ {
            CompositeProcess mlset = compose(new ReceiveProcess() {
                private static final long serialVersionUID = 5094153128476008961L;
            }.setChannel(_self.self).setReceiver(new Termination() {
                public void terminate() {
                    // Complete immediately, without faulting or registering any comps.
                    _self.parent.completed(null, CompensationHandler.emptySet());
                    // Dead-path activity
                    dpe(_oactivity);
                }
            }));
            for (final OLink link : _oactivity.targetLinks) {
                mlset.or(new ReceiveProcess() {
                    private static final long serialVersionUID = 1024137371118887935L;
                }.setChannel(_linkFrame.resolve(link).sub).setReceiver(new LinkStatus() {
                    public void linkStatus(boolean value) {
                        _linkVals.put(link, Boolean.valueOf(value));
                        instance(ACTIVITYGUARD.this);
View Full Code Here

        public TCONDINTERCEPT(ParentScope in) {
            _in = in;
        }

        public void run() {
            object(new ReceiveProcess() {
                private static final long serialVersionUID = 2667359535900385952L;
            }.setChannel(_in).setReceiver(new ParentScope() {
                public void compensate(OScope scope, Synch ret) {
                    _self.parent.compensate(scope,ret);
                    instance(TCONDINTERCEPT.this);
                }

                public void completed(FaultData faultData, Set<CompensationHandler> compensations) {
                    sendEvent(new ActivityExecEndEvent());
                    if (faultData != null) {
                        dpe(_oactivity.sourceLinks);
                        _self.parent.completed(faultData, compensations);
                    } else {
                        FaultData fault = null;
                        for (Iterator<OLink> i = _oactivity.sourceLinks.iterator();i.hasNext();) {
                            OLink olink = i.next();
                            LinkInfo linfo = _linkFrame.resolve(olink);
                            try {
                                boolean val = evaluateTransitionCondition(olink.transitionCondition);
                                linfo.pub.linkStatus(val);
                            } catch (FaultException e) {
                                linfo.pub.linkStatus(false);
                                __log.error(e);
                                if (fault == null)
                                    fault = createFault(e.getQName(),olink.transitionCondition);
                            }
                        }
                        _self.parent.completed(fault, compensations);
                    }
                }

                public void cancelled() {
                    sendEvent(new ActivityExecEndEvent());
                    dpe(_oactivity.outgoingLinks);
                    dpe(_oactivity.sourceLinks);
                    // Implicit scope can tell the difference between cancelled and completed.
                    _self.parent.cancelled();
                }

                private OFailureHandling getFailureHandling() {
                    if (_oactivity instanceof OInvoke) {
                        OInvoke _oinvoke = (OInvoke) _oactivity;
                        OFailureHandling f = getBpelRuntimeContext().getConfigForPartnerLink(_oinvoke.partnerLink).failureHandling;
                        if (f != null) return f;
                    }
                    return _oactivity.getFailureHandling();
                }

                public void failure(String reason, Element data) {
                    if (_failure == null)
                        _failure = new ActivityFailure();
                    _failure.dateTime = new Date();
                    _failure.reason = reason;
                    _failure.data = data;

                    OFailureHandling failureHandling = getFailureHandling();
                    if (failureHandling != null && failureHandling.faultOnFailure && _failure.retryCount >= failureHandling.retryFor) {
                        //Fault after retries (may be 0)
                        if (__log.isDebugEnabled())
                            __log.debug("ActivityRecovery: Activity " + _self.aId + " faulting on failure");
                        FaultData faultData = createFault(OFailureHandling.FAILURE_FAULT_NAME, _oactivity, reason);
                        completed(faultData, CompensationHandler.emptySet());
                        return;
                    }
                    if (failureHandling == null || _failure.retryCount >= failureHandling.retryFor) {
                        requireRecovery();
                        return;
                    }

                    if (__log.isDebugEnabled())
                        __log.debug("ActivityRecovery: Retrying activity " + _self.aId);
                    Date future = new Date(new Date().getTime() +
                        (failureHandling == null ? 0L : failureHandling.retryDelay * 1000));
                    final TimerResponse timerChannel = newChannel(TimerResponse.class);
                    getBpelRuntimeContext().registerTimer(timerChannel, future);
                    object(false, new ReceiveProcess() {
                        private static final long serialVersionUID = -261911108068231376L;
                    }.setChannel(timerChannel).setReceiver(new TimerResponse() {
                        public void onTimeout() {
                            ++_failure.retryCount;
                            startGuardedActivity();
                        }
                        public void onCancel() {
                            requireRecovery();
                        }
                    }));
                }

                private void requireRecovery() {
                    if (__log.isDebugEnabled())
                        __log.debug("ActivityRecovery: Activity " + _self.aId + " requires recovery");
                    sendEvent(new ActivityFailureEvent(_failure.reason));
                    final ActivityRecovery recoveryChannel = newChannel(ActivityRecovery.class);
                    getBpelRuntimeContext().registerActivityForRecovery(
                        recoveryChannel, _self.aId, _failure.reason, _failure.dateTime, _failure.data,
                        new String[] { "retry", "cancel", "fault" }, _failure.retryCount);
                    object(false, compose(new ReceiveProcess() {
                        private static final long serialVersionUID = 8397883882810521685L;
                    }.setChannel(recoveryChannel).setReceiver(new ActivityRecovery() {
                        public void retry() {
                            if (__log.isDebugEnabled())
                                __log.debug("ActivityRecovery: Retrying activity " + _self.aId + " (user initiated)");
                            sendEvent(new ActivityRecoveryEvent("retry"));
                            getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
                            ++_failure.retryCount;
                            startGuardedActivity();
                        }
                        public void cancel() {
                            if (__log.isDebugEnabled())
                                __log.debug("ActivityRecovery: Cancelling activity " + _self.aId + " (user initiated)");
                            sendEvent(new ActivityRecoveryEvent("cancel"));
                            getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
                            cancelled();
                        }
                        public void fault(FaultData faultData) {
                            if (__log.isDebugEnabled())
                                __log.debug("ActivityRecovery: Faulting activity " + _self.aId + " (user initiated)");
                            sendEvent(new ActivityRecoveryEvent("fault"));
                            getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
                            if (faultData == null)
                                faultData = createFault(OFailureHandling.FAILURE_FAULT_NAME, _self.o, _failure.reason);
                            completed(faultData, CompensationHandler.emptySet());
                        }
                    })).or(new ReceiveProcess() {
                        private static final long serialVersionUID = 2148587381204858397L;
                    }.setChannel(_self.self).setReceiver(new Termination() {
                        public void terminate() {
                            if (__log.isDebugEnabled())
                                __log.debug("ActivityRecovery: Cancelling activity " + _self.aId + " (terminated by scope)");
View Full Code Here

            _startTime = System.currentTimeMillis();
        }

        public void run() {
            if (_child != null || !_eventHandlers.isEmpty()) {
                CompositeProcess mlSet = ProcessUtil.compose(new ReceiveProcess() {
                    private static final long serialVersionUID = 1913414844895865116L;
                }.setChannel(_self.self).setReceiver(new Termination() {
                    public void terminate() {
                        _terminated = true;

                        // Forward the termination request to the nested activity.
                        if (_child != null && !_childTermRequested) {
                            replication(_child.self).terminate();
                            _childTermRequested = true;
                        }

                        // Forward the termination request to our event handlers.
                        terminateEventHandlers();

                        instance(ACTIVE.this);
                    }
                }));

                // Handle messages from the child if it is still alive
                if (_child != null) {
                    mlSet.or(new ReceiveProcess() {
                        private static final long serialVersionUID = -6934246487304813033L;
                    }.setChannel(_child.parent).setReceiver(new ParentScope() {
                        public void compensate(OScope scope, Synch ret) {
                            //  If this scope does not have available compensations, defer to
                            // parent scope, otherwise do compensation.
                            if (_scopeFrame.availableCompensations == null)
                                _self.parent.compensate(scope, ret);
                            else {
                                // TODO: Check if we are doing duplicate compensation
                                List<CompensationHandler> compensations = findCompensationData(scope);
                                _scopeFrame.availableCompensations.removeAll(compensations);
                                instance(new ORDEREDCOMPENSATOR(compensations, ret));
                            }
                            instance(ACTIVE.this);
                        }

                        public void completed(FaultData flt, Set<CompensationHandler> compensations) {
                              // Set the fault to the activity's choice, if and only if no previous fault
                              // has been detected (first fault wins).
                              if (flt != null && _fault == null)
                                  _fault = flt;
                              _child = null;
                              _compensations.addAll(compensations);

                              if (flt == null)
                                  stopEventHandlers();
                              else
                                  terminateEventHandlers();

                              instance(ACTIVE.this);
                        }

                        public void cancelled() {
                            // Implicit scope holds links of the enclosed activity,
                            // they only get cancelled when we propagate upwards.
                            if (_oscope.implicitScope)
                                _self.parent.cancelled();
                            else
                                completed(null, CompensationHandler.emptySet());
                        }

                        public void failure(String reason, Element data) {
                            completed(createFault(OFailureHandling.FAILURE_FAULT_NAME, _self.o, null),
                                CompensationHandler.emptySet());
                        }

                    }) );
                }

                // Similarly, handle messages from the event handler, if one exists
                // and if it has not completed.
                for (Iterator<EventHandlerInfo> i = _eventHandlers.iterator();i.hasNext();) {
                    final EventHandlerInfo ehi = i.next();

                    mlSet.or(new ReceiveProcess() {
                        private static final long serialVersionUID = -4694721357537858221L;
                    }.setChannel(ehi.psc).setReceiver(new ParentScope() {
                        public void compensate(OScope scope, Synch ret) {
                            // ACTIVE scopes do not compensate, send request up to parent.
                            _self.parent.compensate(scope, ret);
                            instance(ACTIVE.this);
                        }

                        public void completed(FaultData flt, Set<CompensationHandler> compenstations) {
                            // Set the fault to the activity's choice, if and only if no previous fault
                            // has been detected (first fault wins).
                            if (flt != null && _fault == null)
                                _fault = flt;
                            _eventHandlers.remove(ehi);
                            _compensations.addAll(compenstations);

                            if (flt != null) {
                                // Terminate child if we get a fault from the event handler.
                                if (_child != null && !_childTermRequested) {
                                    replication(_child.self).terminate();
                                    _childTermRequested = true;
                                }
                                terminateEventHandlers();
                            } else
                                stopEventHandlers();

                            instance(ACTIVE.this);
                        }

                        public void cancelled() { completed(null, CompensationHandler.emptySet()); }
                        public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
                    }));
                }
                object(false, mlSet);
            } else /* nothing to wait for... */ {
                // Any compensation handlers that were available but not activated will be forgotten.
                Set<CompensationHandler> unreachableCompensationHandlers = _scopeFrame.availableCompensations;
                if (unreachableCompensationHandlers != null)
                    for (Iterator<CompensationHandler> i = unreachableCompensationHandlers.iterator(); i.hasNext(); ) {
                        CompensationHandler ch = i.next();
                        ch.compChannel.forget();
                    }
                _scopeFrame.availableCompensations = null;

                // Maintain a set of links needing dead-path elimination.
                Set<OLink> linksNeedingDPE = new HashSet<OLink>();
                if (_oscope.faultHandler != null)
                    for (Iterator<OCatch> i = _oscope.faultHandler.catchBlocks.iterator(); i.hasNext(); )
                        linksNeedingDPE.addAll(i.next().outgoingLinks);

                // We're done with the main work, if we were terminated, we will
                // need to load the termination handler:
                if (_terminated) {
                    if (__log.isDebugEnabled()) {
                        __log.debug("Scope: " + _oscope + " was terminated. (fault="+_fault+")");
                    }
                    // ??? Should we forward
                   
                    // If termination handler defined, and the scope has not faulted
                    if (_oscope.terminationHandler != null && _fault == null) {
                   
                        // We have to create a scope for the catch block.
                        BpelRuntimeContext ntive = getBpelRuntimeContext();

                        ActivityInfo terminationHandlerActivity = new ActivityInfo(genMonotonic(), _oscope.terminationHandler,
                                newChannel(Termination.class,"TH"), newChannel(ParentScope.class,"TH"));

                        ScopeFrame terminationHandlerScopeFrame = new ScopeFrame(_oscope.terminationHandler,
                                ntive.createScopeInstance(_scopeFrame.scopeInstanceId, _oscope.terminationHandler),
                                _scopeFrame, CompensationHandler.emptySet(), (FaultData)null);
                       
                        // Create the temination handler scope.
                        instance(new SCOPE(terminationHandlerActivity,terminationHandlerScopeFrame, SCOPE.this._linkFrame));

                        object(new ReceiveProcess() {
                            private static final long serialVersionUID = -6009078124717125270L;
                        }.setChannel(terminationHandlerActivity.parent).setReceiver(new ParentScope() {
                            public void compensate(OScope scope, Synch ret) {
                                // This should never happen.
                                throw new AssertionError("received compensate request!");
                            }

                            public void completed(FaultData fault, Set<CompensationHandler> compensations) {
                                // The compensations that have been registered here, will never be activated,
                                // so we'll forget them as soon as possible.
                                for (CompensationHandler compensation : compensations)
                                    compensation.compChannel.forget();

                                // When a fault occurs within a termination handler, it is not propagated
                                _self.parent.completed(null, CompensationHandler.emptySet());
                            }

                            public void cancelled() { completed(null, CompensationHandler.emptySet()); }
                            public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
                        }));
                    } else {
                      _self.parent.completed(null,_compensations);
                    }
                   
                } else if (_fault != null) {

                    sendEvent(new ScopeFaultEvent(_fault.getFaultName(), _fault.getFaultLineNo(),_fault.getExplanation()));

                    // Find a fault handler for our fault.
                    OCatch catchBlock = _oscope.faultHandler == null ? null : findCatch(_oscope.faultHandler, _fault.getFaultName(), _fault.getFaultType());

                    // Collect all the compensation data for completed child scopes.
                    assert !!_eventHandlers.isEmpty();
                    assert _child == null;
                    if (catchBlock == null) {
                        // If we cannot find a catch block for this fault, then we simply propagate the fault
                        // to the parent. NOTE: the "default" fault handler as described in the BPEL spec
                        // must be generated by the compiler.
                          __log.warn(_self + ": has no fault handler for "
                                + _fault.getFaultName() + "; scope will propagate FAULT! , " + _fault.toString());


                        _self.parent.completed(_fault, _compensations);
                    } else /* catchBlock != null */ {
                            __log.warn(_self + ": has a fault handler for "
                                    + _fault.getFaultName() + ": "+ catchBlock + " ,  " + _fault.toString());

                        linksNeedingDPE.removeAll(catchBlock.outgoingLinks);

                        // We have to create a scope for the catch block.
                        BpelRuntimeContext ntive = getBpelRuntimeContext();

                        ActivityInfo faultHandlerActivity = new ActivityInfo(genMonotonic(), catchBlock,
                                newChannel(Termination.class,"FH"), newChannel(ParentScope.class,"FH"));

                        ScopeFrame faultHandlerScopeFrame = new ScopeFrame(catchBlock,
                                ntive.createScopeInstance(_scopeFrame.scopeInstanceId, catchBlock),
                                _scopeFrame, _compensations, _fault);
                        if (catchBlock.faultVariable != null) {
                            try {
                                VariableInstance vinst =  faultHandlerScopeFrame.resolve(catchBlock.faultVariable);
                                initializeVariable(vinst, _fault.getFaultMessage().cloneNode(true));

                                // Generating event
                                VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.name);
                                se.setNewValue(_fault.getFaultMessage());
                                if (_oscope.debugInfo != null)
                                    se.setLineNo(_oscope.debugInfo.startLine);
                                sendEvent(se);
                            } catch (Exception ex) {
                                __log.fatal(ex);
                                throw new InvalidProcessException(ex);
                            }
                        }

                        // Create the fault handler scope.
                        instance(new SCOPE(faultHandlerActivity,faultHandlerScopeFrame, SCOPE.this._linkFrame));

                        object(new ReceiveProcess() {
                            private static final long serialVersionUID = -6009078124717125270L;
                        }.setChannel(faultHandlerActivity.parent).setReceiver(new ParentScope() {
                            public void compensate(OScope scope, Synch ret) {
                                // This should never happen.
                                throw new AssertionError("received compensate request!");
View Full Code Here

        WAITER(ActivityInfo child) {
            _child = child;
        }

        public void run() {
            object(false, compose(new ReceiveProcess() {
                private static final long serialVersionUID = -5471984635653784051L;
            }.setChannel(_self.self).setReceiver(new Termination() {
                public void terminate() {
                    _terminated = true;
                    replication(_child.self).terminate();
                    instance(WAITER.this);
                }
            })).or(new ReceiveProcess() {
                private static final long serialVersionUID = 3907167240907524405L;
            }.setChannel(_child.parent).setReceiver(new ParentScope() {
                public void compensate(OScope scope, Synch ret) {
                    _self.parent.compensate(scope,ret);
                    instance(WAITER.this);
View Full Code Here

        _self = self;
    }

    @Override
    public void run() {
        object(new ReceiveProcess() {
            private static final long serialVersionUID = -8644268413754259515L;
        }.setChannel(_self).setReceiver(new ReadWriteLock() {
            public void readLock(Synch s) {
                switch (_status) {
                case UNLOCKED:
View Full Code Here

    public final void run() {
        OScope scopeToCompensate = _ocompact.compensatedScope;
        Synch sc = newChannel(Synch.class);
        _self.parent.compensate(scopeToCompensate,sc);
        object(new ReceiveProcess() {
            private static final long serialVersionUID = 3763991229748926216L;
        }.setChannel(sc).setReceiver(new Synch() {
            public void ret() {
                _self.parent.completed(null, CompensationHandler.emptySet());
            }
View Full Code Here

TOP

Related Classes of org.apache.ode.jacob.ReceiveProcess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.