Package org.apache.ode.bpel.iapi

Examples of org.apache.ode.bpel.iapi.BpelEngineException


    public <T> T execTransaction(Callable<T> transaction) throws Exception{
        try {
            txManager.begin();
        } catch (Exception ex) {
            String errmsg = "Internal Error, could not begin transaction.";
            throw new BpelEngineException(errmsg, ex);
        }
        boolean success = false;
        try {
            T retval = transaction.call();
            success = (txManager.getStatus() != Status.STATUS_MARKED_ROLLBACK);
            return retval;
        } catch (Exception ex) {
            throw ex;
        } finally {
            if (success)
                try {
                    txManager.commit();
                } catch (Exception ex) {
                    __log.error("Commit failed.", ex);                   
                    throw new BpelEngineException("Commit failed.", ex);
                }
            else
                try {
                    txManager.rollback();
                } catch (Exception ex) {
View Full Code Here


                }
               
            });
        } catch (Exception ex) {
            throw new BpelEngineException("Error registering synchronizer." ,ex);
        }
    }
View Full Code Here

        try {
            future.get(Math.max(_timeout, 1), TimeUnit.MILLISECONDS);
            _done = true;
            return getStatus();
        } catch (InterruptedException e) {
            throw new BpelEngineException(e);
        } catch (ExecutionException e) {
            throw new BpelEngineException(e.getCause());
        }
    }
View Full Code Here

                    .getMessageExchangeId(), _plinkDef, op, null, /* EPR todo */
            myroleEPR, _channel);
            break;

        default:
            throw new BpelEngineException("Unexpected InvocationStyle: " + istyle);

        }

        mex.load(mexdao);
        return mex;
View Full Code Here

            Transaction tx;
            try {
                tx = _contexts.txManager.suspend();
                __log.debug("TX " + tx + " suspended for in-memory invoke. ");
            } catch (Exception ex) {
                throw new BpelEngineException("TxManager Error: cannot suspend!", ex);
            }
           
            unreliableMex.request();
            unreliableMex.setState(State.INVOKE_XXX);
            try {
                try {
                    _contexts.mexContext.invokePartnerUnreliable(unreliableMex);
                } catch (Throwable t) {
                    __log.error("Unexpected error invoking partner." ,t);
                    MexDaoUtil.setFailed(mexDao, FailureType.OTHER, t.toString());
                    return;
                }
               
                try {
                    unreliableMex.waitForAck(mexDao.getTimeout());
                } catch (InterruptedException ie) {
                    __log.warn("Interrupted waiting for MEX response.");
                }

            } finally {
                unreliableMex.setState(State.DEAD);
                try {
                    _contexts.txManager.resume(tx);
                    __log.debug("TX " + tx + " resumed for in-memory invoke. ");
                } catch (Exception e) {
                    throw new BpelEngineException("TxManager Error: cannot resume!", e);
                }
            }

            if (unreliableMex.getStatus() != Status.ACK) {
                MexDaoUtil.setFailed(mexDao, FailureType.NO_RESPONSE, "No Response");
View Full Code Here

            try {
                _contexts.txManager.setRollbackOnly();
            } catch (Exception ex) {
                __log.fatal("TransactionManager error, could not setRollbackOnly()",ex);
            }
            throw new BpelEngineException("Rollback required.",t);
        } finally {
            transactedMex.setState(State.DEAD);
        }
       
        if (transactedMex.getStatus() != Status.ACK) {
View Full Code Here

        return "MEX[" + _mexId + "]";
    }

    protected void assertTransaction() {
        if (!_contexts.isTransacted())
            throw new BpelEngineException("Operation must be performed in a transaction!");
    }
View Full Code Here

                    }

                }).get();
            } catch (Exception ie) {
                __log.error("Internal error executing transaction.", ie);
                throw new BpelEngineException("Internal Error",ie);
            }
        }
    }
View Full Code Here

     * method, AND the call must come from the engine thread.
     */
    @Override
    protected void checkReplyContextOk() {
        if (_state != State.INVOKE_XXX)
            throw new BpelEngineException("replyXXX operation attempted outside of transacted region!");
       
        assert _contexts.isTransacted() : "Internal Error: owner thread must be transactional!?!?!!?";
    }
View Full Code Here

        // Prevent duplicate replies.
        while (_state == State.HOLD)
            try {
                _stateChanged.await();
            } catch (InterruptedException e) {
                throw new BpelEngineException("Thread Interrupted.", e);
            }

        if (_state == State.DEAD)
            throw new IllegalStateException("Object used in inappropriate context. ");
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.iapi.BpelEngineException

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.