Package org.apache.openjpa.writebehind

Examples of org.apache.openjpa.writebehind.WriteBehindCacheManager


    public void setWriteBehindCacheManager(String writeBehindCacheManager) {
        writeBehindCacheManagerPlugin.setString(writeBehindCacheManager);
    }

    public WriteBehindCacheManager getWriteBehindCacheManagerInstance() {
        WriteBehindCacheManager wbcm =
            (WriteBehindCacheManager) writeBehindCacheManagerPlugin.get();
        if (wbcm == null) {
            wbcm =
                (WriteBehindCacheManager) writeBehindCacheManagerPlugin
                    .instantiate(WriteBehindCacheManager.class, this);
            wbcm.initialize(this, writeBehindCachePlugin);
        }
        return wbcm;
    }
View Full Code Here


            storeManager.getDelegate() instanceof WriteBehindStoreManager);
    }

    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

    public void testCustomCacheInstanceCreated() {
        HashMap<String, Object> props = new HashMap<String, Object>();
        props.put("openjpa.WriteBehindCache", CustomWriteBehindCache.class.getCanonicalName());
        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

    protected WriteBehindCacheManager getWBCacheManager() {
        return getWBCacheManager(emf);
    }

    protected WriteBehindCacheManager getWBCacheManager(OpenJPAEntityManagerFactorySPI factory) {
        WriteBehindCacheManager wbcm = factory.getConfiguration().getWriteBehindCacheManagerInstance();
        return wbcm;
    }
View Full Code Here

TOP

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

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.