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

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


* @version $Rev: 538806 $ $Date: 2007-05-17 10:51:15 +0530 (Thu, 17 May 2007) $
*/
public class CompositeClient {

    public static void main(String[] args) throws Exception {
      SCADomain domain = SCADomain.newInstance("OuterComposite.composite");
     
        Source source = domain.getService(Source.class, "SourceComponent");
       
        System.out.println("Main thread " + Thread.currentThread());
        source.clientMethod("Client.main");
        Thread.sleep(500);
       
        domain.close();
    }
View Full Code Here


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

public class ConstructorPropertyInjectionTestCase extends TestCase {

    public void testFoo1() throws Exception {
        SCADomain sca = SCADomain.newInstance("ConstructorPropertyInjection.composite");
        Bar foo = sca.getService(Bar.class, "Foo1Component");
        assertEquals("fubar", foo.getBar());
    }
View Full Code Here

        Bar foo = sca.getService(Bar.class, "Foo1Component");
        assertEquals("fubar", foo.getBar());
    }

    public void testFoo2() throws Exception {
        SCADomain sca = SCADomain.newInstance("ConstructorPropertyInjection.composite");
        Bar foo = sca.getService(Bar.class, "Foo2Component");
        assertEquals("fubar", foo.getBar());
    }
View Full Code Here

        Bar foo = sca.getService(Bar.class, "Foo2Component");
        assertEquals("fubar", foo.getBar());
    }

    public void testFoo3() throws Exception {
        SCADomain sca = SCADomain.newInstance("ConstructorPropertyInjection.composite");
        Bar foo = sca.getService(Bar.class, "Foo3Component");
        assertEquals("fubar", foo.getBar());
    }
View Full Code Here

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

        System.out.println("Starting the Sample SCA Calculator...");

        SCADomain domain = SCADomain.newInstance("Calculator.composite");

        System.out.println("Press Enter to Exit...");
        System.in.read();

        domain.close();

        System.out.println("Bye");
        System.exit(0);
    }
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 = null;
            do {
                try {
                    System.out.println("Send a report value, ^C or <end> to end");
                    value = reader.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if(value == null || value.equals("end")) {
                    break;
                }
                testCaseProducer.produceTrafficNotification("Report value [" + value + "]");
            }
            while(true);
                               
            domain.close();
        } catch(Throwable e) {
            e.printStackTrace();
        }
    }
View Full Code Here

* @version $Rev: 577023 $ $Date: 2007-09-18 20:29:38 +0100 (Tue, 18 Sep 2007) $
*/
public class BPELClient {
    public static void main(String[] args) throws Exception {

        SCADomain scaDomain = SCADomain.newInstance("helloworld.composite");
        HelloPortType bpelService = scaDomain.getService(HelloPortType.class, "BPELHelloWorldComponent");
       
        String result = bpelService.hello("Hello");
        System.out.println(result);
       
        scaDomain.close();

    }
View Full Code Here

    public static void main(String[] args) {
        try {
            notificationType = new URI("trafficAdvisory");
            String compositeName = "TrafficAdvisoryNotification.composite";
            SCADomain domain = SCADomain.newInstance(compositeName);
            TestCaseProducer testCaseProducer = domain.getService(TestCaseProducer.class, "TrafficAdvisoryProducer");

            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
            String value = null;
            do {
                try {
                    System.out.println("Send a report value, ^C or <end> to end");
                    value = reader.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if(value == null || value.equals("end")) {
                    break;
                }
                if (value.equals("rb")) {
                    NotificationBindingProviderFactory.removeBroker(notificationType);
                }
                else {
                    testCaseProducer.produceTrafficNotification("Report value [" + value + "]");
                }
            }
            while(true);

            domain.close();
        } catch(Throwable e) {
            e.printStackTrace();
        }
    }
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 = EchoServer.getServer().sendReceive("http://tempuri.org", "bar");
        System.out.println("Echo service = " + echoString );
       
        scaDomain.close();

    }
View Full Code Here

     */
    public static void main(String[] args) {
        BiochemicalCircle biochemicalCircl = new BiochemicalCircleImpl();
        Laboratory lab2 = biochemicalCircl.getLaboratory("Lab2"); //This invocation without use SCA works ok.

        SCADomain scaDomain = SCADomain.newInstance("resources/clinicalLaboratory.composite");
        BiochemicalCircle biochemicalCircle =
            scaDomain.getService(BiochemicalCircle.class, "BiochemicalCircleComponent");
        Laboratory lab = EntityFactory.INSTANCE.createLaboratory();
        lab.setName("lab2");
        biochemicalCircle.setLaboratory(lab); // this invocation works ok too

        lab = biochemicalCircle.getLaboratory("Lab2"); // here I have an exception posted below.

        //here I wait a moment before close scaDomain
        System.out.println(lab.getName());

        scaDomain.close();

    }
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.