Package org.apache.tuscany.sca.contribution.updater

Examples of org.apache.tuscany.sca.contribution.updater.CompositeUpdaterException


        Composite composite = ArtifactsFinder.findComposite(compositeURI,
                artifacts);
        boolean found = false;

        if (composite == null)
            throw new CompositeUpdaterException(
                    "Composite not found in contribution" + contribURI);
        else {
            processor.setComposite(composite);
            try {
                processor.read(c.build());
            } catch (Exception e) {
                throw new CompositeUpdaterException(
                        "Component error parsing in contribution" + contribURI);

            }
            found = true;
        }

        if (found) {
            Component component = processor.getParsedComponent();
            Composite augmentedComposite = processor.getParsedComposite();
            try {
                processor.resolve(component, contrib.getModelResolver());
                compositeBuilder.attach(augmentedComposite, component);
                ((CompositeActivatorImpl) compositeActivator)
                        .activateComponent(component);
            } catch (Exception e) {

                throw new CompositeUpdaterException(
                        "Cannot activate the component");
            }

            return component;
        }
View Full Code Here


                toRemove = component;
                break;
            }
        }
        if (toRemove == null) {
            throw new CompositeUpdaterException(
                    "Component not found in contribution" + contribURI);
        } else {
            // start again
            try {
                composite.getComponents().remove(toRemove);
                CompositeActivatorImpl impl = (CompositeActivatorImpl) compositeActivator;
                impl.stop(toRemove);
                impl.deactivateComponent(toRemove);
                CompositeBuilderImpl builder = (CompositeBuilderImpl) compositeBuilder;
                builder.detach(composite, toRemove);
            } catch (Exception e) {
                throw new CompositeUpdaterException(
                        "Cannot remove composite from the contribution"
                                + contribURI);
            }
            return toRemove;
        }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.updater.CompositeUpdaterException

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.