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

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


        }
    }

    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


*  For testing purpose
*/
public class ComposerServer {

    public final static void main(String[] args) throws Exception {
        SCADomain scaDomain = SCADomain.newInstance("Outer.composite");
        System.out.println("Press Enter to exit...");
        System.in.read();
        scaDomain.close();
    }
View Full Code Here

*  For testing purpose
*/
public class ComposerClient {

    public final static void main(String[] args) throws Exception {
        SCADomain scaDomain = SCADomain.newInstance("Client.composite");
        Composer composer = scaDomain.getService(Composer.class, "ClientComponent/Composer");
        System.out.println(composer.Compose("ABC"));
        scaDomain.close();
    }
View Full Code Here

* and locate and invoke a SCA component
*/
public class CalculatorClient {
    public static void main(String[] args) throws Exception {

        SCADomain scaDomain = SCADomain.newInstance("Calculator.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 CircularIncludeTestCase {

    @Test
    public void testCyclicInclude() {
        SCADomain scaDomain = SCADomain.newInstance("Demo1Composite.composite");

        DemoClass demoService = scaDomain.getService(DemoClass.class, "Demo1Component");
        String demo = demoService.demo();
        Assert.assertEquals("hello", demo);
        scaDomain.close();
    }
View Full Code Here

*/
public class WeatherForecastClient {

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

        SCADomain domain = SCADomain.newInstance("WeatherForecast.composite");
        WeatherForecastSoap weatherService = domain.getService(WeatherForecastSoap.class, "WeatherForecastService");

        WeatherForecasts result = weatherService.getWeatherByZipCode("94555");

        // Dump the result as XML
       
View Full Code Here

*/
public class ZipCodeClient {

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

        SCADomain domain = SCADomain.newInstance("ZipCode.composite");
        ZipCodeService zipService = domain.getService(ZipCodeService.class, "ZipCodeService");

        String result = zipService.lookup("94555");
        System.out.println(result);
    }
View Full Code Here

*/
public class LocationClient {

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

        SCADomain domain = SCADomain.newInstance("USLocation.composite");
        USZipSoap zipService = domain.getService(USZipSoap.class, "USLocationService");

        GetInfoByZIPResponse.GetInfoByZIPResult result = zipService.getInfoByZIP("94555");

        GetInfoByZIPResponse response = new GetInfoByZIPResponse();
        response.setGetInfoByZIPResult(result);
View Full Code Here

* and locate and invoke a SCA component
*/
public class CalculatorClient {
    public static void main(String[] args) throws Exception {

        SCADomain scaDomain = SCADomain.newInstance("Calculator.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 CRUDClient {

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

        SCADomain scaDomain = SCADomain.newInstance("crud.composite");
        CRUD crudService = scaDomain.getService(CRUD.class, "CRUDServiceComponent");
       
        String id = crudService.create("ABC");
        Object result = crudService.retrieve(id);
        System.out.println("Result from create: " + result);
        crudService.update(id, "EFG");
        result = crudService.retrieve(id);
        System.out.println("Result from update: " + result);
        crudService.delete(id);
        result = crudService.retrieve(id);
        if (result == null) {
            System.out.println("Result from delete: null");
        } else {
            System.out.println("Result from delete: should be null but was " + result);
        }
       
        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.