Examples of ConfigurationPlugin


Examples of org.apache.qpid.server.configuration.plugins.ConfigurationPlugin

        };
    }

    private ConfigurationPlugin getConfig(final String clazz, final String argName, final String argValue) throws Exception
    {
        final ConfigurationPlugin config = new PrincipalDatabaseAuthenticationManager.PrincipalDatabaseAuthenticationManagerConfiguration();

        XMLConfiguration xmlconfig = new XMLConfiguration();
        xmlconfig.addProperty("pd-auth-manager.principal-database.class", clazz);

        if (argName != null)
        {
            xmlconfig.addProperty("pd-auth-manager.principal-database.attributes.attribute.name", argName);
            xmlconfig.addProperty("pd-auth-manager.principal-database.attributes.attribute.value", argValue);
        }

        // Create a CompositeConfiguration as this is what the broker uses
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);
        config.setConfiguration("security", xmlconfig);
        return config;
    }
View Full Code Here

Examples of org.apache.qpid.server.configuration.plugins.ConfigurationPlugin

    }
   
    private void reconfigure()
    {
        //Reconfigure the queue for to reflect this new binding.
        ConfigurationPlugin config = getVirtualHost().getConfiguration().getQueueConfiguration(this);

        if (_logger.isDebugEnabled())
        {
            _logger.debug("Reconfiguring queue(" + this + ") with config:" + config + " was "+ _queueConfiguration);
        }
View Full Code Here

Examples of org.apache.qpid.server.configuration.plugins.ConfigurationPlugin

    }
   
    private void reconfigure()
    {
        //Reconfigure the queue for to reflect this new binding.
        ConfigurationPlugin config = getVirtualHost().getConfiguration().getQueueConfiguration(this);

        if (config != null)
        {
            if (_logger.isDebugEnabled())
            {
View Full Code Here

Examples of org.apache.qpid.server.configuration.plugins.ConfigurationPlugin

        ExchangeConfigurationPlugin exchangeConfiguration
                = (ExchangeConfigurationPlugin) queue.getVirtualHost().getConfiguration().getConfiguration(exchangeClass);

        // now need to perform the queue-topic-topics-queues magic.
        // So make a new ConfigurationObject that will hold all the configuration for this queue.
        ConfigurationPlugin queueConfig = new QueueConfiguration.QueueConfig();

        // Initialise the queue with any Global values we may have
        PropertiesConfiguration newQueueConfig = new PropertiesConfiguration();
        newQueueConfig.setProperty("name", queue.getName());

        try
        {
            //Set the queue name
            CompositeConfiguration mungedConf = new CompositeConfiguration();
            //Set the queue name
            mungedConf.addConfiguration(newQueueConfig);
            //Set the global queue configuration
            mungedConf.addConfiguration(getConfig().subset("queues"));

            // Set configuration
            queueConfig.setConfiguration("virtualhosts.virtualhost.queues", mungedConf);
        }
        catch (ConfigurationException e)
        {
            // This will not occur as queues only require a name.
            _logger.error("QueueConfiguration requirements have changed.");
        }

        // Merge any configuration the Exchange wishes to apply       
        if (exchangeConfiguration != null)
        {
            queueConfig.addConfiguration(exchangeConfiguration.getConfiguration(queue));
        }

        //Finally merge in any specific queue configuration we have.
        if (_queues.containsKey(queue.getName()))
        {
            queueConfig.addConfiguration(_queues.get(queue.getName()));
        }

        return queueConfig;
    }
View Full Code Here

Examples of org.osgi.service.cm.ConfigurationPlugin

            // Only call the plugin if no cm.target is specified or if it
            // matches the pid of the target service
            String cmTarget = (String) pluginReference.getProperty(CM_TARGET);
            if (cmTarget == null || cmTarget.equals(pid)) {
                ConfigurationPlugin plugin = (ConfigurationPlugin) Activator.bc
                        .getService(pluginReference);
                if (plugin == null) {
                    continue;
                }
                ConfigurationDictionary dictionaryCopy = currentDictionary
                        .createCopyAndRemoveLocation();
                try {
                    plugin.modifyConfiguration(targetServiceReference,
                            dictionaryCopy);
                    if (allowModification && validateDictionary(dictionaryCopy)) {
                        currentDictionary = dictionaryCopy;
                    }
                } catch (Exception exception) {
View Full Code Here

Examples of org.osgi.service.cm.ConfigurationPlugin

        // call the plugins in order
        for ( int i = 0; i < plugins.length; i++ )
        {
            ServiceReference pluginRef = plugins[i];
            ConfigurationPlugin plugin = ( ConfigurationPlugin ) bundleContext.getService( pluginRef );
            if ( plugin != null )
            {
                try
                {
                    plugin.modifyConfiguration( sr, props );
                }
                catch ( Throwable t )
                {
                    log( LogService.LOG_ERROR, "Unexpected problem calling configuration plugin {0}", new Object[]
                        { toString( pluginRef ), t } );
View Full Code Here

Examples of org.osgi.service.cm.ConfigurationPlugin

        // call the plugins in order
        for ( int i = 0; i < plugins.length; i++ )
        {
            ServiceReference pluginRef = plugins[i];
            ConfigurationPlugin plugin = ( ConfigurationPlugin ) bundleContext.getService( pluginRef );
            if ( plugin != null )
            {
                try
                {
                    plugin.modifyConfiguration( sr, props );
                }
                catch ( Throwable t )
                {
                    log( LogService.LOG_ERROR, "Unexpected problem calling configuration plugin {0}", new Object[]
                        { toString( pluginRef ), t } );
View Full Code Here

Examples of org.osgi.service.cm.ConfigurationPlugin

      if (pids != null) {
        String pid = (String) properties.get(Constants.SERVICE_PID);
        if (!Arrays.asList(pids).contains(pid))
          continue;
      }
      ConfigurationPlugin plugin = (ConfigurationPlugin) pluginTracker.getService(references[i]);
      if (plugin != null)
        plugin.modifyConfiguration(managedReference, properties);
    }
  }
View Full Code Here

Examples of org.osgi.service.cm.ConfigurationPlugin

    final boolean[] receivedEvent = new boolean[] { false };

    // the current implementation of configuration admin seems to be prone to threading errors
    // (especially race conditions where event for updates are cumulated and not propagated properly
    // due to the asynch nature) so this plugin only expects one event really without checking the source
    ConfigurationPlugin cp = new ConfigurationPlugin() {

      public void modifyConfiguration(ServiceReference reference, Dictionary properties) {
        synchronized (monitor) {
          receivedEvent[0] = true;
          monitor.notify();
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.