Package org.apache.openjpa.writebehind

Examples of org.apache.openjpa.writebehind.WriteBehindCallback


    public String getWriteBehindCallback() {
        return writeBehindCallbackPlugin.getString();
       
    }
    public WriteBehindCallback getWriteBehindCallbackInstance() {
        WriteBehindCallback callback = (WriteBehindCallback) writeBehindCallbackPlugin.get();
        if (callback == null) {
            callback = (WriteBehindCallback) writeBehindCallbackPlugin.instantiate(WriteBehindCallback.class, this);
        }
        return callback;
    }
View Full Code Here


            wbcache instanceof SimpleWriteBehindCache);
    }

    public void testWriteBehindCallbackCreated() {
        assertNotNull("EMF was not created.", emf);
        WriteBehindCallback callback = getWBCallback();
        assertNotNull("WB Callback should exist", callback);

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

    public void testCustomCallbackCreated() {
        HashMap<String, Object> props = new HashMap<String, Object>();
        props.put("openjpa.WriteBehindCache", CustomWriteBehindCache.class.getCanonicalName());
        props.put("openjpa.WriteBehindCallback", CustomWriteBehindCallback.class.getCanonicalName());

        WriteBehindCallback callback = getWBCallback(getCustomFactory(props));
        assertNotNull("WB Callback should exist", callback);

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

        assertNotSame("Configuration objects for different EMFs should not be the same", conf1, conf2);

        assertNotSame("Each Configuration should have its own WriteBehindCallbackPlugins",
            conf1.writeBehindCallbackPlugin, conf2.writeBehindCallbackPlugin);
       
        WriteBehindCallback wbc1 = conf1.getWriteBehindCallbackInstance();
        WriteBehindCallback wbc2 = conf2.getWriteBehindCallbackInstance();
        assertNotNull(wbc1);
        assertNotNull(wbc2);
        assertNotSame("Each Configuration should have its own WriteBehindCallback", wbc1, wbc2);
    }
View Full Code Here

TOP

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

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.