Package org.apache.openejb.core.transaction

Examples of org.apache.openejb.core.transaction.TransactionContext


        mdbCallContext.deliveryMethod = method;
        mdbCallContext.oldCallContext = oldContext;

        // add tx data
        mdbCallContext.txPolicy = deployInfo.getTransactionPolicy(method);
        mdbCallContext.txContext = new TransactionContext(callContext, transactionManager);

        // call the tx before method
        try {
            boolean adapterTransaction = transactionManager.getTransaction() != null;
            mdbCallContext.txPolicy.beforeInvoke(instance, mdbCallContext.txContext);
View Full Code Here


    }

    protected Object _invoke(Method callMethod, InterceptorStack interceptorStack, Object [] args, Object bean, ThreadContext callContext) throws OpenEJBException {

        TransactionPolicy txPolicy = callContext.getDeploymentInfo().getTransactionPolicy(callMethod);
        TransactionContext txContext = new TransactionContext(callContext, transactionManager);
        try {
            txPolicy.beforeInvoke(bean, txContext);
        } catch (ApplicationException e) {
            if (e.getRootCause() instanceof TransactionRequiredException ||
                    e.getRootCause() instanceof RemoteException) {
View Full Code Here

    }

    private Object businessMethod(Method callMethod, Method runMethod, Object[] args, ThreadContext callContext) throws OpenEJBException {
        CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();
        TransactionPolicy txPolicy = deploymentInfo.getTransactionPolicy(callMethod);
        TransactionContext txContext = new TransactionContext(callContext, transactionManager);

        txPolicy.beforeInvoke(null, txContext);

        EntityBean bean = null;
        Object returnValue = null;
View Full Code Here

    }

    private Object homeMethod(Method callMethod, Object[] args, ThreadContext callContext) throws OpenEJBException {
        CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();
        TransactionPolicy txPolicy = deploymentInfo.getTransactionPolicy(callMethod);
        TransactionContext txContext = new TransactionContext(callContext, transactionManager);

        txPolicy.beforeInvoke(null, txContext);

        EntityBean bean = null;
        Object returnValue = null;
View Full Code Here

        EntityBean bean = null;
        Object primaryKey = null;

        TransactionPolicy txPolicy = deploymentInfo.getTransactionPolicy(callMethod);
        TransactionContext txContext = new TransactionContext(callContext, transactionManager);

        txPolicy.beforeInvoke(bean, txContext);

        try {
            // Obtain a bean instance from the method ready pool
View Full Code Here

    private Object findByPrimaryKey(Method callMethod, Object[] args, ThreadContext callContext) throws OpenEJBException {
        CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();

        // Get the transaction policy assigned to this method
        TransactionPolicy txPolicy = deploymentInfo.getTransactionPolicy(callMethod);
        TransactionContext txContext = new TransactionContext(callContext, transactionManager);

        txPolicy.beforeInvoke(null, txContext);
        try {
            EntityBean bean = (EntityBean) cmpEngine.loadBean(callContext, args[0]);
            if (bean == null) {
View Full Code Here

    private Object findEJBObject(Method callMethod, Object[] args, ThreadContext callContext) throws OpenEJBException {
        CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();

        // Get the transaction policy assigned to this method
        TransactionPolicy txPolicy = deploymentInfo.getTransactionPolicy(callMethod);
        TransactionContext txContext = new TransactionContext(callContext, transactionManager);

        txPolicy.beforeInvoke(null, txContext);
        try {
            List<Object> results = cmpEngine.queryBeans(callContext, callMethod, args);
View Full Code Here

        return result;
    }

    private void removeEJBObject(Method callMethod, ThreadContext callContext) throws OpenEJBException {
        CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();
        TransactionContext txContext = new TransactionContext(callContext, transactionManager);
        TransactionPolicy txPolicy = deploymentInfo.getTransactionPolicy(callMethod);

        txPolicy.beforeInvoke(null, txContext);
        try {
            EntityBean entityBean = (EntityBean) cmpEngine.loadBean(callContext, callContext.getPrimaryKey());
View Full Code Here

    protected Object invoke(Method callMethod, Method runMethod, Object [] args, ThreadContext callContext)
            throws org.apache.openejb.OpenEJBException {

        TransactionPolicy txPolicy = callContext.getDeploymentInfo().getTransactionPolicy(callMethod);
        TransactionContext txContext = new TransactionContext(callContext, transactionManager);
        txContext.callContext = callContext;

        EntityBean bean = null;
        txPolicy.beforeInvoke(bean, txContext);
View Full Code Here

        callContext.setCurrentOperation(Operation.CREATE);
        callContext.setCurrentAllowedStates(EntityContext.getStates());

        TransactionPolicy txPolicy = callContext.getDeploymentInfo().getTransactionPolicy(callMethod);
        TransactionContext txContext = new TransactionContext(callContext, transactionManager);
        txContext.callContext = callContext;

        /*
        * According to section 9.1.5.1 of the EJB 1.1 specification, the "ejbPostCreate(...)
        * method executes in the same transaction context as the previous ejbCreate(...) method."
View Full Code Here

TOP

Related Classes of org.apache.openejb.core.transaction.TransactionContext

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.