Package org.apache.tuscany.sca.node

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


            + " </component>"
            + " </composite>";

    @Test
    public void testNodeWithCompositeContent() {
        NodeFactory factory = new NodeFactoryImpl();
        Contribution contribution = new Contribution("c1", new File("target/test-classes").toURI().toString());
        String compositeURI = "HelloWorld.composite";
        Node node = factory.createNode(compositeURI, composite, contribution);
        testNode(node);
    }
View Full Code Here


        testNode(node);
    }
   
    @Test
    public void testNodeWithRelativeCompositeURI() {
        NodeFactory factory = new NodeFactoryImpl();
        Contribution contribution = new Contribution("c1", new File("target/test-classes").toURI().toString());
        String compositeURI = "HelloWorld.composite";
        Node node = factory.createNode(compositeURI, contribution);
        testNode(node);
    }
View Full Code Here

     * @param compositeURI
     * @param uris
     * @param locations
     */
    public NodeImplementationLauncherBootstrap(String compositeURI, String compositeContent, String[] uris, String[] locations) throws Exception {
        NodeFactory nodeFactory = NodeFactory.newInstance();
        Contribution[] contributions = new Contribution[uris.length];
        for (int i = 0; i < uris.length; i++) {
            contributions[i] = new Contribution(uris[i], locations[i]);
        }
        node = new NodeFacade(nodeFactory.createNode(compositeURI, compositeContent, contributions));
    }
View Full Code Here

        public void start() {
            threadContextClassLoader = Thread.currentThread().getContextClassLoader();
            boolean started = false;
            try {
                Thread.currentThread().setContextClassLoader(runtimeClassLoader);
                NodeFactory factory = NodeFactory.newInstance();
                String contribution = ContributionLocationHelper.getContributionLocation(getClass());
                daemon = factory.createNode("NodeDaemon.composite", new Contribution("node-runtime", contribution));
                started = true;
            } finally {
                if (!started) {
                    Thread.currentThread().setContextClassLoader(threadContextClassLoader);
                }
View Full Code Here

       
        // Determine the node configuration URI
        String nodeConfiguration = NodeImplementationLauncherUtil.nodeConfigurationURI(nodeName);
       
        // Create the SCA node
        NodeFactory nodeFactory = NodeFactory.newInstance();
        node = nodeFactory.createNode(nodeConfiguration);
       
        // Register the Servlet host
        ServletHostExtensionPoint servletHosts = servletHosts(node);
        servletHosts.getServletHosts().clear();
        servletHosts.addServletHost(servletHost);
View Full Code Here

     * Bootstrap a new SCA node.
     *
     * @param configurationURI
     */
    public NodeImplementationLauncherBootstrap(String configurationURI) throws Exception {
        NodeFactory nodeFactory = NodeFactory.newInstance();
        node = new NodeFacade(nodeFactory.createNode(configurationURI));
    }
View Full Code Here

     * @param compositeURI
     * @param uris
     * @param locations
     */
    public NodeImplementationLauncherBootstrap(String compositeURI, String[] uris, String[] locations) throws Exception {
        NodeFactory nodeFactory = NodeFactory.newInstance();
        Contribution[] contributions = new Contribution[uris.length];
        for (int i = 0; i < uris.length; i++) {
            contributions[i] = new Contribution(uris[i], locations[i]);
        }
        node = new NodeFacade(nodeFactory.createNode(compositeURI, contributions));
    }
View Full Code Here

            + " </component>"
            + " </composite>";

    @Test
    public void testNodeWithCompositeContent() {
        NodeFactory factory = new NodeFactoryImpl();
        Contribution contribution = new Contribution("c1", new File("target/test-classes").toURI().toString());
        String compositeURI = "HelloWorld.composite";
        Node node = factory.createNode(compositeURI, composite, contribution);
        testNode2(node);
    }
View Full Code Here

    }

    private static Node createNode(final ServletContext servletContext) throws ServletException {
        String contextPath = initContextPath(servletContext);
        String contributionRoot = getContributionRoot(servletContext);
        NodeFactory factory = NodeFactory.newInstance();
        String webComposite = getWebComposite(servletContext);
        Node node = factory.createNode(contextPath, webComposite, new Contribution(contributionRoot, contributionRoot));
        node.start();
        return node;
    }
View Full Code Here

     * Runs before each test method
     */
    @BeforeClass
    public static void setUp() throws Exception {
        try {
            NodeFactory factory = NodeFactory.newInstance();
            node = factory.createNode(new File("src/main/resources/standard-types-service.composite").toURI().toURL().toString(),
                new Contribution("TestContribution", new File("src/main/resources/").toURI().toURL().toString()));
            node.start();
        } catch (Throwable e) {
            e.printStackTrace();
        }
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.