Package org.apache.tuscany.sca.node

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


       
        // Determine the node configuration URI
        String nodeConfiguration = NodeImplementationLauncherUtil.nodeConfigurationURI(nodeName);
       
        // Create the SCA node
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        node = nodeFactory.createSCANodeFromURL(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 {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        node = new NodeFacade(nodeFactory.createSCANodeFromURL(configurationURI));
    }
View Full Code Here

     *
     * @param configurationURI
     * @param contributionClassLoader
     */
    public NodeImplementationLauncherBootstrap(String compositeURI, ClassLoader contributionClassLoader) throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        node = new NodeFacade(nodeFactory.createSCANodeFromClassLoader(compositeURI, contributionClassLoader));
    }
View Full Code Here

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

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

        public void start() {
            threadContextClassLoader = Thread.currentThread().getContextClassLoader();
            boolean started = false;
            try {
                Thread.currentThread().setContextClassLoader(runtimeClassLoader);
                SCANodeFactory factory = SCANodeFactory.newInstance();
                daemon = factory.createSCANodeFromClassLoader("NodeDaemon.composite", threadContextClassLoader);
                started = true;
            } finally {
                if (!started) {
                    Thread.currentThread().setContextClassLoader(threadContextClassLoader);
                }
View Full Code Here

     * Expected result: Method must be called. Method must be called after all property
     * and reference injection is complete.
     */
    @Test
    public void atInitProper() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        SCANode node = nodeFactory.createSCANode(new File("src/main/resources/proper/AService.composite").toURL().toString(),
                new SCAContribution("TestContribution",
                                    new File("src/main/resources/proper").toURL().toString()));
        node.start();
        AService aService = ((SCAClient)node).getService(AService.class, "AComponent");
        Assert.assertTrue(aService.isInitProper());
View Full Code Here

     * This method tests that an exception is thrown when a protected method is
     * annotated with "@Init".
     */
    @Test
    public void atInitProtectedMethod() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        try {
            SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err1/AServiceErr1.composite").toURL().toString(),
                    new SCAContribution("TestContribution",
                                        new File("src/main/resources/err1").toURL().toString()));
            Assert.fail();
            node.stop();
        } catch(ServiceRuntimeException e) {
View Full Code Here

     * This method tests that an exception is thrown when a private method is
     * annotated with "@Init".
     */
    @Test
    public void atInitPrivateMethod() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        try {
            SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err2/AServiceErr2.composite").toURL().toString(),
                    new SCAContribution("TestContribution",
                                        new File("src/main/resources/err2").toURL().toString()));
            Assert.fail();
            node.stop();
        } catch(ServiceRuntimeException e) {
View Full Code Here

     * This method tests that an exception is thrown when a method with non-void
     * return type is annotated with "@Init".
     */
    @Test
    public void atInitNonVoidReturnType() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        try {
            SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err3/HelloWorldErr3.composite").toURL().toString(),
                    new SCAContribution("TestContribution",
                                        new File("src/main/resources/err3").toURL().toString()));
            Assert.fail();
            node.stop();
        } catch(ServiceRuntimeException e) {
View Full Code Here

TOP

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

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.