Examples of OSGiImplementation


Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        assert IMPLEMENTATION_OSGI.equals(reader.getName());

        String bundleSymbolicName = reader.getAttributeValue(null, BUNDLE_SYMBOLICNAME);
        String bundleVersion = reader.getAttributeValue(null, BUNDLE_VERSION);

        OSGiImplementation implementation = osgiImplementationFactory.createOSGiImplementation();
        implementation.setBundleSymbolicName(bundleSymbolicName);
        implementation.setBundleVersion(bundleVersion);

        implementation.setUnresolved(true);

        // Skip to the end of <implementation.osgi>
        while (reader.hasNext()) {
            int next = reader.next();
            switch (next) {
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        ByteArrayInputStream is = new ByteArrayInputStream(str.getBytes());

        XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
        reader.nextTag();

        OSGiImplementation osgiImpl = (OSGiImplementation)staxProcessor.read(reader);

        assertEquals(osgiImpl.getBundleSymbolicName(), "osgi.test");
        assertEquals(osgiImpl.getBundleVersion(), "1.0.0");

        StringWriter sw = new StringWriter();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        staxProcessor.write(osgiImpl, writer);
        writer.flush();
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        ByteArrayInputStream is = new ByteArrayInputStream(str.getBytes());

        XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
        reader.nextTag();

        OSGiImplementation osgiImpl = (OSGiImplementation)staxProcessor.read(reader, context);

        assertEquals(osgiImpl.getBundleSymbolicName(), "osgi.test");
        assertEquals(osgiImpl.getBundleVersion(), "1.0.0");

        StringWriter sw = new StringWriter();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        staxProcessor.write(osgiImpl, writer, context);
        writer.flush();
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        */

        BundleContext bundleContext = null;
        // Remote endpoint doesn't have a bundle
        if (!endpoint.isRemote()) {
            OSGiImplementation osgiImpl = (OSGiImplementation)impl;
            Bundle bundle = osgiImpl.getBundle();
            bundleContext = bundle != null ? bundle.getBundleContext() : null;
        }

        // Notify the endpoint listeners
        EndpointDescription description = createEndpointDescription(bundleContext, endpoint);
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        assert IMPLEMENTATION_OSGI.equals(reader.getName());

        String bundleSymbolicName = reader.getAttributeValue(null, BUNDLE_SYMBOLICNAME);
        String bundleVersion = reader.getAttributeValue(null, BUNDLE_VERSION);

        OSGiImplementation implementation = osgiImplementationFactory.createOSGiImplementation();
        implementation.setBundleSymbolicName(bundleSymbolicName);
        implementation.setBundleVersion(bundleVersion);

        implementation.setUnresolved(true);

        // Skip to the end of <implementation.osgi>
        while (reader.hasNext()) {
            int next = reader.next();
            switch (next) {
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        Component component = assemblyFactory.createComponent();
        component.setName(id);

        composite.getComponents().add(component);

        OSGiImplementation implementation = implementationFactory.createOSGiImplementation();

        implementation.setBundle(bundle);
        component.setImplementation(implementation);
        implementation.setUnresolved(false);

        OSGiProperty serviceID = implementationFactory.createOSGiProperty();
        serviceID.setName(SERVICE_ID);
        // The service.id is Long
        serviceID.setValue(String.valueOf(sid));

        for (String intf : remoteInterfaces) {
            Service service = assemblyFactory.createService();
            JavaInterfaceContract interfaceContract = createJavaInterfaceContract(bundle, intf);
            String name = intf.substring(intf.lastIndexOf('.') + 1);
            service.setName(name);
            service.setInterfaceContract(interfaceContract);

            implementation.getServices().add(service);

            ComponentService componentService = assemblyFactory.createComponentService();
            componentService.setName(service.getName());
            componentService.getExtensions().add(serviceID);
            componentService.getExtensions().addAll(osgiProps);
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        component.setName(id);
        // component.setAutowire(Boolean.TRUE);

        composite.getComponents().add(component);

        OSGiImplementation implementation = implementationFactory.createOSGiImplementation();

        implementation.setBundle(bundle);
        component.setImplementation(implementation);
        implementation.setUnresolved(false);

        int count = 0;
        for (String intf : remoteInterfaces) {
            Reference reference = assemblyFactory.createReference();
            JavaInterfaceContract interfaceContract = createJavaInterfaceContract(bundle, intf);

            reference.setName("ref" + (count++));
            reference.setInterfaceContract(interfaceContract);

            implementation.getReferences().add(reference);

            ComponentReference componentReference = assemblyFactory.createComponentReference();
            componentReference.setName(reference.getName());
            componentReference.getExtensions().addAll(osgiProps);
            component.getReferences().add(componentReference);
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        assert IMPLEMENTATION_OSGI.equals(reader.getName());

        String bundleSymbolicName = reader.getAttributeValue(null, BUNDLE_SYMBOLICNAME);
        String bundleVersion = reader.getAttributeValue(null, BUNDLE_VERSION);

        OSGiImplementation implementation = osgiImplementationFactory.createOSGiImplementation();
        implementation.setBundleSymbolicName(bundleSymbolicName);
        implementation.setBundleVersion(bundleVersion);

        implementation.setUnresolved(true);

        // Skip to the end of <implementation.osgi>
        while (reader.hasNext()) {
            int next = reader.next();
            switch (next) {
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        ByteArrayInputStream is = new ByteArrayInputStream(str.getBytes());

        XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
        reader.nextTag();

        OSGiImplementation osgiImpl = (OSGiImplementation)staxProcessor.read(reader);

        assertEquals(osgiImpl.getBundleSymbolicName(), "osgi.test");
        assertEquals(osgiImpl.getBundleVersion(), "1.0.0");

        StringWriter sw = new StringWriter();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        staxProcessor.write(osgiImpl, writer);
        writer.flush();
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.osgi.OSGiImplementation

        ByteArrayInputStream is = new ByteArrayInputStream(str.getBytes());

        XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
        reader.nextTag();

        OSGiImplementation osgiImpl = (OSGiImplementation)staxProcessor.read(reader, context);

        assertEquals(osgiImpl.getBundleSymbolicName(), "osgi.test");
        assertEquals(osgiImpl.getBundleVersion(), "1.0.0");

        StringWriter sw = new StringWriter();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        staxProcessor.write(osgiImpl, writer, context);
        writer.flush();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.