Package org.apache.felix.ipojo.runtime.core.services

Examples of org.apache.felix.ipojo.runtime.core.services.BazService


        }

        ComponentInstance ci = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.runtime.core.components" +
                ".nativ.NativeComponent");

        BazService baz = osgiHelper.getServiceObject(BazService.class, "(instance.name=" + ci.getInstanceName() +")");
        assertEquals("foo: Test program of JNI.", baz.hello(""));
    }
View Full Code Here



        List<BazService> services = osgiHelper.getServiceObjects(BazService.class);
        assertEquals(1, services.size());

        BazService baz = services.get(0);
        assertEquals("Hello Guillaume", baz.hello("Guillaume"));
        ipojoHelper.dispose();
    }
View Full Code Here

    private boolean invoke() {
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(BazService.class.getName(), export3.getInstanceName());
        if (ref == null) {
            return false;
        }
        BazService fs = (BazService) getContext().getService(ref);
        getContext().ungetService(ref);
        return fs.foo();
    }
View Full Code Here

        }
        if (nb > refs.length) {
            return false;
        }
        for (int i = 0; i < nb; i++) {
            BazService fs = (BazService) getContext().getService(refs[i]);
            getContext().ungetService(refs[i]);
            if (!fs.foo()) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

    private boolean invoke() {
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(BazService.class.getName(), export2.getInstanceName());
        if (ref == null) {
            return false;
        }
        BazService fs = (BazService) getContext().getService(ref);
        return fs.foo();
    }
View Full Code Here

    private boolean invoke() {
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(BazService.class.getName(), export1.getInstanceName());
        if (ref == null) {
            return false;
        }
        BazService fs = (BazService) getContext().getService(ref);
        return fs.foo();
    }
View Full Code Here

    private boolean invoke() {
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(BazService.class.getName(), export1.getInstanceName());
        if (ref == null) {
            return false;
        }
        BazService fs = (BazService) getContext().getService(ref);
        return fs.foo();
    }
View Full Code Here

    private boolean invoke() {
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(BazService.class.getName(), export3.getInstanceName());
        if (ref == null) {
            return false;
        }
        BazService fs = (BazService) getContext().getService(ref);
        getContext().ungetService(ref);
        return fs.foo();
    }
View Full Code Here

        }
        if (nb > refs.length) {
            return false;
        }
        for (int i = 0; i < nb; i++) {
            BazService fs = (BazService) getContext().getService(refs[i]);
            getContext().ungetService(refs[i]);
            if (!fs.foo()) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

        }

        assertTrue("Check ci", ci.getState() == ComponentInstance.VALID);
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(BazService.class.getName(), "mon_coeur");
        assertNotNull("Check ref", ref);
        BazService bs = (BazService) getContext().getService(ref);
        assertTrue("Check invocation", bs.foo());
        getContext().ungetService(ref);
        ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "mon_coeur");
        assertNotNull("Check ref 2 ", ref);
        FooService fs = (FooService) getContext().getService(ref);
        assertTrue("Check invocation", fs.foo());
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.runtime.core.services.BazService

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.