Package org.apache.openejb.core

Examples of org.apache.openejb.core.CoreUserTransaction


        final Class interfce = serviceInterfaces.get(serviceInfo.service);
        checkImplementation(interfce, service.getClass(), serviceInfo.service, serviceInfo.id);

        try {
            this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service, service);
            this.containerSystem.getJNDIContext().bind("comp/UserTransaction", new CoreUserTransaction((TransactionManager) service));
            this.containerSystem.getJNDIContext().bind("comp/TransactionManager", service);
        } catch (final NamingException e) {
            throw new OpenEJBException("Cannot bind " + serviceInfo.service + " with id " + serviceInfo.id, e);
        }
View Full Code Here


        JtaEntityManagerRegistry jtaEntityManagerRegistry = SystemInstance.get().getComponent(JtaEntityManagerRegistry.class);

        // bind UserTransaction if bean managed transactions
        UserTransaction userTransaction = null;
        if (beanManagedTransactions) {
            userTransaction = new CoreUserTransaction(transactionManager);
            bindings.put("java:comp/UserTransaction", userTransaction);
        }

        // bind TimerService
        bindings.put("java:comp/TimerService", new TimerServiceWrapper());
View Full Code Here

            return false;
        }
    }

    private SessionContext createSessionContext() {
        StatefulUserTransaction userTransaction = new StatefulUserTransaction(new CoreUserTransaction(transactionManager), jtaEntityManagerRegistry);
        return new StatefulContext(transactionManager, securityService, userTransaction);
    }
View Full Code Here

        return SystemInstance.get().getComponent(TransactionManager.class);
    }

    public UserTransaction getUserTransaction()
    {
        CoreUserTransaction ut = new CoreUserTransaction(getTransactionManager());
        return ut;
    }
View Full Code Here

        Class interfce = serviceInterfaces.get(serviceInfo.service);
        checkImplementation(interfce, service.getClass(), serviceInfo.service, serviceInfo.id);

        try {
            this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service, service);
            this.containerSystem.getJNDIContext().bind("java:comp/UserTransaction", new CoreUserTransaction((TransactionManager) service));
            this.containerSystem.getJNDIContext().bind("java:comp/TransactionManager", service);
        } catch (NamingException e) {
            throw new OpenEJBException("Cannot bind " + serviceInfo.service + " with id " + serviceInfo.id, e);
        }
View Full Code Here

        if (transactionManager instanceof UserTransaction) {
            return transactionManager;
        }

        // wrap transaction manager with user transaction
        return new CoreUserTransaction(transactionManager);
    }
View Full Code Here

            throw new IllegalStateException("Exception getting current transaction");
        }
    }

    public UserTransaction getUserTransaction() {
        return new CoreUserTransaction(transactionManager);
    }
View Full Code Here

        JtaEntityManagerRegistry jtaEntityManagerRegistry = SystemInstance.get().getComponent(JtaEntityManagerRegistry.class);

        // bind UserTransaction if bean managed transactions
        UserTransaction userTransaction = null;
        if (beanManagedTransactions) {
            userTransaction = new CoreUserTransaction(transactionManager);
            bindings.put("java:comp/UserTransaction", userTransaction);
        }

        // bind TimerService
        bindings.put("java:comp/TimerService", new TimerServiceWrapper());
View Full Code Here

        final Class interfce = serviceInterfaces.get(serviceInfo.service);
        checkImplementation(interfce, service.getClass(), serviceInfo.service, serviceInfo.id);

        try {
            this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service, service);
            this.containerSystem.getJNDIContext().bind("comp/UserTransaction", new CoreUserTransaction((TransactionManager) service));
            this.containerSystem.getJNDIContext().bind("comp/TransactionManager", service);
        } catch (final NamingException e) {
            throw new OpenEJBException("Cannot bind " + serviceInfo.service + " with id " + serviceInfo.id, e);
        }
View Full Code Here

        final Class interfce = serviceInterfaces.get(serviceInfo.service);
        checkImplementation(interfce, service.getClass(), serviceInfo.service, serviceInfo.id);

        try {
            this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service, service);
            this.containerSystem.getJNDIContext().bind("comp/UserTransaction", new CoreUserTransaction((TransactionManager) service));
            this.containerSystem.getJNDIContext().bind("comp/TransactionManager", service);
        } catch (NamingException e) {
            throw new OpenEJBException("Cannot bind " + serviceInfo.service + " with id " + serviceInfo.id, e);
        }
View Full Code Here

TOP

Related Classes of org.apache.openejb.core.CoreUserTransaction

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.