Package org.apache.felix.ipojo

Examples of org.apache.felix.ipojo.Factory


            return null;
        }
    }

    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
        Factory fact = getFactoryByName(bc, factoryName);

        if (fact == null) {
            System.err.println("Factory " + factoryName + " not found");
            return null;
        }

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


        // return null;
        // }
    }

    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
        Factory fact = getFactoryByName(bc, factoryName);

        if (fact == null) {
            System.err.println("Factory " + factoryName + " not found");
            return null;
        }

        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

            return null;
        }
    }

    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
        Factory fact = getFactoryByName(bc, factoryName);

        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

            } else {
              System.out.println("Handler " + name + " (INVALID : " + handlers[i].getMissingHandlers() + ")");
            }
        }

        Factory factory = IPojoTestUtils.getFactoryByName(context, "donut-provider-publishes");
        assertNotNull(factory);
        System.out.println(factory.getDescription());

        // Send donuts and check the sender instance name
        Event receivedEvent;
        for (int i = 0; i < NUMBER_OF_EAH_PROVIDERS; i++) {
            m_eahProviders[i].sellDonut();
View Full Code Here

            return null;
        }
    }

    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
        Factory fact = getFactoryByName(bc, factoryName);

        if (fact == null) {
            System.err.println("Factory " + factoryName + " not found");
            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());
            return null;
        }
View Full Code Here

        // return null;
        // }
    }

    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
        Factory fact = getFactoryByName(bc, factoryName);

        if (fact == null) {
            System.err.println("Factory " + factoryName + " not found");
            return null;
        }

        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

            return null;
        }
    }

    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
        Factory fact = getFactoryByName(bc, factoryName);

        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

            return null;
        }
    }

    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
        Factory fact = getFactoryByName(bc, factoryName);

        if (fact == null) {
            System.err.println("Factory " + factoryName + " not found");
            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());
            return null;
        }
View Full Code Here

        // return null;
        // }
    }

    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
        Factory fact = getFactoryByName(bc, factoryName);

        if (fact == null) {
            System.err.println("Factory " + factoryName + " not found");
            return null;
        }

        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

            return null;
        }
    }

    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
        Factory fact = getFactoryByName(bc, factoryName);

        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

TOP

Related Classes of org.apache.felix.ipojo.Factory

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.