Package org.oasisopen.sca.client

Examples of org.oasisopen.sca.client.SCAClientFactory


    public void testDefault() throws Exception {

        node = NodeFactory.getInstance().createNode((String)null, new String[] {"target/classes"});
        node.start();

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("default"));
        HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
        assertEquals("Hello petra", service.sayHello("petra"));
       
        RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
        assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));

    }
View Full Code Here


    @Test
    public void testExplicit() throws Exception {
        node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
        node.start();

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
        HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
        assertEquals("Hello petra", service.sayHello("petra"));
       
        RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
        assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

    @Test
    public void testWithBadServiceName() throws Exception {
        node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
        node.start();

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
        try {
           clientFactory.getService(HelloworldService.class, "HelloworldComponent/foo");
           fail();
        } catch (NoSuchServiceException e) {
            // expected
        }
    }
View Full Code Here

    public void testWithBadDomainName() throws Exception {
        node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
        node.start();

        try {
            SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("someBadDomainName"));
            fail();
        } catch (NoSuchDomainException e) {
            // expected
        }
    }
View Full Code Here

        if (domainURI == null || domainURI.length() < 1) {
            domainURI = "uri:default";
        }

        System.out.println("HelloworldSCAClient, using domainURI " + domainURI);
        SCAClientFactory factory = SCAClientFactory.newInstance(URI.create(domainURI));

        String name = args.length < 1 ? "world" : args[0];
        System.out.println("Calling HelloworldComponent.sayHello(\"" + name + "\"):");
        Helloworld service = factory.getService(Helloworld.class, "HelloworldComponent");
        System.out.println(service.sayHello(name));
     }
View Full Code Here

    final String factoryImplClassName =
      discoverProviderFactoryImplClass(properties, classLoader);
    final Class<? extends SCAClientFactory> factoryImplClass
      = loadProviderFactoryClass(factoryImplClassName,
                             classLoader);
    final SCAClientFactory factory =
      instantiateSCAClientFactoryClass(factoryImplClass,
                   domainURI );
    return factory;
  }
View Full Code Here

        throws NoSuchDomainException, ServiceRuntimeException {
       
        try {
            Constructor<? extends SCAClientFactory> URIConstructor =
              factoryImplClass.getConstructor(URI.class);
            SCAClientFactory provider =
               URIConstructor.newInstance( domainURI );
            return provider;
        } catch (Throwable ex) {
            throw new ServiceRuntimeException(
               "Failed to instantiate SCAClientFactory implementation class "
View Full Code Here

    public void testDefault() throws Exception {

        node = NodeFactory.getInstance().createNode((String)null, new String[] {"target/classes"});
        node.start();

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("default"));
        HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
        assertEquals("Hello petra", service.sayHello("petra"));
       
        RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
        assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));

    }
View Full Code Here

    @Test
    public void testExplicit() throws Exception {
        node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
        node.start();

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
        HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
        assertEquals("Hello petra", service.sayHello("petra"));
       
        RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
        assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

    @Test
    public void testWithBadServiceName() throws Exception {
        node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
        node.start();

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
        try {
           clientFactory.getService(HelloworldService.class, "HelloworldComponent/foo");
           fail();
        } catch (NoSuchServiceException e) {
            // expected
        }
    }
View Full Code Here

TOP

Related Classes of org.oasisopen.sca.client.SCAClientFactory

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.