Package org.apache.openjpa.writebehind

Examples of org.apache.openjpa.writebehind.WriteBehindCache


        // store manager, because it's easier for users to deal with
        // that way
        StoreManager sm = newStoreManager();
        DelegatingStoreManager dsm = null;
        if (_conf.getDataCacheManagerInstance().getSystemDataCache() != null) {
            WriteBehindCache wbCache = _conf.getWriteBehindCacheManagerInstance().getSystemWriteBehindCache();
            if (wbCache != null) {
                dsm = new DataCacheStoreManager(new WriteBehindStoreManager(sm, wbCache));
            } else {
                dsm = new DataCacheStoreManager(sm);
            }
View Full Code Here


       
        return dsm;
    }
   
    protected void initWriteBehindCallback() {
        WriteBehindCache cache = _conf.getWriteBehindCacheManagerInstance().getSystemWriteBehindCache();
        if (cache != null) {
            // Verify we are not missing one or more of the following required
            // WriteBehind configuration parameters:
            //   - openjpa.DataCache
            //   - openjpa.WriteBehindCallback
View Full Code Here

    public void testWriteBehindCacheCreated() {
        assertNotNull("EMF was not created.", emf);
        WriteBehindCacheManager manager = getWBCacheManager();
        assertNotNull("WriteBehindCacheManager should exist", manager);

        WriteBehindCache wbcache = manager.getSystemWriteBehindCache();
        assertNotNull("SystemWriteBehindCache should exist", wbcache);

        assertTrue(String.format("Expecting %s to be an instance of %s",
            wbcache, SimpleWriteBehindCache.class),
            wbcache instanceof SimpleWriteBehindCache);
View Full Code Here

        props.put("openjpa.WriteBehindCallback", "true");

        WriteBehindCacheManager manager = getWBCacheManager(getCustomFactory(props));
        assertNotNull("WriteBehindCacheManager should exist", manager);

        WriteBehindCache wbcache = manager.getSystemWriteBehindCache();
        assertNotNull("SystemWriteBehindCache should exist", wbcache);

        assertTrue(String.format("Expecting %s to be an instance of %s",
            wbcache, CustomWriteBehindCache.class),
            wbcache instanceof CustomWriteBehindCache);
View Full Code Here

        OpenJPAEntityManagerFactorySPI factory) {
        return factory.getConfiguration().getWriteBehindCallbackInstance();
    }

    protected WriteBehindCache getWBCache(OpenJPAEntityManagerFactorySPI factory, String name) {
        WriteBehindCache wbc = null;
        if (StringUtils.isEmpty(name)) {
            wbc = getWBCacheManager(factory).getSystemWriteBehindCache();
        } else {
            wbc = getWBCacheManager(factory).getWriteBehindCache(name);
        }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.writebehind.WriteBehindCache

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.