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

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


    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


            // 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

    private ConfigurationManager configurationManager;

    public LibraryBrowseService() {
        InjectHelper.injectMembers(this);
        configurationManager = new MergedConfigurationManager(new PersistentConfigurationManager());
    }
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

     */
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Collection<ConfigurationParameterEntity> getParameters(@QueryParam("path") String path) {
        if(path!=null) {
            return new CopyHelper().detachedCopy(new MergedConfigurationManager(new PersistentConfigurationManager()).getParametersByPath(path), Expose.class);
        }else {
            return new CopyHelper().detachedCopy(new MergedConfigurationManager(new PersistentConfigurationManager()).getParameters(), Expose.class);
        }
    }
View Full Code Here

     */
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{id}")
    public ConfigurationParameter getParameter(@PathParam("id") String id) {
        return new CopyHelper().copy(new MergedConfigurationManager(new PersistentConfigurationManager()).getParameter(id), Expose.class);
    }
View Full Code Here

TOP

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

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.