Package org.apache.tuscany.sca.core.assembly

Examples of org.apache.tuscany.sca.core.assembly.ActivationException


                        addNode();
                    }

                                               
                } else {
                    throw new ActivationException("Domain management contribution " +
                                                  contributionURL +
                                                  " found but could not be loaded");
                }
            } else {
                throw new ActivationException("Domain management contribution " +
                                              domainCompositeName +
                                              " not found on the classpath");
            }      
           
        } catch(Exception ex) {
View Full Code Here


                }
            }
           
            definitionsProcessor.resolve(scaDefinitions, definitionsProcessor.getSCADefinitionsResolver());
        } catch ( ContributionReadException e ) {
            throw new ActivationException(e);
        } catch ( ContributionResolveException e ) {
            throw new ActivationException(e);
        } catch ( IOException e ) {
            throw new ActivationException(e);
        }
   
        return scaDefinitions;
    }
View Full Code Here

              Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
            throw new ActivationException(e);
        } catch (InstantiationException e) {
            throw new ActivationException(e);
        } catch (IllegalAccessException e) {
            throw new ActivationException(e);
        }

        return modules;
    }
View Full Code Here

        // Create a contribution repository
        ContributionRepository repository;
        try {
            repository = new ContributionRepositoryImpl("target", inputFactory);
        } catch (IOException e) {
            throw new ActivationException(e);
        }

        ExtensibleURLArtifactProcessor documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors);

        // Create the contribution service
View Full Code Here

                Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
            throw new ActivationException(e);
        } catch (InstantiationException e) {
            throw new ActivationException(e);
        } catch (IllegalAccessException e) {
            throw new ActivationException(e);
        }

        return modules;
    }
View Full Code Here

        // Create a contribution repository
        ContributionRepository repository;
        try {
            repository = new ContributionRepositoryImpl("target", inputFactory);
        } catch (IOException e) {
            throw new ActivationException(e);
        }

        ExtensibleURLArtifactProcessor documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors);

        // Create the contribution service
View Full Code Here

            URI tmpURI;
            try {
                tmpURI = new URI(domainModel.getDomainURI());
                domainModel.setDomainURL(tmpURI.toURL().toExternalForm());
            } catch(Exception ex) {
                throw new ActivationException("domain uri " +
                                              domainModel.getDomainURI() +
                                              " must be a valid url");
            }
               
            // create a runtime for the domain management services to run on
            domainManagementRuntime = new ReallySmallRuntime(domainClassLoader);
            domainManagementRuntime.start();
           
            // Configure the default server port and path
            int port = URI.create(domainModel.getDomainURI()).getPort();
            String path = URI.create(domainModel.getDomainURI()).getPath();
            if (port != -1) {
                ServletHostExtensionPoint servletHosts = domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(ServletHostExtensionPoint.class);
                for (ServletHost servletHost: servletHosts.getServletHosts()) {
                    servletHost.setDefaultPort(port);
                    if (path != null && path.length() > 0 && !path.equals("/")) {
                        servletHost.setContextPath(path);
                    }
                }
            }
           
            // Create an in-memory domain level management composite
            AssemblyFactory assemblyFactory = domainManagementRuntime.getAssemblyFactory();
            domainManagementComposite = assemblyFactory.createComposite();
            domainManagementComposite.setName(new QName(Constants.SCA10_NS, "domainManagement"));
            domainManagementComposite.setURI(domainModel.getDomainURI() + "/management");  
           
            // Create an in-memory domain level composite
            domainComposite = assemblyFactory.createComposite();
            domainComposite.setName(new QName(Constants.SCA10_NS, "domain"));
            domainComposite.setURI(domainModel.getDomainURI() + "/domain")
           
            domainModel.setDomainLeveComposite(domainComposite);
           
            // Set up the domain so that local callable references can find
            // service out there in the domain
            SCADummyNodeImpl node = new SCADummyNodeImpl(this);
            ModelFactoryExtensionPoint factories = domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
            nodeFactory = new NodeFactoryImpl(node);
            factories.addFactory(nodeFactory);
           
            // Find the composite that will configure the domain
            String domainCompositeName = "domain.composite";
            URL contributionURL = SCAContributionUtil.findContributionFromResource(domainClassLoader, domainCompositeName);
           
            if ( contributionURL != null ){
                logger.log(Level.INFO, "Domain management configured from " + contributionURL);
                          
                // add node composite to the management domain
                domainManagementContributionService = domainManagementRuntime.getContributionService();
                Contribution contribution = null;
                contribution = domainManagementContributionService.contribute(domainModel.getDomainURI(),
                                                                              contributionURL,
                                                                              false);
               
                //get the domain builder
                domainBuilder = domainManagementRuntime.getDomainBuilder();
               
               
                Composite composite = null;
                for (Artifact artifact: contribution.getArtifacts()) {
                    if (domainCompositeName.equals(artifact.getURI())) {
                        composite = (Composite)artifact.getModel();
                    }
                }
               
                if (composite != null) {
               
                    domainManagementComposite.getIncludes().add(composite);
                    domainManagementRuntime.buildComposite(composite);
                    domainManagementRuntime.getCompositeActivator().activate(composite);
                    domainManagementRuntime.getCompositeActivator().start(composite);
               
                    // get the management components out of the domain so that they
                    // can be configured/used.
                    domainManagerInitService = getService(SCADomainManagerInitService.class,
                                                          "SCADomainManagerComponent/SCADomainManagerInitService",
                                                          domainManagementRuntime,
                                                          domainManagementComposite);
                    domainManagerInitService.setDomain(this);
                    domainManagerInitService.setDomainSPI((SCADomainSPI)this);
                    domainManagerInitService.setDomainEventService((SCADomainEventService)this);
                   
                       
                } else {
                    throw new ActivationException("Domain management contribution " +
                                                  contributionURL +
                                                  " found but could not be loaded");
                }
            } else {
                throw new ActivationException("Domain management contribution " +
                                              domainCompositeName +
                                              " not found on the classpath");
           
           
           
View Full Code Here

                        addNode();
                    }

                                               
                } else {
                    throw new ActivationException("Domain management contribution " +
                                                  contributionURL +
                                                  " found but could not be loaded");
                }
            } else {
                throw new ActivationException("Domain management contribution " +
                                              domainCompositeName +
                                              " not found on the classpath");
            }      
           
        } catch(Exception ex) {
View Full Code Here

           
            //now that all system sca definitions have been read, lets resolve them rightaway
            definitionsProcessor.resolve(systemSCADefinitions,
                                         definitionsProcessor.getSCADefinitionsResolver());
        } catch ( Exception e ) {
            throw new ActivationException(e);
        }
       
        /*URLArtifactProcessorExtensionPoint documentProcessors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
        SCADefinitionsDocumentProcessor definitionsProcessor = (SCADefinitionsDocumentProcessor)documentProcessors.getProcessor(SCADefinitions.class);
       
View Full Code Here

            for (ComponentReference reference : component.getReferences()) {
                activate((RuntimeComponent) component,
                        (RuntimeComponentReference) reference);
            }
        } catch (Exception e) {
            throw new ActivationException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.assembly.ActivationException

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.