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

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


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

            } else {
                throw e;
            }
        }

        SCADomain scaDomain = SCADomain.newInstance("Calculator.composite");
       
        CalculatorService calculatorService =
            scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");

        // Calculate
        System.out.println("Calling CalculatorServiceComponent configured with 'logging' " +
                "policy for subtract and divide operations...");
        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));
       
        calculatorService =
            scaDomain.getService(CalculatorService.class, "AnotherCalculatorServiceComponent");

        // Calculate
        System.out.println("Calling CalculatorServiceComponent configured with 'logging' " +
                "for all operations in the implementation...");
        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

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

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

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

        try {
            System.out.println("Sample Feed server started (press enter to shutdown)");
            System.out.println();
            System.out.println("To read the aggregated feeds, point your Web browser to the following addresses:");
            System.out.println("http://localhost:8083/atomAggregator");
            System.out.println("http://localhost:8083/atomAggregator/atomsvc (for the Atom service document)");
            System.out.println("http://localhost:8083/rssAggregator");
            System.out.println();
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }

        // RssFeed feedService = scaDomain.getService(RssFeed.class,
        // "RssAggregatorComponent");
        // SyndFeed syndFeed = feedService.get();
        // SyndFeedOutput output = new SyndFeedOutput();
        // output.output(syndFeed,new PrintWriter(System.out));

        scaDomain.close();
        System.out.println("Sample Feed server stopped");
    }
View Full Code Here

* Tests the POJO implementation extension.
*/
public class HelloWorldClient {
 
  public static void main(String[] args) throws Exception {
    SCADomain scaDomain = SCADomain.newInstance("helloworld/helloworld.composite");
    HelloWorld helloworld = scaDomain.getService(HelloWorld.class, "HelloWorldComponent");
    helloworld.sayHello("petra");
   
      HelloWorld helloworld2 = scaDomain.getService(HelloWorld.class, "HelloWorldComponent2/HelloWorld2");
        helloworld2.sayHello("petra");
   
  }
View Full Code Here

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

    public  final static void main(String[] args) throws Exception {
        SCADomain scaDomain = SCADomain.newInstance("helloworldjmsreference.composite");
        HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent");

        String value = helloWorldService.getGreetings("World");
        System.out.println(value);

        scaDomain.close();
    }
View Full Code Here

        }
    }

    public void contextDestroyed(ServletContextEvent event) {
        ServletContext servletContext = event.getServletContext();
        SCADomain scaDomain = (SCADomain) servletContext.getAttribute(WebAppServletHost.SCA_DOMAIN_ATTRIBUTE);
        if (scaDomain != null) {
            scaDomain.close();
        }
    }
View Full Code Here

public class Consumer {

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

        SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/feed/Consumer.composite");

        CustomerClient testService = scaDomain.getService(CustomerClient.class, "CustomerClient");
        testService.testCustomerCollection();

        scaDomain.close();
    }
View Full Code Here

public class Provider {

    public static void main(String[] args) {

        SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/feed/Provider.composite");
        System.out.println("Provider.composite ready...");

        try {
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }

        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.