Package org.apache.tuscany.sca.node

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


    }  
    
    public void addToDomainLevelCompositeFromDomain(QName compositeQName) throws NodeException {
       
        if (nodeStarted){
            throw new NodeException("Can't add composite " + compositeQName.toString() + " when the node is running. Call stop() on the node first");
        }
       
        Composite composite = composites.get(compositeQName);
       
        if (composite == null) {
            throw new NodeException("Composite " + compositeQName.toString() + " not found" );
        }
       
        // if the named composite is not already in the list then deploy it
        if (!nodeComposite.getIncludes().contains(composite)) {
            nodeComposite.getIncludes().add(composite)
           
            try {
                // build and activate the model for this composite
                activateComposite(composite);
            } catch (Exception ex) {
                throw new NodeException(ex);
            }                  
        }
    }
View Full Code Here


    // SCANode API methods
   
    public void start() throws NodeException {
        if (domainURI != null){
            throw new NodeException("Node is part of domain " +
                                    domainURI +
                                    " so must be starterd from there");
        } else {
            startFromDomain();
        }
View Full Code Here

        }
    }
   
    public void stop() throws NodeException {
        if (domainURI != null){
            throw new NodeException("Node is part of domain " +
                                    domainURI +
                                    " so must be stopped from there");
        } else {
            stopFromDomain();          
        }
View Full Code Here

            composites = null;
            compositeFiles = null;           
        } catch(NodeException ex) {
            throw ex;           
        } catch (Exception ex) {
            throw new NodeException(ex);
       
    }
View Full Code Here

           
            // add the contribution to the domain.
            scaDomain.registerContribution(nodeURI, contributionURI, contributionURL.toExternalForm());                 
       
        } catch (Exception ex) {
            throw new NodeException(ex);
        }       
    }
View Full Code Here

           
            // remove the contribution from the domain.
            scaDomain.unregisterContribution(nodeURI, contributionURI);                 
           
        } catch (Exception ex) {
            throw new NodeException(ex);
       
    }
View Full Code Here

            // Remove all contributions
            for (String contributionURI : keys){
                removeContribution(contributionURI);
            }
        } catch (Exception ex) {
            throw new NodeException(ex);
        }             
    }
View Full Code Here

    }
   
    public void addToDomainLevelComposite(QName compositeQName) throws NodeException {
       
        if (nodeStarted){
            throw new NodeException("Can't add composite " + compositeQName.toString() + " when the node is running. Call stop() on the node first");
        }
      
        // if no composite name is specified add all deployable composites
        // to the domain
        if (compositeQName == null){
            for (Composite composite : composites.values()) {
                if (!nodeComposite.getIncludes().contains(composite)) {
                    nodeComposite.getIncludes().add(composite);
                   
                    try {
                        // build and activate the model for this composite
                        activateComposite(composite);
                       
                        // register the composite with the domain
                        scaDomain.registerDomainLevelComposite(nodeURI, composite.getName().toString());                 
                   
                    } catch (Exception ex) {
                        throw new NodeException(ex);
                    }  
                   
                }
            }
        } else {         
            Composite composite = composites.get(compositeQName);
           
            if (composite == null) {
                throw new NodeException("Composite " + compositeQName.toString() + " not found" );
            }
                       
            // if the named composite is not already in the list then deploy it
            if (!nodeComposite.getIncludes().contains(composite)) {
                nodeComposite.getIncludes().add(composite);
               
                try {
                    // build and activate the model for this composite
                    activateComposite(composite);
                   
                    // register the composite with the domain
                    scaDomain.registerDomainLevelComposite(nodeURI, composite.getName().toString());                 
               
                } catch (Exception ex) {
                    throw new NodeException(ex);
                }                
            }
        } 
       
    }
View Full Code Here

            Composite composite = compositeFiles.get(compositePath);
           
            if (composite != null){
                addToDomainLevelComposite(composite.getName());
            } else {
                throw new NodeException("Composite " + compositePath + " not found" );
           
        }
    }
View Full Code Here

                    }
                }
            }

        } catch (Exception ex) {
            throw new NodeException(ex);
       
    }
View Full Code Here

TOP

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

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.