Package org.osgi.service.cm

Examples of org.osgi.service.cm.ConfigurationEvent


        scct.init();

        @SuppressWarnings("unchecked")
        ServiceReference<ConfigurationAdmin> cmRef = EasyMock.createMock(ServiceReference.class);
        EasyMock.replay(cmRef);
        ConfigurationEvent event = new ConfigurationEvent(cmRef, ConfigurationEvent.CM_DELETED, null, testPid);

        EasyMock.reset(cm);
        // Do not expect any further calls to cm...
        EasyMock.replay(cm);
View Full Code Here


        scct.init();

        @SuppressWarnings("unchecked")
        ServiceReference<ConfigurationAdmin> cmRef = EasyMock.createMock(ServiceReference.class);
        EasyMock.replay(cmRef);
        ConfigurationEvent event = new ConfigurationEvent(cmRef, ConfigurationEvent.CM_LOCATION_CHANGED, null, testPid);

        scct.configurationEvent(event);
        EasyMock.verify(cm); // Ensure that this doesn't cause any unwanted calls on ConfigAdmin
    }
View Full Code Here

        @SuppressWarnings("unchecked")
        ServiceReference<ConfigurationAdmin> cmRef = EasyMock.createMock(ServiceReference.class);
        EasyMock.expect(cmRef.getBundle()).andReturn(null).anyTimes();
        EasyMock.replay(cmRef);

        ConfigurationEvent event = new ConfigurationEvent(cmRef, ConfigurationEvent.CM_UPDATED, null, testPid);
       

        assertEquals("Precondition", 0, generateCalled.size());
        scct.configurationEvent(event);
        assertEquals(1, generateCalled.size());
View Full Code Here

        scct.init();

        @SuppressWarnings("unchecked")
        ServiceReference<ConfigurationAdmin> cmRef = EasyMock.createMock(ServiceReference.class);
        EasyMock.replay(cmRef);
        ConfigurationEvent event = new ConfigurationEvent(cmRef, ConfigurationEvent.CM_UPDATED, null, "test123");

        scct.configurationEvent(event);
        EasyMock.verify(cm); // Ensure that this doesn't cause any unwanted calls on ConfigAdmin
    }
View Full Code Here

        scct.init();

        @SuppressWarnings("unchecked")
        ServiceReference<ConfigurationAdmin> cmRef = EasyMock.createMock(ServiceReference.class);
        EasyMock.replay(cmRef);
        ConfigurationEvent event = new ConfigurationEvent(cmRef, ConfigurationEvent.CM_DELETED, null, testPid);

        Configuration c1 = EasyMock.createMock(Configuration.class);
        c1.delete();
        EasyMock.expectLastCall().once();
        EasyMock.replay(c1);
View Full Code Here

        scct.init();

        @SuppressWarnings("unchecked")
        ServiceReference<ConfigurationAdmin> cmRef = EasyMock.createMock(ServiceReference.class);
        EasyMock.replay(cmRef);
        ConfigurationEvent event = new ConfigurationEvent(cmRef, ConfigurationEvent.CM_DELETED, null, testPid);

        EasyMock.reset(cm);
        // Do not expect any further calls to cm...
        EasyMock.replay(cm);
View Full Code Here

        scct.init();

        @SuppressWarnings("unchecked")
        ServiceReference<ConfigurationAdmin> cmRef = EasyMock.createMock(ServiceReference.class);
        EasyMock.replay(cmRef);
        ConfigurationEvent event = new ConfigurationEvent(cmRef, ConfigurationEvent.CM_LOCATION_CHANGED, null, testPid);

        scct.configurationEvent(event);
        EasyMock.verify(cm); // Ensure that this doesn't cause any unwanted calls on ConfigAdmin
    }
View Full Code Here

            Configuration[] configs = findConfigurations((ConfigurationAdmin) configurationAdmin, null);
            if (configs != null)
            {
                for (int i = 0; i < configs.length; i++)
                {
                    ConfigurationEvent cfgEvent = new ConfigurationEvent(configurationAdminReference,
                        ConfigurationEvent.CM_UPDATED, configs[i].getFactoryPid(), configs[i].getPid());
                    configurationEvent(cfgEvent);
                }
            }
        }
View Full Code Here

    if (configAdminReference == null)
      configAdminReference = reference;
  }

  public void dispatchEvent(int type, String factoryPid, String pid) {
    final ConfigurationEvent event = createConfigurationEvent(type, factoryPid, pid);
    if (event == null)
      return;

    ServiceReference[] refs = tracker.getServiceReferences();
    if (refs == null)
View Full Code Here

  private synchronized ConfigurationEvent createConfigurationEvent(int type, String factoryPid, String pid) {
    if (configAdminReference == null)
      return null;

    return new ConfigurationEvent(configAdminReference, type, factoryPid, pid);
  }
View Full Code Here

TOP

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

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.