Package org.apache.tuscany.sca.node

Examples of org.apache.tuscany.sca.node.NodeFactory


    private static Node node;

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
        NodeFactory factory = NodeFactory.newInstance();
        node = factory.createNode(
               new Contribution("iface", getJar("../helloworld-iface/target")),
               new Contribution("service", getJar("../helloworld-service/target")),
               new Contribution("client", getJar("../helloworld-client/target")));
        node.start();
    }
View Full Code Here


        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
        Node node = tuscanyRuntime.createNodeFromXML(nodeDirectory.getPath() +
                                                     File.separator +
                                                     "node.xml");
*/
        NodeFactory nodeFactory = NodeFactory.newInstance();
       
        URL nodeConfigURL = nodeDirectory.toURI().resolve("node.xml").toURL();
        Node node = nodeFactory.createNode(nodeConfigURL);
       
        try {
            node.start();
           
            // for testing we're going to set up a deamon that listens for
View Full Code Here

    /**
     * One NodeFactory and two nodes
     */
    @Test
    public void testOneFactoryTwoNodes() {
        NodeFactory factory1 = NodeFactory.getInstance();
        Node node1 = createClientNode(factory1);
        Node node2 = createServiceNode(factory1);
        node1.start();
        node2.start();
        try {
            runClient(node1);
        } finally {
            node2.stop();
            node1.stop();
            factory1.destroy();
        }
    }
View Full Code Here

    /**
     * Two node factories and two nodes
     */
    @Test
    public void testTwoFactoriesTwoNodes() throws Exception {
        NodeFactory factory1 = NodeFactory.newInstance();
        Node node1 = createClientNode(factory1);
        NodeFactory factory2 = NodeFactory.newInstance();
        Node node2 = createServiceNode(factory2);
        node1.start();
        node2.start();
        Thread.sleep(1000);
        try {
            // This call doesn't require the Local service, it should be successful
            createCustomer(node1);
            try {
                runClient(node1);
                // We cannot make local call to remote endpoints
                Assert.fail("ServiceRuntimeException should have been thrown.");
            } catch (ServiceRuntimeException e) {
                // ignore
            }
        } finally {
            node2.stop();
            node1.stop();
            factory2.destroy();
            factory1.destroy();
        }
    }
View Full Code Here

    /**
     * One node factory and one node for both composites
     */
    @Test
    public void testOneFactoryOneNode() {
        NodeFactory factory = NodeFactory.getInstance();
        NodeConfiguration config1 =
            factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node1").addContribution("c1", ROOT)
                .addDeploymentComposite("c1", CLIENT).addDeploymentComposite("c1", SERVICE);

        Node node1 = factory.createNode(config1);
        node1.start();
        try {
            runClient(node1);
        } finally {
            node1.stop();
            factory.destroy();
        }
    }
View Full Code Here

    private static Node serviceNode;
//    private static DomainNode serviceNode;

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        NodeFactory factory = NodeFactory.newInstance();

        serviceNode = factory.createNode(new File("server-config.xml").toURI().toURL());
        serviceNode.start();
       
//        serviceNode = new DomainNode("tribes:default", new String[]{"../helloworld-service/target/classes"});

    }
View Full Code Here

    public static void setUpBeforeClass() throws Exception {
        runner =
            new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName(),
                               Customer.class.getName());
        runner.beforeClass();
        NodeFactory factory = NodeFactory.getInstance();
        clientNode = BindingSCATestCase.createClientNode(factory).start();
        Thread.sleep(1000);
    }
View Full Code Here

    private static Node clientNode;
//    private static DomainNode clientNode;

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        NodeFactory factory = NodeFactory.newInstance();

        clientNode = factory.createNode(new File("client-config.xml").toURI().toURL());
       
        try {
            clientNode.start();
        } catch (Exception ex){
            ex.printStackTrace();
View Full Code Here

*/
public class StockQuoteServer {

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

      NodeFactory factory = NodeFactory.newInstance();
        Node node = factory.createNode(new File("src/main/resources/context/multiple/MultipleContext.composite").toURI().toURL().toString(),
                new Contribution("TestContribution", new File("src/main/resources/context/multiple/").toURI().toURL().toString()));
        node.start();
       
        // Method 1: To access the Spring Application Context instance
        ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
View Full Code Here

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

      NodeFactory factory = NodeFactory.newInstance();
        Node node = factory.createNode(new File("src/main/resources/spring/annotations/Calculator.composite").toURI().toURL().toString(),
                new Contribution("TestContribution", new File("src/main/resources/spring/annotations/").toURI().toURL().toString()));
        node.start();
             
        CalculatorService calculatorService =
            node.getService(CalculatorService.class, "CalculatorServiceComponent");
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.node.NodeFactory

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.