Package org.osgi.service.cm

Examples of org.osgi.service.cm.Configuration.update()


        // modify the configuration
        Configuration config = getConfigurationAdmin().getConfiguration( factoryConfigPid );
        Dictionary<String, Object> props = config.getProperties();
        props.put( PROP_NAME, PROP_NAME_FACTORY );
        config.update( props );
        delay();

        // ensure instance with new configuration
        TestCase.assertNotNull( SimpleComponent.INSTANCE );
        TestCase.assertEquals( PROP_NAME_FACTORY, SimpleComponent.INSTANCE.getProperty( PROP_NAME ) );
View Full Code Here


       
        final String pid = "SimpleComponent";
        Configuration config = getConfigurationAdmin().getConfiguration( pid, null );
        final Hashtable props = new Hashtable();
        props.put( "target", "bar" );
        config.update(props);
        delay();
       
        //when deadlock is present the state is actually unsatisfied.
        ComponentConfigurationDTO cc = findComponentConfigurationByName( pid, ComponentConfigurationDTO.ACTIVE );
        delay();
View Full Code Here

       
        //when deadlock is present the state is actually unsatisfied.
        ComponentConfigurationDTO cc = findComponentConfigurationByName( pid, ComponentConfigurationDTO.ACTIVE );
        delay();
        props.put( "target", "foo" );
        config.update(props);
        delay();
      
        TestComponent tc = getServiceFromConfiguration(cc, TestComponent.class);
        assertTrue(tc.isSuccess1());
        assertTrue(tc.isSuccess2());
View Full Code Here

            Dictionary props = config.getProperties();
            if (props == null) {
                props = new Hashtable();
            }
            props.put(PROP_AUTH_ANNONYMOUS, Boolean.FALSE);
            config.update(props);
            waitForModified(existingModifiedCounter, TIMEOUT);
        } else if ("enable".equals(action)) {
            int existingModifiedCounter = modifiedCounter;
            Configuration config = configAdmin.getConfiguration(AUTH_PID, null);
            Dictionary props = config.getProperties();
View Full Code Here

            Dictionary props = config.getProperties();
            if (props == null) {
                props = new Hashtable();
            }
            props.put(PROP_AUTH_ANNONYMOUS, Boolean.TRUE);
            config.update(props);
            waitForModified(existingModifiedCounter, TIMEOUT);
        }

        response.getWriter().println("ok");
    }
View Full Code Here

      assertNull("Config " + cfgPid + " must not be found before test", findConfiguration(cfgPid));

      // Install config directly
      ConfigurationAdmin ca = waitForConfigAdmin(true);
      final Configuration c = ca.getConfiguration(cfgPid);
      c.update(cfgData);
        waitForConfigValue("After manual installation", cfgPid, TIMEOUT, "foo", "bar");
        waitForCondition("Expected one ConfigurationEvents since beginning of test", TIMEOUT, new ConfigCondition(cfgPid, 1));

        installer.updateResources(URL_SCHEME, getInstallableResource(cfgPid, cfgData), null);
View Full Code Here

        }
    // First inject a configuration triggering an exception of the validate method.
    props.put("prop", "KO");

    try {
            configuration.update(props);
        } catch (IOException e) {
            fail(e.getMessage());
        }

        String pid = configuration.getPid();
View Full Code Here

    // Reconfigure
    props = new Properties();
    props.put("prop", "OK");

    try {
            configuration.update(props);
        } catch (IOException e) {
            fail(e.getMessage());
        }

        pid = configuration.getPid();
View Full Code Here

        }
    // First inject a configuration triggering an exception of the validate method.
    props.put("prop", "KO");

    try {
            configuration.update(props);
        } catch (IOException e) {
            fail(e.getMessage());
        }

        String pid = configuration.getPid();
View Full Code Here

    // Reconfigure
    props = new Properties();
    props.put("prop", "OK");

    try {
            configuration.update(props);
        } catch (IOException e) {
            fail(e.getMessage());
        }

        pid = configuration.getPid();
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.