Examples of BrokerFactory


Examples of org.apache.openjpa.kernel.BrokerFactory

                cp.getProperties())) {
                cp.addProperty("openjpa." + BrokerValue.KEY,
                    getDefaultBrokerAlias());
            }

            BrokerFactory factory = getBrokerFactory(cp, poolValue,
                pui.getClassLoader());
            if (transformerException != null) {
                Log log = factory.getConfiguration().getLog(
                    OpenJPAConfiguration.LOG_RUNTIME);
                if (log.isTraceEnabled()) {
                    log.warn(
                        _loc.get("transformer-registration-error-ex", pui),
                        transformerException);
View Full Code Here

Examples of org.apache.openjpa.kernel.BrokerFactory

                // check if we've already warned for this query-factory combo
                StoreContext ctx = resolver.getQueryContext().getStoreContext();
                String query = currentQuery();
                if (ctx.getBroker() != null && query != null) {
                    String key = getClass().getName() + ":" + query;
                    BrokerFactory factory = ctx.getBroker().getBrokerFactory();
                    Object hasWarned = factory.getUserObject(key);
                    if (hasWarned != null)
                        break;
                    else
                        factory.putUserObject(key, Boolean.TRUE);
                }
                Log log = conf.getLog(OpenJPAConfiguration.LOG_QUERY);
                if (log.isWarnEnabled())
                    log.warn(_loc.get("query-extensions-warning", clause,
                        currentQuery()));
View Full Code Here

Examples of org.apache.openjpa.kernel.BrokerFactory

        List<String> slices = conf.getAvailableSliceNames();
        assertTrue(slices.size() > 1);
        assertTrue(slices.contains("One"));
        assertTrue(slices.contains("Two"));
        assertTrue(slices.contains("Three"));
        BrokerFactory bf = ((EntityManagerFactoryImpl) emf).getBrokerFactory();
        Broker broker = bf.newBroker();
        assertEquals(DistributedJDBCBrokerFactory.class, bf.getClass());
        assertEquals(DistributedBrokerImpl.class, broker.getClass());
        assertNotNull(conf.getDistributionPolicyInstance());

        emf.createEntityManager();
View Full Code Here

Examples of org.apache.openjpa.kernel.BrokerFactory

        Map propsMap = new HashMap();
        propsMap.put("openjpa.DataCache", "true");
        propsMap.put("openjpa.RemoteCommitProvider", "sjvm");
        EntityManagerFactory emf = getEmf(propsMap);
        BrokerFactory factory = JPAFacadeHelper.toBrokerFactory(emf);

        Broker broker = factory.newBroker();
        broker.begin();
        broker.persist(new CacheObjectAChild1("foo", "foo", 0), null);
        broker.persist(new CacheObjectAChild1("bar", "bar", 1), null);
        broker.commit();
        broker.close();

        _broker = factory.newBroker();
    }
View Full Code Here

Examples of org.apache.openjpa.kernel.BrokerFactory

            ConfigurationProvider cp = pd.load(resource, name, m);
            if (cp == null) {
                return null;
            }

            BrokerFactory factory = getBrokerFactory(cp, poolValue, null);
            OpenJPAConfiguration conf = factory.getConfiguration();
            _log = conf.getLog(OpenJPAConfiguration.LOG_RUNTIME);           
            pd.checkPuNameCollisions(_log,name);
           
            // add enhancer
            loadAgent(factory);
View Full Code Here

Examples of org.apache.openjpa.kernel.BrokerFactory

            // should be doing proper resource management.
            if (!Configurations.containsProperty(BrokerValue.KEY, cp.getProperties())) {
                cp.addProperty("openjpa." + BrokerValue.KEY, getDefaultBrokerAlias());
            }

            BrokerFactory factory = getBrokerFactory(cp, poolValue, pui.getClassLoader());
            if (transformerException != null) {
                Log log = factory.getConfiguration().getLog(OpenJPAConfiguration.LOG_RUNTIME);
                if (log.isTraceEnabled()) {
                    log.warn(_loc.get("transformer-registration-error-ex", pui), transformerException);
                } else {
                    log.warn(_loc.get("transformer-registration-error", pui));
                }
View Full Code Here

Examples of org.apache.openjpa.kernel.BrokerFactory

                // check if we've already warned for this query-factory combo
                StoreContext ctx = resolver.getQueryContext().getStoreContext();
                String query = currentQuery();
                if (ctx.getBroker() != null && query != null) {
                    String key = getClass().getName() + ":" + query;
                    BrokerFactory factory = ctx.getBroker().getBrokerFactory();
                    Object hasWarned = factory.getUserObject(key);
                    if (hasWarned != null)
                        break;
                    else
                        factory.putUserObject(key, Boolean.TRUE);
                }
                Log log = conf.getLog(OpenJPAConfiguration.LOG_QUERY);
                if (log.isWarnEnabled())
                    log.warn(_loc.get("query-extensions-warning", clause,
                        currentQuery()));
View Full Code Here

Examples of org.apache.openjpa.kernel.BrokerFactory

        List<String> slices = conf.getAvailableSliceNames();
        assertTrue(slices.size() > 1);
        assertTrue(slices.contains("One"));
        assertTrue(slices.contains("Two"));
        assertTrue(slices.contains("Three"));
        BrokerFactory bf = ((EntityManagerFactoryImpl) emf).getBrokerFactory();
        Broker broker = bf.newBroker();
        assertEquals(DistributedJDBCBrokerFactory.class, bf.getClass());
        assertEquals(DistributedBrokerImpl.class, broker.getClass());
        assertNotNull(conf.getDistributionPolicyInstance());

        emf.createEntityManager();
View Full Code Here

Examples of org.apache.openjpa.kernel.BrokerFactory

            (DistributedJDBCConfiguration) emf.getConfiguration();
        List<String> slices = conf.getAvailableSliceNames();
        assertTrue(slices.contains("One"));
        assertTrue(slices.contains("Two"));
        assertTrue(slices.contains("Three"));
        BrokerFactory bf = ((EntityManagerFactoryImpl) emf).getBrokerFactory();
        DistributedBroker broker = (DistributedBroker)bf.newBroker();
        Map newProps = new HashMap();
        newProps.put("openjpa.slice.newslice.ConnectionURL",
                "jdbc:derby:target/database/newslice;create=true");
        newProps.put("openjpa.slice.newslice.ConnectionDriverName",
                "org.apache.derby.jdbc.EmbeddedDriver");
View Full Code Here

Examples of org.apache.openjpa.kernel.BrokerFactory

                // check if we've already warned for this query-factory combo
                StoreContext ctx = resolver.getQueryContext().getStoreContext();
                String query = currentQuery();
                if (ctx.getBroker() != null && query != null) {
                    String key = getClass().getName() + ":" + query;
                    BrokerFactory factory = ctx.getBroker().getBrokerFactory();
                    Object hasWarned = factory.getUserObject(key);
                    if (hasWarned != null)
                        break;
                    else
                        factory.putUserObject(key, Boolean.TRUE);
                }
                Log log = conf.getLog(OpenJPAConfiguration.LOG_QUERY);
                if (log.isWarnEnabled())
                    log.warn(_loc.get("query-extensions-warning", clause,
                        currentQuery()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.