Package org.socialmusicdiscovery.server.business.logic.config

Examples of org.socialmusicdiscovery.server.business.logic.config.MappedConfigurationContext


      defaultConfiguration.add(entity);
    }

    defaultValueConfigurationManager.setParametersForPath(
        pluginConfigurationPath, defaultConfiguration);
    ami.setConfiguration(new MappedConfigurationContext(
        pluginConfigurationPath, defaultValueConfigurationManager));
    Map<String, String> parameters = new HashMap<String, String>();
    try {
      ami.init(parameters);
    } catch (InitializationFailedException e) {
View Full Code Here


            }
            entity.setDefaultValue(true);
            defaultConfiguration.add(entity);
        }
        defaultValueConfigurationManager.setParametersForPath(pluginConfigurationPath, defaultConfiguration);
        tagImporter.setConfiguration(new MappedConfigurationContext(pluginConfigurationPath, defaultValueConfigurationManager));
        try {
      tagImporter.init(null);
    } catch (InitializationFailedException e) {
      // TODO Better exception handling
      //      This was added after the throw clause in ProcessingModule interface was added)
View Full Code Here

            }
            entity.setDefaultValue(true);
            defaultConfiguration.add(entity);
        }
        defaultValueConfigurationManager.setParametersForPath(pluginConfigurationPath, defaultConfiguration);
        fileSystem.setConfiguration(new MappedConfigurationContext(pluginConfigurationPath, defaultValueConfigurationManager));
        Map<String, String> parameters = new HashMap<String, String>();
        try {
      fileSystem.init(parameters);
    } catch (InitializationFailedException e) {
      // TODO Better exception handling
View Full Code Here

            // Enable plugins by default unless they have specifically requested a specific default state
            if(defaultValueConfigurationManager.getParameter(pluginConfigurationPath+"enabled")==null) {
                defaultValueConfigurationManager.setParameter(new ConfigurationParameterEntity(pluginConfigurationPath+"enabled", ConfigurationParameter.Type.BOOLEAN, "true", true));
            }
            plugin.setConfiguration(new MappedConfigurationContext(pluginConfigurationPath, new MergedConfigurationManager(new PersistentConfigurationManager())));
        }
    }
View Full Code Here

            }
        });

        for (String pluginId : pluginIdentities) {
            if (!runningPlugins.containsKey(pluginId)) {
                if(new MappedConfigurationContext("",new MergedConfigurationManager(new PersistentConfigurationManager())).getBooleanParameter(PLUGIN_CONFIGURATION_PATH+pluginId+".enabled",true)) {
                    try {
                        startPlugin(pluginId);
                    } catch (PluginException e) {
                        System.err.println("Failed to start: " + pluginId + ": " + e.toString());
                    }
View Full Code Here

                entity.setDefaultValue(true);
                defaultConfiguration.add(entity);
            }
            defaultValueConfigurationManager.setParametersForPath(pluginConfigurationPath, defaultConfiguration);

            mediaImporter.setConfiguration(new MappedConfigurationContext(pluginConfigurationPath, new MergedConfigurationManager(new PersistentConfigurationManager())));
        }
    }
View Full Code Here

        try {
            if(browseServices.containsKey(objectType)) {
                T service = (T) browseServices.get(objectType).newInstance();
                ConfigurationContext context = configurationContexts.get(objectType);
                if (context == null) {
                    context = new MappedConfigurationContext(service.getClass().getName() + ".", new MergedConfigurationManager(new PersistentConfigurationManager()));
                }
                service.setConfiguration(context);
                return service;
            }
            return null;
View Full Code Here

    public <T extends OnlinePlayableElementService> T getOnlinePlayableElementService(String objectType) {
        try {
            T service = (T) playableElementServices.get(objectType).newInstance();
            ConfigurationContext context = configurationContexts.get(objectType);
            if (context == null) {
                context = new MappedConfigurationContext(service.getClass() + ".", new MergedConfigurationManager(new PersistentConfigurationManager()));
            }
            service.setConfiguration(context);
            return service;
        } catch (InstantiationException e) {
            e.printStackTrace();
View Full Code Here

    /**
     * Get the execution parameter value of the specified execution parameter
     * @return The execution parameter value or null if it doesn't exist
     */
    protected ConfigurationContext getExecutionConfiguration() {
        return new MappedConfigurationContext(getId()+".",new MemoryConfigurationManager(executionParameters));
    }
View Full Code Here

TOP

Related Classes of org.socialmusicdiscovery.server.business.logic.config.MappedConfigurationContext

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.