Package org.apache.tuscany.sca.domain

Examples of org.apache.tuscany.sca.domain.SCADomain


     * @param domainURI the URI of the domain, this is the endpoint
     * URI of the domain administration service
     * @return the SCA domain
     */
    public SCADomain getSCADomain(String domainURI) throws DomainException {
        SCADomain scaDomain = domains.get(domainURI);
       
        if (scaDomain == null) {
            scaDomain = new SCADomainProxyImpl(domainURI);
            //domains.put(domainURI, scaDomain);
            // TODO - not caching local domains as currently the local domain can
View Full Code Here


     * @param args
     */
    public static void main(String[] args) {
        System.out.println("Tuscany Domain Controller starting...");

        SCADomain domain = null;
        try {
            SCADomainFactory domainFactory = SCADomainFactory.newInstance();
            domain = domainFactory.createSCADomain("http://localhost:9999");
           
        } catch (Exception e) {
            System.err.println("Exception starting domain controller");
            e.printStackTrace();
            System.exit(0);
        }
       
        System.out.println("Domain controller ready...");
        System.out.println("Press enter to shutdown");
        try {
            System.in.read();
        } catch (IOException e) {
        }
       
        try {
            domain.destroy();
        } catch (Exception e) {
            System.err.println("Exception stopping domain controller");
            e.printStackTrace();
        }
       
View Full Code Here

public class DomainNode {

    public static void main(String[] args) {

        try {
            SCADomain domainNode = SCADomain.newInstance("domain.composite");           
       
            System.out.println("Domain node started (press enter to shutdown)");
            System.in.read();
           
            domainNode.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println("Domain node stopped");
View Full Code Here

       
        try {
            String domainName = args[0];
            String nodeName   = args[1];
            
            SCADomain domainNode = SCADomain.newInstance(domainName, nodeName, null, nodeName + "/Calculator.composite");
                              
            // nodeA is the head node and runs some tests while all other nodes
            // simply listen for incoming messages
            if ( nodeName.equals("nodeA") ) {           
                // do some application stuff
                CalculatorService calculatorService =
                    domainNode.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));
               
                // a little hidden loop test to put some load on the nodes
                if (args.length > 2){
                    for (int i=0; i < 1000; i++){
                        // 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));
                    }
                }
            } else {
                // start up and wait for messages
                try {
                    System.out.println("Node started (press enter to shutdown)");
                    System.in.read();
                } catch (IOException e) {
                    e.printStackTrace();
               
            }
           
            // stop the node and all the domains in it
            domainNode.close();
       
        } catch(Exception ex) {
            System.err.println("Exception in node - " + ex.getMessage());
            ex.printStackTrace(System.err);
        }
View Full Code Here

   
    public static void main(String[] args) {

        try {
            SCADomainFactory domainFactory = SCADomainFactory.newInstance();
            SCADomain domain = domainFactory.createSCADomain(DEFAULT_DOMAIN_URI);
       
            System.out.println("Domain started (press enter to shutdown)");
            System.in.read();
           
            domain.destroy();
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println("Domain stopped");
View Full Code Here

     * @param domainURI the URI of the domain, this is the endpoint
     * URI of the domain administration service
     * @return the SCA domain
     */
    public SCADomain getSCADomain(String domainURI) throws DomainException {
        SCADomain scaDomain = domains.get(domainURI);
       
        if (scaDomain == null) {
            scaDomain = new SCADomainImpl(domainURI);
            //domains.put(domainURI, scaDomain);
            // TODO - not caching local domains as currently the local domain can
View Full Code Here

   
    public static void main(String[] args) {

        try {
            SCADomainFactory domainFactory = SCADomainFactory.newInstance();
            SCADomain domain = domainFactory.createSCADomain(DEFAULT_DOMAIN_URI);
            domain.start();
       
            System.out.println("Domain started (press enter to shutdown)");
            System.in.read();
           
            domain.stop();
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println("Domain stopped");
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.domain.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.