Package net.sf.ehcache.transaction

Examples of net.sf.ehcache.transaction.SoftLockFactory


            /* note: this isn't part of makeXaStrictTransactionalIfNeeded() as only xa_strict supports NonStop, meaning that only
             * that transactional store can be wrapped by NonStopStore. Other TX modes have to wrap the NonStop store due to their
             * lack of NonStop support (ie: lack of transaction context suspension/resuming).
             */
            if (configuration.isXaTransactional()) {
                SoftLockFactory softLockFactory = cacheManager.createSoftLockFactory(this);
                LocalTransactionStore localTransactionStore = new LocalTransactionStore(getCacheManager().getTransactionController(),
                        softLockFactory, this, store, copyStrategy);
                this.compoundStore = new JtaLocalTransactionStore(localTransactionStore, transactionManagerLookup,
                        cacheManager.getTransactionController());
            } else if (configuration.isLocalTransactional()) {
                SoftLockFactory softLockFactory = cacheManager.createSoftLockFactory(this);
                this.compoundStore = new LocalTransactionStore(getCacheManager().getTransactionController(), softLockFactory, this, store,
                        copyStrategy);
            } else {
                this.compoundStore = store;
            }
View Full Code Here


            }
            //set xa enabled
            if (configuration.isTerracottaClustered()) {
                configuration.getTerracottaConfiguration().setCacheXA(true);
            }
            SoftLockFactory softLockFactory = cacheManager.createSoftLockFactory(this);
            TransactionIDFactory transactionIDFactory = cacheManager.createTransactionIDFactory();

            // this xaresource is for initial registration and recovery
            EhcacheXAResource xaResource = new EhcacheXAResourceImpl(this, clusteredStore, transactionManagerLookup,
                    softLockFactory, transactionIDFactory);
View Full Code Here

     *
     * @param cache the cache to create the soft lock factory for
     * @return a SoftLockFactory
     */
    SoftLockFactory createSoftLockFactory(Ehcache cache) {
        SoftLockFactory softLockFactory;
        if (cache.getCacheConfiguration().isTerracottaClustered()) {
            softLockFactory = getClusteredInstanceFactory(cache).getOrCreateSoftLockFactory(cache.getName());
        } else {
            softLockFactory = softLockFactories.get(cache.getName());
            if (softLockFactory == null) {
                softLockFactory = new ReadCommittedSoftLockFactoryImpl(cache.getName());
                SoftLockFactory old = softLockFactories.putIfAbsent(cache.getName(), softLockFactory);
                if (old != null) {
                    softLockFactory = old;
                }
            }
        }
View Full Code Here

TOP

Related Classes of net.sf.ehcache.transaction.SoftLockFactory

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.