Package org.osgi.service.cm

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


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

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

      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

    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

Related Classes of org.osgi.service.cm.ConfigurationPlugin

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.