Package org.apache.openjpa.lib.conf

Examples of org.apache.openjpa.lib.conf.ConfigurationProvider


    public void testEncryptionPluginConfigurationDefaultValue() throws Exception {
    PersistenceProductDerivation ppd = new PersistenceProductDerivation();
    OpenJPAConfiguration conf = new OpenJPAConfigurationImpl();
    ClassLoader loader = null;

    ConfigurationProvider provider = ppd.load(
        PersistenceProductDerivation.RSRC_DEFAULT,
        "encryption_plugin_default_pu", loader);
    provider.setInto(conf);

    assertNull(conf.getEncryptionProvider());
  }
View Full Code Here


     */
    public OpenJPAEntityManagerFactory createEntityManagerFactory(String name,
        String resource, Map m) {
        PersistenceProductDerivation pd = new PersistenceProductDerivation();
        try {
            ConfigurationProvider cp = pd.load(resource, name, m);
            if (cp == null)
                return null;

            BrokerFactory factory = Bootstrap.newBrokerFactory(cp, null);
            return JPAFacadeHelper.toEntityManagerFactory(factory);
View Full Code Here

    public OpenJPAEntityManagerFactory createContainerEntityManagerFactory(
        PersistenceUnitInfo pui, Map m) {
        PersistenceProductDerivation pd = new PersistenceProductDerivation();
        try {
            ConfigurationProvider cp = pd.load(pui, m);
            if (cp == null)
                return null;

            // add enhancer
            Exception transformerException = null;
            String ctOpts = (String) Configurations.getProperty
                (CLASS_TRANSFORMER_OPTIONS, pui.getProperties());
            try {
                pui.addTransformer(new ClassTransformerImpl(cp, ctOpts,
                    pui.getNewTempClassLoader()));
            } catch (Exception e) {
                // fail gracefully
                transformerException = e;
            }

            // if the BrokerImpl hasn't been specified, switch to the
            // non-finalizing one, since anything claiming to be a container
            // should be doing proper resource management.
            if (!Configurations.containsProperty(BrokerValue.KEY,
                cp.getProperties())) {
                cp.addProperty("openjpa." + BrokerValue.KEY,
                    BrokerValue.NON_FINALIZING_ALIAS);
            }

            BrokerFactory factory = Bootstrap.newBrokerFactory(cp,
                pui.getClassLoader());
View Full Code Here

TOP

Related Classes of org.apache.openjpa.lib.conf.ConfigurationProvider

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.