Examples of locateService()


Examples of org.apache.sling.commons.testing.osgi.MockComponentContext.locateService()

        serviceReference.setProperty(
            ServletResolverConstants.SLING_SERVLET_PATHS, SERVLET_PATH);
        serviceReference.setProperty(
            ServletResolverConstants.SLING_SERVLET_EXTENSIONS,
            SERVLET_EXTENSION);
        mockComponentContext.locateService(SERVLET_NAME, serviceReference);

        configureComponentContext(mockComponentContext);

        servletResolver.bindServlet(serviceReference);
        servletResolver.activate(mockComponentContext);
View Full Code Here

Examples of org.apache.tuscany.core.context.impl.CompositeContextImpl.locateService()

        Component moduleComponent = MockFactory.createCompositeComponent("module");
        runtime.registerModelObject(moduleComponent);
        CompositeContextImpl moduleContext = (CompositeContextImpl) runtime.getContext("module");
        moduleContext.publish(new ModuleStart(this));
        try {
            moduleContext.locateService("TestService");
            fail("Expected " + ServiceNotFoundException.class.getName());
        } catch (ServiceNotFoundException e) {
            // expected
        }
        moduleContext.publish(new ModuleStop(this));
View Full Code Here

Examples of org.apache.tuscany.core.context.impl.CompositeContextImpl.locateService()

        // start the modules and test inter-module system wires
        system.publish(new ModuleStart(this));
        moduleContext.publish(new ModuleStart(this));
        try {
            moduleContext.locateService("TestServiceES");
            fail("Expected " + ServiceNotFoundException.class.getName());
        } catch (ServiceNotFoundException e) {
            // expected
        }
        moduleContext.publish(new ModuleStop(this));
View Full Code Here

Examples of org.apache.tuscany.core.context.impl.CompositeContextImpl.locateService()

        EntryPoint epSystemBinding = MockFactory.createEPSystemBinding("TestServiceEP", ModuleScopeSystemComponent.class, "NoReference", component);
        moduleContext.registerModelObject(epSystemBinding);

        moduleContext.publish(new ModuleStart(this));
        try {
            moduleContext.locateService("TestServiceEP");
            fail("Expected " + ServiceNotFoundException.class.getName());
        } catch (ServiceNotFoundException e) {
            // expected
        }
        moduleContext.publish(new ModuleStop(this));
View Full Code Here

Examples of org.apache.tuscany.spi.component.CompositeComponent.locateService()

        EasyMock.expect(component.getServiceInstance()).andReturn(originalSource);
        EasyMock.expect(component.isSystem()).andReturn(false).atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(interfaces);
        EasyMock.replay(component);
        parent.register(component);
        Source source = parent.locateService(Source.class, "source");
        assertNotNull(source);
        EasyMock.verify(component);
    }

    public void testComponentResolution() throws NoSuchMethodException {
View Full Code Here

Examples of org.osoa.sca.CompositeContext.locateService()

    public static void main(String[] args) {
        try {
            HelloWorldRmiClient rmiClient = new HelloWorldRmiClient();
                       
            CompositeContext context = CurrentCompositeContext.getContext();
            HelloWorldService helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldServiceComponent");
            System.out.println("***********************************************************");
            System.out.println(helloWorldService.sayHello("SCA RMI Client"));
            System.out.println("***********************************************************");
        } catch ( Exception e ) {
            e.printStackTrace();
View Full Code Here

Examples of org.osoa.sca.CompositeContext.locateService()

*/
public class HelloWorldClient {

    public  final static void main(String[] args) throws Exception {
        CompositeContext compositeContext = CurrentCompositeContext.getContext();
        HelloWorldService helloWorldService= compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent");
        String value = helloWorldService.getGreetings("World");
        System.out.println(value);
    }
}
View Full Code Here

Examples of org.osoa.sca.CompositeContext.locateService()

    @Override
    public int doStartTag() throws JspException {
        CompositeContext moduleContext = CurrentCompositeContext.getContext();

        Object service = moduleContext.locateService(Object.class, mName);

        if (service == null) {
            throw new JspException("Service [" + mName + "] not found in current module context");
        }
        if (mId == null) {
View Full Code Here

Examples of org.osoa.sca.CompositeContext.locateService()

            throw new JspException("Invalid profile location specified");
        }

        CompositeContext moduleContext = CurrentCompositeContext.getContext();

        ProfileService profile = moduleContext.locateService(ProfileService.class, mProfile);

        if (profile == null) {
            throw new JspException("Profile [" + mProfile + "] not found in current module context");
        }
View Full Code Here

Examples of org.osoa.sca.CompositeContext.locateService()

    @Override
    public int doStartTag() throws JspException {
        CompositeContext moduleContext = CurrentCompositeContext.getContext();

        ProfileService profile = moduleContext.locateService(ProfileService.class, mProfileService);

        if (profile == null) {
            throw new JspException("Profile [" + mProfileService + "] not found in current module context");
        }
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.