Package org.apache.felix.ipojo

Examples of org.apache.felix.ipojo.Factory.createComponentInstance()


            return null;
        }

        // if(fact.isAcceptable(configuration)) {
        try {
            return fact.createComponentInstance(configuration);
        } catch (Exception e) {
            e.printStackTrace();
         
            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
View Full Code Here


        }

        try {
            Properties props = new Properties();
            props.put("instance.name",name);
            return fact.createComponentInstance(props);
        } catch (Exception e) {
            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
            e.printStackTrace();
            return null;
        }
View Full Code Here

        if (fact == null) { return null; }

        if (fact.isAcceptable(configuration)) {
            try {
                return fact.createComponentInstance(configuration);
            } catch (Exception e) {
                System.err.println(e.getMessage());
                e.printStackTrace();
                return null;
            }
View Full Code Here

        props.put("bools", "{true,true,true}");
        props.put("string", "foo");
        props.put("strings", "{foo, bar, baz}");
       
        try {
            instance = fact.createComponentInstance(props);
        } catch (Exception e) {
           fail("Cannot create the under-test instance : " + e.getMessage());
        }
       
       
View Full Code Here

        ComponentInstance ci = null;
        Factory factory =  Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.PropertyModifier");
        Properties props = new Properties();
        props.put("cls", new String[] {FooService.class.getName()});
        try {
            ci = factory.createComponentInstance(props);
        } catch (Exception e) {
            fail(e.getMessage());
        }
       
        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), ci.getInstanceName());
View Full Code Here

        props.put("bools", "{true,true,true}");
        props.put("string", "foo");
        props.put("strings", "{foo, bar, baz}");
       
        try {
            instance = fact.createComponentInstance(props);
        } catch(Exception e) {
           fail("Cannot create the under-test instance : " + e.getMessage());
        }
       
        try {
View Full Code Here

        } catch(Exception e) {
           fail("Cannot create the under-test instance : " + e.getMessage());
        }
       
        try {
            instance2 = fact.createComponentInstance(null);
        } catch (Exception e) {
            e.printStackTrace();
            fail("Cannot create the instance : " + e.getMessage());

        }
View Full Code Here

        props.put("bools", "{true,true,true}");
        props.put("string", "foo");
        props.put("strings", "{foo, bar, baz}");
       
        try {
            instance = fact.createComponentInstance(props);
        } catch(Exception e) {
           fail("Cannot create the under-test instance : " + e.getMessage());
        }
       
        try {
View Full Code Here

        } catch(Exception e) {
           fail("Cannot create the under-test instance : " + e.getMessage());
        }
       
        try {
            instance2 = fact.createComponentInstance(null);
        } catch(Exception e) {
           fail("Cannot create the under-test instance2 : " + e.getMessage());
        }
       
       
View Full Code Here

        Properties p = new Properties();
        p.put("instance.name", "importer");
        Factory compFact = ipojoHelper.getFactory("composite.requires.1");
        try {
            import1 = compFact.createComponentInstance(p);
        } catch (Exception e) {
            e.printStackTrace();
            fail("Cannot instantiate the component : " + e.getMessage());
        }
    }
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.