Package org.osgi.service.cm

Examples of org.osgi.service.cm.ConfigurationListener


   * @param bc The bundle context to use to get the service.
   */
  public void sendEvent(BundleContext bc) {
    if(sr != null)
    {
      ConfigurationListener configurationListener = (ConfigurationListener) bc.getService(sr);
      if(configurationListener != null)
      {
        configurationListener.configurationEvent(event);
      }
      bc.ungetService(sr);
    }
  }
View Full Code Here


            final CountDownLatch latch = new CountDownLatch(1);
            final int configEvent = (props != null) ? ConfigurationEvent.CM_UPDATED : ConfigurationEvent.CM_DELETED;

            config = configAdmin.getConfiguration(pid, null);

            reg = m_context.registerService(ConfigurationListener.class.getName(), new ConfigurationListener()
            {
                @Override
                public void configurationEvent(ConfigurationEvent event)
                {
                    if (pid.equals(event.getPid()) && event.getType() == configEvent)
View Full Code Here

        bundle.stop();
        delay();
       
        checkConfigurationCount(b2, pid, 0, -1);

        ConfigurationListener listener = new ConfigurationListener() {

            public void configurationEvent(ConfigurationEvent event)
            {
                if (event.getType() == ConfigurationEvent.CM_LOCATION_CHANGED)
                {
View Full Code Here

        bundle.stop();
        delay();
       
        checkConfigurationCount(b2, pid, 0, -1);

        ConfigurationListener listener = new ConfigurationListener() {

            public void configurationEvent(ConfigurationEvent event)
            {
                if (event.getType() == ConfigurationEvent.CM_LOCATION_CHANGED)
                {
View Full Code Here

        bundle.stop();
        delay();
       
        TestCase.assertEquals( Component.STATE_UNSATISFIED, c2.getState() );

        ConfigurationListener listener = new ConfigurationListener() {

            public void configurationEvent(ConfigurationEvent event)
            {
                if (event.getType() == ConfigurationEvent.CM_LOCATION_CHANGED)
                {
View Full Code Here

        bundle.stop();
        delay();
       
        TestCase.assertEquals( Component.STATE_UNSATISFIED, c2.getState() );

        ConfigurationListener listener = new ConfigurationListener() {

            public void configurationEvent(ConfigurationEvent event)
            {
                if (event.getType() == ConfigurationEvent.CM_LOCATION_CHANGED)
                {
View Full Code Here

        // Get the {@link ConfigurationAdmin}
        ServiceReference sref = context.getServiceReference(ConfigurationAdmin.class.getName());
        ConfigurationAdmin configAdmin = (ConfigurationAdmin) context.getService(sref);

        final CountDownLatch latch = new CountDownLatch(1);
        ConfigurationListener listener = new ConfigurationListener() {
            @Override
            public void configurationEvent(ConfigurationEvent event) {
                if (ConfiguredService.SERVICE_PID.equals(event.getPid()))
                    latch.countDown();
            }
View Full Code Here

                new ExtendedConfigurationEvent(adminServiceReference,
                        type, factoryPid, pid);

        for (int i = 0; i < references.length; i++) {
            ServiceReference reference = references[i];
            ConfigurationListener listener = (ConfigurationListener)
                    context.getService(reference);
            if (listener != null) {
                try {
                    listener.configurationEvent(event);
                } catch (Throwable t) {
                    // todo log it.
                } finally {
                    context.ungetService(reference);
                }
View Full Code Here

            // if we start/use camel context between point 9 and 10 we may get many different errors described in https://issues.apache.org/jira/browse/ARIES-961

            // to synchronize this (main) thread of execution with the asynchronous series of events, we can register the following listener.
            // this way be sure that we got to point 3
            final CountDownLatch latch = new CountDownLatch(2);
            answer.registerService(ConfigurationListener.class, new ConfigurationListener() {
                @Override
                public void configurationEvent(ConfigurationEvent event) {
                    if (event.getType() == ConfigurationEvent.CM_LOCATION_CHANGED) {
                        latch.countDown();
                    }
View Full Code Here

    for (int i = 0; i < refs.length; ++i) {
      final ServiceReference ref = refs[i];
      queue.put(new Runnable() {
        public void run() {
          ConfigurationListener listener = (ConfigurationListener) tracker.getService(ref);
          if (listener == null) {
            return;
          }
          try {
            listener.configurationEvent(event);
          } catch (Throwable t) {
            log.log(LogService.LOG_ERROR, t.getMessage(), t);
          }
        }
      });
View Full Code Here

TOP

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

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.