Examples of ConfigurationProvider


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

        if (str != null && str.length() > 0) {
            // cache system properties to reduce load on file system
            Properties loaded = (Properties) _sysprops.get(str);
            if (loaded == null) {
                loaded = new Properties();
                ConfigurationProvider cp =
                    (ConfigurationProvider) Configurations.getProperty(
                            str, null);

                if (cp != null)
                    loaded.putAll(cp.getProperties());
                _sysprops.put(str, loaded);
            }
            p.putAll(loaded);
        }
View Full Code Here

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

        if (str != null && str.length() > 0) {
            // cache system properties to reduce load on file system
            Properties loaded = (Properties) _sysprops.get(str);
            if (loaded == null) {
                loaded = new Properties();
                ConfigurationProvider cp =
                    (ConfigurationProvider) Configurations
                        .getProperty(str, null);
                if (cp != null)
                    loaded.putAll(cp.getProperties());
                _sysprops.put(str, loaded);
            }
            p.putAll(loaded);
        }
View Full Code Here

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

        Options opts = new Options();
        args = opts.setFromCmdLine(args);
        boolean devpath = opts.getBooleanProperty("scanDevPath", "ScanDevPath",
            true);

        ConfigurationProvider cp = new MapConfigurationProvider(opts);
        BrokerFactory factory = Bootstrap.newBrokerFactory(cp, null);
        try {
            MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance(
                factory, devpath);
View Full Code Here

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

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

            BrokerFactory factory = getBrokerFactory(cp, poolValue, BundleUtils.getBundleClassLoader());
View Full Code Here

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

    public OpenJPAEntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo pui, Map m) {
        PersistenceProductDerivation pd = new PersistenceProductDerivation();
        try {
            Object poolValue = Configurations.removeProperty(EMF_POOL, m);
            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(), newConfigurationImpl()));
            } 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, getDefaultBrokerAlias());
            }

            // OPENJPA-1491 If running under OSGi, use the Bundle's ClassLoader instead of the application one
            BrokerFactory factory;
            if (BundleUtils.runningUnderOSGi()) {
View Full Code Here

Examples of org.jboss.ws.metadata.config.ConfigurationProvider

      throw new NotImplementedException();
   }

   public void setConfigName(String configName, String configFile)
   {
      ConfigurationProvider configProvider = (ConfigurationProvider)getEndpointMetaData();
      configProvider.setConfigName(configName, configFile);
   }
View Full Code Here

Examples of org.jooq.ConfigurationProvider

        }
    }

    @SuppressWarnings("deprecation")
    protected final void register(final Configuration configuration) {
        ConfigurationRegistry.setProvider(new ConfigurationProvider() {

            @Override
            public Configuration provideFor(Configuration c) {
                return configuration;
            }
View Full Code Here

Examples of org.objectweb.celtix.configuration.ConfigurationProvider

        String className = getDefaultProviderClassName();
      
        Class<? extends ConfigurationProvider> providerClass;
        try {
            providerClass = Class.forName(className).asSubclass(ConfigurationProvider.class);
            ConfigurationProvider provider = providerClass.newInstance();
            provider.init(configuration);
            return provider;
        } catch (ConfigurationException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new ConfigurationException(new Message("DEFAULT_PROVIDER_INSTANTIATION_EXC", LOG), ex);
View Full Code Here

Examples of org.objectweb.celtix.configuration.ConfigurationProvider

        // temporary:
        //providers.add(new InMemoryProvider());

        DefaultConfigurationProviderFactory factory = DefaultConfigurationProviderFactory.getInstance();
        ConfigurationProvider defaultProvider = factory.createDefaultProvider(this);

        if (null != defaultProvider) {
            providers.add(defaultProvider);
        }
    }
View Full Code Here

Examples of org.ocpsoft.rewrite.config.ConfigurationProvider

      {
         Class<ConfigurationProvider<?>> providerType = (Class<ConfigurationProvider<?>>) type;
         Collection<ConfigurationProvider<?>> enriched = ServiceLoader.loadEnriched(providerType);
         if (enriched.size() == 1)
         {
            ConfigurationProvider provider = enriched.iterator().next();
            Object configurationContext = context.get(type);
            if (provider.handles(configurationContext))
            {
               Configuration config = provider.getConfiguration(configurationContext);
               if (config != null)
               {
                  for (Rule rule : config.getRules())
                  {
                     ConfigurationRuleBuilder ruleBuilder = context.getConfigurationBuilder().addRule(rule);
                     if (rule instanceof RelocatableRule && ((RelocatableRule) rule).isRelocated())
                        ruleBuilder.withPriority(((RelocatableRule) rule).priority());
                     else
                        ruleBuilder.withPriority(provider.priority());
                  }
               }
            }
            else
               throw new RewriteException("@" + RewriteConfiguration.class.getSimpleName() + " type [" + type.getName()
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.