Package org.apache.tuscany.sca.host.embedded

Examples of org.apache.tuscany.sca.host.embedded.SCADomain


      throw new IgnoreTest();
    }
        startReaderThread(epmdProcess.getInputStream());
        startReaderThread(epmdProcess.getErrorStream());

    SCADomain scaServiceDomain = SCADomain
        .newInstance("helloworlderlangservice.composite");
    SCADomain scaClientDomain = SCADomain
        .newInstance("helloworlderlangreference.composite");
    HelloWorldService helloWorldService = scaClientDomain.getService(
        HelloWorldService.class, "HelloWorldServiceComponent");
    String msg = helloWorldService.getGreetings("Smith");
    Assert.assertEquals("Hello Smith", msg);
    scaClientDomain.close();
    scaServiceDomain.close();

    epmdProcess.destroy();
  }
View Full Code Here


public class TrafficAdvisoryServer {

    public static void main(String[] args) {
        try {
            SCADomain domain = SCADomain.newInstance("TrafficAdvisoryNotification.composite");
            TestCaseProducer testCaseProducer = domain.getService(TestCaseProducer.class, "TrafficAdvisoryProducer");
            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
            String value = "";
            if (args.length == 1) {
                value = args[0];
            }
            do {
                if(value == null || value.equals("end")) {
                    break;
                }
                try {
                    System.out.println("Send a report value, ^C or 'end' to end");
                    value = reader.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                testCaseProducer.produceTrafficNotification("Report value [" + value + "]");
            }
            while(true);
                               
            domain.close();
        } catch(Throwable e) {
            e.printStackTrace();
        }
    }
View Full Code Here

      if (process != null) {
                startReaderThread(process.getInputStream());
                startReaderThread(process.getErrorStream());
        System.out.println("EPMD server started");

        SCADomain scaDomain = SCADomain
            .newInstance("helloworlderlangservice.composite");
        System.out
            .println("HelloWorld server started (press enter to shutdown)");
        System.in.read();
        scaDomain.close();
                System.out.println("HelloWorld server stopped");

                process.destroy();
        System.out.println("EPMD server stopped");
      }
View Full Code Here

      throw new IgnoreTest();
    }
        startReaderThread(epmdProcess.getInputStream());
        startReaderThread(epmdProcess.getErrorStream());

    SCADomain scaDomain = SCADomain
        .newInstance("helloworlderlangservice.composite");
    HelloWorldService helloWorldService = scaDomain.getService(
        HelloWorldService.class,
        "HelloWorldServiceComponent/HelloWorldService");
    assertNotNull(helloWorldService);
    assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
    scaDomain.close();

    epmdProcess.destroy();
  }
View Full Code Here

*/
public class HelloWorldTestClient {
   
    public static void main(String[] args) throws Exception {

        SCADomain scaDomain = SCADomain.newInstance("helloworld/helloworld.composite");

        HelloWorld helloworld = scaDomain.getService(HelloWorld.class, "HelloWorldComponent");
        assert "Hello petra".equals(helloworld.sayHello("petra"));

        helloworld = scaDomain.getService(HelloWorld.class, "HelloWorldComponent2/HelloWorld2");
        assert "Hello petra".equals(helloworld.sayHello("petra"));

        scaDomain.close();
    }
View Full Code Here

import org.apache.tuscany.sca.host.embedded.SCADomain;

public class CalculatorCORBAServer {

    public static void main(String[] args) {
        SCADomain scaDomain;
        try {
            scaDomain = SCADomain.newInstance("CalculatorCORBAServer.composite");

            System.out.println("Calculator CORBA server started (press enter to shutdown)");
            System.in.read();
            scaDomain.close();
            System.out.println("Calculator CORBA server stopped");
        } catch (IOException e) {
            e.printStackTrace();
        }
View Full Code Here

* This client program shows how to create an SCA runtime, start it,
* and locate and invoke a SCA component
*/
public class CalculatorClient {
    public static void main(String[] args) throws Exception {
        SCADomain scaDomain = SCADomain.newInstance("CalculatorCORBAReference.composite");
        CalculatorService calculatorService =
            scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");

        // Calculate
        System.out.println("3 + 2=" + calculatorService.add(3, 2));
        System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
        System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
        System.out.println("3 / 2=" + calculatorService.divide(3, 2));
       
        scaDomain.close();

    }
View Full Code Here

*/
public class EchoBindingClient {

    public static void main(String[] args) throws Exception {

        SCADomain scaDomain = SCADomain.newInstance("EchoBinding.composite");

        // Call the echo service component which will, in turn, call a reference
        // with an echo binding. The echo binding will echo the given string.
        Echo service = scaDomain.getService(Echo.class, "EchoComponent");
        String echoString = service.echo("foo");
        System.out.println("Echo reference = " + echoString);

        // Call the echo server. This will dispatch the call to a service with an
        // echo binding. The echo binding will pass the call to the echo component.
        echoString = (String)EchoServer.getServer().call("http://example.com/server", new Object[] {"bar"});
        System.out.println("Echo service = " + echoString);

        scaDomain.close();

    }
View Full Code Here

* locate the HelloWorld service and invoke it.
*/
public class HelloWorldErlangClient {

    public  final static void main(String[] args) throws Exception {
    SCADomain scaDomain = SCADomain.newInstance("helloworlderlangreference.composite");
        HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent");
        String value = helloWorldService.getGreetings("World");
        System.out.println(value);
        scaDomain.close();
    }
View Full Code Here

    }

    public static void main(String[] args) throws Exception {

        BrokerService broker = startBroker();
        SCADomain scaDomain = SCADomain.newInstance("helloworldwsjms.composite");

        try {
            System.out.println("HelloWorld server started (press enter to shutdown)");
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }

        scaDomain.close();
        broker.stop();
        System.out.println("HelloWorld server stopped");
        // FIXME: Workaround for http://issues.apache.org/jira/browse/AXIS2-3685
        System.exit(0);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.host.embedded.SCADomain

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.