Examples of SCADomain


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

*/
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("EchoComponent/EchoService", "bar");
        System.out.println("Echo service = " + echoString );
       
        scaDomain.close();

    }
View Full Code Here

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

* @version $Rev: 538844 $ $Date: 2007-05-17 14:42:08 +0530 (Thu, 17 May 2007) $
*/
public class EchoDataBindingClient {
    public static void main(String[] args) throws Exception {

        SCADomain scaDomain  = SCADomain.newInstance("EchoDataBinding.composite");
       
        Interface1 componentA = scaDomain.getService(Interface1.class, "ComponentA");
        String response = componentA.call("<message><foo>123</foo></message>");
        String response1= componentA.call1("<message><foo>123</foo></message>");
       
       
        System.out.println("call  response = " + response );
        System.out.println("call1 response = " + response1 );
      
        scaDomain.close();

    }
View Full Code Here

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

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/rssAggregator");
            System.out.println("http://localhost:8083/atomAggregator?feedType=rss_2.0");
            System.out.println("http://localhost:8083/rssAggregator?feedType=atom_1.0");
            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

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

    /**
     * Initializes the SCADomian associated with a webapp context. If a SCADomain
     * doesn't exist already then one is create based on the webapp config.
     */
    public static SCADomain initSCADomain(ServletContext servletContext) {
        SCADomain scaDomain = (SCADomain)servletContext.getAttribute(SCA_DOMAIN_ATTRIBUTE);
       
        String domainURI = "http://localhost/" + servletContext.getServletContextName().replace(' ', '.');
        String contributionRoot = null;
       
        try {
View Full Code Here

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

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

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

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

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

        domain.close();

        System.out.println("Bye");
    }
View Full Code Here

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

        }
    }

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

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

        OSGiRuntime.stop();
    }
   
    public void testOSGiComponent() throws Exception {
       
        SCADomain scaDomain = SCADomain.newInstance(compositeName);
        OSGiTestInterface testService = scaDomain.getService(OSGiTestInterface.class, "OSGiTestServiceComponent");
        assert(testService != null);
       
        assert(testService instanceof Proxy);
       
        String str = testService.testService();
       
        assertEquals(className, str);

        scaDomain.close();
             
    }
View Full Code Here

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

public class Consumer {

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

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

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

        scaDomain.close();
    }
View Full Code Here

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

public class Provider {

    public static void main(String[] args) {

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

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

        scaDomain.close();
    }
View Full Code Here

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

        ebi.build(endpoint);
    }

    protected Component findTarget() {
        for (StandardContext sc : TuscanyHost.scaApps) {
            SCADomain scaDomain = (SCADomain)sc.getServletContext().getAttribute(WebAppServletHost.SCA_DOMAIN_ATTRIBUTE);
            if (scaDomain != null) {
                Component component = ((DefaultSCADomain)scaDomain).getComponent(endpoint.getTargetName());
                if ( component != null) {
                    return component;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.