Package org.apache.tuscany.sca.domain.model

Examples of org.apache.tuscany.sca.domain.model.CompositeModel


       
        return returnContributionModel;
    }
   
    private CompositeModel findComposite(QName compositeQName){
        CompositeModel returnCompositeModel = null;
       
        for(ContributionModel contributionModel : domainModel.getContributions().values()){
            returnCompositeModel = contributionModel.getComposites().get(compositeQName);
           
            if (returnCompositeModel != null){
View Full Code Here


           
            // add the composites into the domain model
            for (Artifact artifact : contribution.getArtifacts()) {
                if (artifact.getModel() instanceof Composite) {
                    Composite composite = (Composite)artifact.getModel();
                    CompositeModel compositeModel = domainModelFactory.createComposite();
                    compositeModel.setCompositeQName(composite.getName());
                    compositeModel.setComposite(composite);
                    contributionModel.getComposites().put(compositeModel.getCompositeQName(), compositeModel);     
                }
            }                       
           
            // add the deployable composite info to the domain model
            for (Composite composite : contribution.getDeployables()) {
                CompositeModel compositeModel = contributionModel.getComposites().get(composite.getName());
               
                if (compositeModel != null){
                    contributionModel.getDeployableComposites().put(compositeModel.getCompositeQName(), compositeModel);
                } else {
                    throw new DomainException("Deployable composite name " +
                                              composite.getName() +
                                              " doesn't match a composite in the contribution " +
                                              contributionURI );
View Full Code Here

    public DomainModel getDomainModel(){       
        return domainModel;
    }
   
    public String getComposite(QName compositeQName){
        CompositeModel compositeModel = domainModel.getDeployedComposites().get(compositeQName);
        Composite composite = compositeModel.getComposite();
       
        ExtensionPointRegistry registry = domainManagementRuntime.getExtensionPointRegistry();
       
        StAXArtifactProcessorExtensionPoint staxProcessors =
            registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
View Full Code Here

                if (node != null) {
                    if (node.getLifecycleState() != LifecyleState.AVAILABLE){
                        throw new DomainException("Node " + nodeURI + " is already marked as active");
                    } else {
                        for (ContributionModel contributionModel : node.getContributions().values()){
                            CompositeModel compositeModel = contributionModel.getComposites().get(compositeQName);
                           
                            if (compositeModel != null){
                                contributionModel.getDeployedComposites().put(compositeQName, compositeModel);
                                node.getDeployedComposites().put(compositeQName, compositeModel);
                                domainModel.getDeployedComposites().put(compositeQName, compositeModel);
                                domainManagementRuntime.getCompositeBuilder().build(compositeModel.getComposite());
                                domainModel.getDomainLevelComposite().getIncludes().add(compositeModel.getComposite());
                               

                            }
                        }
                    }
View Full Code Here

           
            // add the deployed composites back into the domain if they still exist
            // if they don't then the user will have to add and start any new composites manually
            for (QName compositeQName : deployedCompositeNames) {
                // make sure the composite still exists
                CompositeModel compositeModel = findComposite(compositeQName);
          
                if (compositeModel != null){
                    addToDomainLevelComposite(compositeModel.getCompositeQName());
                } else {
                    // the composite has been removed from the contribution
                    // by the update
                }
            }
View Full Code Here

            if (contributionModel == null){
                throw new DomainException("Can't find contribution for composite " + compositeQName.toString());
            }
           
            // find the composite object from the contribution
            CompositeModel compositeModel = contributionModel.getComposites().get(compositeQName);
           
            if (compositeModel == null){
                throw new DomainException("Can't find composite model " + compositeQName.toString() +
                                          " in contribution " + contributionModel.getContributionURI());
           
           
            // build the contribution to create the services and references
            domainModel.getDeployedComposites().put(compositeQName, compositeModel);
            domainManagementRuntime.getCompositeBuilder().build(compositeModel.getComposite());               
            domainModel.getDomainLevelComposite().getIncludes().add(compositeModel.getComposite());
           
            NodeModel node = null;
           
            // find the node for the composite to run on
            if (nodeURI != null) {
View Full Code Here

        // TODO - no absolutely sure what is intended here as I don't have
        //        an explicit scenario but here is some code to get me thinking about it
        String artifactString = null;
       
        // find the composite that matches and return its XML
        CompositeModel compositeModel = domainModel.getDeployedComposites().get(artifact);
       
        if (compositeModel != null){
            // convert the composite to XML
        }
       
View Full Code Here

    }
   
    public void startComposite(QName compositeQName) throws DomainException {
        try {
            // find the composite object from the list of deployed composites
            CompositeModel compositeModel = domainModel.getDeployedComposites().get(compositeQName);
           
            if (compositeModel == null){
                throw new DomainException("Can't start composite " + compositeQName.toString() +
                                          " as it hasn't been added to the domain level composite");
            }
View Full Code Here

        
    }
     
    public void stopComposite(QName compositeName) throws DomainException {
        // find the composite object from the list of deployed composites
        CompositeModel composite = domainModel.getDeployedComposites().get(compositeName);
       
        if (composite == null){
            throw new DomainException("Can't stop composite " + compositeName.toString() +
                                      " as it hasn't been added to the domain level composite");
        }
View Full Code Here

       
        return returnContributionModel;
    }
   
    private CompositeModel findComposite(QName compositeQName){
        CompositeModel returnCompositeModel = null;
       
        for(ContributionModel contributionModel : domainModel.getContributions().values()){
            returnCompositeModel = contributionModel.getComposites().get(compositeQName);
           
            if (returnCompositeModel != null){
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.domain.model.CompositeModel

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.