Package org.apache.tuscany.sca.node.configuration

Examples of org.apache.tuscany.sca.node.configuration.NodeConfiguration


        runner = new TestCaseRunner(ServiceNode.class);
        runner.beforeClass();
        System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
                           "false");
        NodeFactory factory = NodeFactory.newInstance();
        NodeConfiguration conf =
            factory.createNodeConfiguration().setURI("clientNode").
                addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8085/sca https://localhost:9085/sca")
                .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8086/ws")
                .addContribution("client", new File("../helloworld-client/target/classes").toURI().toString());
        clientNode = factory.createNode(conf).start();
View Full Code Here


    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
                           "false");
        NodeFactory factory = NodeFactory.newInstance();
        NodeConfiguration conf =
            factory.createNodeConfiguration().setURI("serviceNode")
                .addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8087/sca")
                .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8088/ws")
                .addContribution("service", new File("../helloworld-service/target/classes").toURI().toString());
        serviceNode = factory.createNode(conf).start();
View Full Code Here

     * Create the service node
     * @param factory
     * @return
     */
    static Node createServiceNode(NodeFactory factory) {
        NodeConfiguration config2 =
            factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node2").addContribution("c2", ROOT)
                .addDeploymentComposite("c2", SERVICE).setDomainRegistryURI(REGISTRY_URI)
                .addBinding(WebServiceBinding.TYPE, "http://localhost:8085/").addBinding(SCABinding.TYPE,
                                                                                         "http://localhost:8085/");

View Full Code Here

     * Create the client node
     * @param factory
     * @return
     */
    static Node createClientNode(NodeFactory factory) {
        NodeConfiguration config1 =
            factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node1").addContribution("c1", ROOT)
                .addDeploymentComposite("c1", CLIENT).setDomainRegistryURI(REGISTRY_URI)
                .addBinding(WebServiceBinding.TYPE, "http://localhost:8085/").addBinding(SCABinding.TYPE,
                                                                                         "http://localhost:8085/");
        Node node1 = factory.createNode(config1);
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();
View Full Code Here

     * Create the service node
     * @param factory
     * @return
     */
    static Node createServiceNode(NodeFactory factory) {
        NodeConfiguration config2 =
            factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node2").addContribution("c2", ROOT)
                .addDeploymentComposite("c2", SERVICE).setDomainRegistryURI(REGISTRY_URI)
                .addBinding(WebServiceBinding.TYPE, "http://localhost:8085/").addBinding(SCABinding.TYPE,
                                                                                         "http://localhost:8085/");

View Full Code Here

     * Create the client node
     * @param factory
     * @return
     */
    static Node createClientNode(NodeFactory factory) {
        NodeConfiguration config1 =
            factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node1").addContribution("c1", ROOT)
                .addDeploymentComposite("c1", CLIENT).setDomainRegistryURI(REGISTRY_URI)
                .addBinding(WebServiceBinding.TYPE, "http://localhost:8085/").addBinding(SCABinding.TYPE,
                                                                                         "http://localhost:8085/");
        Node node1 = factory.createNode(config1);
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();
View Full Code Here

    private void bundleStarted(Bundle bundle) {
        if (!isSCABundle(bundle)) {
            return;
        }
        try {
            NodeConfiguration configuration = factory.getConfiguration(bundle, null);
            Node node = factory.createNode(configuration);
            node.start();
        } catch (Throwable e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
        }
View Full Code Here

        init();

        // Create a node configuration
        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
        NodeConfigurationFactory configurationFactory = modelFactories.getFactory(NodeConfigurationFactory.class);
        NodeConfiguration configuration = configurationFactory.createNodeConfiguration();

        URL location = bundle.getEntry("/");
        String uri = bundle.getSymbolicName();
        configuration.setURI(uri).addContribution(uri, location);

        if (compositeContent != null) {
            configuration.addDeploymentComposite(uri, new StringReader(compositeContent));
        } else {
            String compositeURI = (String)bundle.getHeaders().get("SCA-Composite");
            if (compositeURI == null) {
                compositeURI = "OSGI-INF/sca/bundle.composite";
            }
            if (compositeURI != null) {
                configuration.addDeploymentComposite(uri, compositeURI);
            }
        }
        // Set the bundle
        // configuration.getExtensions().add(bundle);
        return configuration;
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.node.configuration.NodeConfiguration

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.