Package org.apache.felix.ipojo

Examples of org.apache.felix.ipojo.ComponentInstance.reconfigure()


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

    ci.reconfigure(props);

    assertNotNull(ci);
    assertEquals("instance valid", ComponentInstance.VALID, ci.getState());
  }
View Full Code Here


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

    ci.reconfigure(props);

    assertNotNull(ci);
    assertEquals("instance valid", ComponentInstance.VALID, ci.getState());
  }
View Full Code Here

    // Reconfigure
    props = new Properties();
    props.put("controller", "true");

    ci.reconfigure(props);

    assertNotNull(ci);
    assertEquals("instance valid", ComponentInstance.VALID, ci.getState());
  }
View Full Code Here

        assertEquals("Classes[0] -2", FooService.class.getName(), str2[0].getName());
       
        Properties props2 = new Properties();
        props2.put("cls", new String[] {FooService.class.getName(), CheckService.class.getName()});
        try {
            ci.reconfigure(props2);
        } catch (Exception e) {
            fail(e.getMessage());
        }
       
        // Check the service property
View Full Code Here

        ComponentInstance instance = m_componentInstances.get(name);
        if (instance == null) { // The instance does not exists.
            return;
        }

        instance.reconfigure(properties); // re-configure the component
    }

    public String getFactoryName() {
        return m_componentMetadata.getAttribute("name"); // Mandatory attribute.
    }
View Full Code Here

        assertEquals("(id=2)", dependency.getFilter());

        // Reconfigure the instance.
        Properties newProps = new Properties();
        newProps.put("instance.id", "3");
        instance.reconfigure(newProps);

        assertTrue(instance.getState() == ComponentInstance.INVALID);
        desc = (DependencyHandlerDescription) instance.getInstanceDescription().getHandlerDescription("org.apache.felix" +
                ".ipojo:requires");
View Full Code Here

        // Another reconfiguration (that does not affect the filters)
        newProps = new Properties();
        newProps.put("instance.id", "3");
        newProps.put("stuff", "stuff");
        instance.reconfigure(newProps);

        assertTrue(instance.getState() == ComponentInstance.INVALID);
        desc = (DependencyHandlerDescription) instance.getInstanceDescription().getHandlerDescription("org.apache.felix" +
                ".ipojo:requires");
View Full Code Here

        assertEquals("(id=3)", dependency.getFilter());

        // Yet another reconfiguration, un-setting instance.id
        newProps = new Properties();
        newProps.put("stuff", "stuff");
        instance.reconfigure(newProps);

        assertTrue(instance.getState() == ComponentInstance.INVALID);
        desc = (DependencyHandlerDescription) instance.getInstanceDescription().getHandlerDescription("org.apache.felix" +
                ".ipojo:requires");
View Full Code Here

        // Finally another reconfiguration to build a fulfilled filter
        newProps = new Properties();
        newProps.put("instance.id", "1");
        newProps.put("stuff", "stuff");
        instance.reconfigure(newProps);

        assertTrue(instance.getState() == ComponentInstance.VALID);
        desc = (DependencyHandlerDescription) instance.getInstanceDescription().getHandlerDescription("org.apache.felix" +
                ".ipojo:requires");
View Full Code Here

        CheckService check = osgiHelper.getServiceObject(CheckService.class);
        assertThat(check.getProps().get("grade")).isEqualTo(0);

        Dictionary conf = new Hashtable();
        conf.put("grade", "1");
        instance.reconfigure(conf);

        assertThat(check.getProps().get("grade")).isEqualTo(1);

        conf.put("grade", "2");
        instance.reconfigure(conf);
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.