Package org.apache.servicemix.jbi.deployment

Examples of org.apache.servicemix.jbi.deployment.Descriptor


        }
        // unpackLocation returns null if no jbi descriptor is found
        if (tmpDir == null) {
            throw failure("deploy", "Unable to find jbi descriptor: " + location);
        }
        Descriptor root = null;
        try {
            root = DescriptorFactory.buildDescriptor(tmpDir);
        } catch (Exception e) {
            throw failure("deploy", "Unable to build jbi descriptor: " + location, e);
        }
        if (root == null) {
            throw failure("deploy", "Unable to find jbi descriptor: " + location);
        }
        if (root != null) {
            try {
                container.getBroker().suspend();
                if (root.getComponent() != null) {
                    updateComponent(entry, autoStart, tmpDir, root);
                } else if (root.getSharedLibrary() != null) {
                    updateSharedLibrary(entry, tmpDir, root);
                } else if (root.getServiceAssembly() != null) {
                    updateServiceAssembly(entry, autoStart, tmpDir, root);
                }
            } finally {
                container.getBroker().resume();
            }
View Full Code Here


            }
            if (canDeploy) {
                File tmp = (File) me.getKey();
                deployedSas.add(tmp);
                try {
                    Descriptor root = DescriptorFactory.buildDescriptor(tmp);
                    deploymentService.deployServiceAssembly(tmp, root.getServiceAssembly());
                    deploymentService.start(root.getServiceAssembly().getIdentification().getName());
                } catch (Exception e) {
                    String errStr = "Failed to update Service Assembly: " + tmp.getName();
                    LOG.error(errStr, e);
                }
            }
View Full Code Here

            }
            if (canInstall) {
                File tmp = me.getKey();
                installedComponents.add(tmp);
                try {
                    Descriptor root = DescriptorFactory.buildDescriptor(tmp);
                    installationService.install(tmp, null, root, true);
                } catch (Exception e) {
                    String errStr = "Failed to update Component: " + tmp.getName();
                    LOG.error(errStr, e);
                }
View Full Code Here

        }

        // Check that the jbi descriptor is present
        try {
            URL url = DeploymentUtil.createJarURL(module, "META-INF/jbi.xml");
            Descriptor descriptor = DescriptorFactory.buildDescriptor(url);
            if (descriptor == null) {
                return null;
            }
            DescriptorFactory.checkDescriptor(descriptor);
           
View Full Code Here

     *             if there was a problem with the configuration
     */
    public Artifact getConfigurationID(Object plan, JarFile module, ModuleIDBuilder idBuilder) throws IOException,
                    DeploymentException {
        DeploymentPlanWrapper wrapper = (DeploymentPlanWrapper) plan;
        Descriptor descriptor = wrapper.getServicemixDescriptor();
        if (descriptor.getComponent() != null) {
            return new Artifact("servicemix-components", descriptor.getComponent().getIdentification().getName(),
                            "0.0", "car");
        } else if (descriptor.getServiceAssembly() != null) {
            return new Artifact("servicemix-assemblies", descriptor.getServiceAssembly().getIdentification().getName(),
                            "0.0", "car");
        } else if (descriptor.getSharedLibrary() != null) {
            return new Artifact("servicemix-libraries", descriptor.getSharedLibrary().getIdentification().getName(),
                            descriptor.getSharedLibrary().getVersion(), "car");
        } else {
            throw new DeploymentException("Unable to construct configuration ID " + module.getName()
                            + ": unrecognized jbi package. Should be a component, assembly or library.");
        }
    }
View Full Code Here

          }
        }

        DeploymentContext context = null;
        try {
            Descriptor descriptor = wrapper.getServicemixDescriptor();
            Map name = new HashMap();
            name.put("Config", configId.toString());
            context = new DeploymentContext(configurationDir,
                            inPlaceDeployment ? DeploymentUtil.toFile(jarFile) : null, environment,
                            new AbstractName(configId, name),
                            ConfigurationModuleType.SERVICE, kernel.getNaming(), ConfigurationUtil
                                            .getConfigurationManager(kernel), repositories);
            if (descriptor.getComponent() != null) {
                buildComponent(descriptor, context, jarFile);
            } else if (descriptor.getServiceAssembly() != null) {
                buildServiceAssembly(descriptor, context, jarFile);
            } else if (descriptor.getSharedLibrary() != null) {
                buildSharedLibrary(descriptor, context, jarFile);
            } else {
                throw new IllegalStateException("Invalid jbi descriptor");
            }
        } catch (Exception e) {
View Full Code Here

        }
        // unpackLocation returns null if no jbi descriptor is found
        if (tmpDir == null) {
            throw failure("deploy", "Unable to find jbi descriptor: " + location);
        }
        Descriptor root = null;
        try {
            root = DescriptorFactory.buildDescriptor(tmpDir);
        } catch (Exception e) {
            throw failure("deploy", "Unable to build jbi descriptor: " + location, e);
        }
        if (root == null) {
            throw failure("deploy", "Unable to find jbi descriptor: " + location);
        }
        if (root != null) {
            if (root.getComponent() != null) {
                updateComponent(entry, autoStart, tmpDir, root);
            } else if (root.getSharedLibrary() != null) {
                updateSharedLibrary(entry, tmpDir, root);
            } else if (root.getServiceAssembly() != null) {
                updateServiceAssembly(entry, autoStart, tmpDir, root);
            }
        }
    }
View Full Code Here

            }
            if (canDeploy) {
                File tmp = (File) me.getKey();
                deployedSas.add(tmp);
                try {
                    Descriptor root = DescriptorFactory.buildDescriptor(tmp);
                    deploymentService.deployServiceAssembly(tmp, root.getServiceAssembly());
                    deploymentService.start(root.getServiceAssembly().getIdentification().getName());
                } catch (Exception e) {
                    String errStr = "Failed to update Service Assembly: " + tmp.getName();
                    LOGGER.error(errStr, e);
                }
            }
View Full Code Here

            }
            if (canInstall) {
                File tmp = me.getKey();
                installedComponents.add(tmp);
                try {
                    Descriptor root = DescriptorFactory.buildDescriptor(tmp);
                    installationService.install(tmp, null, root, true);
                } catch (Exception e) {
                    String errStr = "Failed to update Component: " + tmp.getName();
                    LOGGER.error(errStr, e);
                }
View Full Code Here

            }
            // unpackLocation returns null if no jbi descriptor is found
            if (tmpDir == null) {
                throw ManagementSupport.failure("deploy", "Unable to find jbi descriptor: " + saZipURL);
            }
            Descriptor root = null;
            try {
                root = DescriptorFactory.buildDescriptor(tmpDir);
            } catch (Exception e) {
                throw ManagementSupport.failure("deploy", "Unable to build jbi descriptor: " + saZipURL, e);
            }
            if (root == null) {
                throw ManagementSupport.failure("deploy", "Unable to find jbi descriptor: " + saZipURL);
            }
            ServiceAssembly sa = root.getServiceAssembly();
            if (sa == null) {
                throw ManagementSupport.failure("deploy", "JBI descriptor is not an assembly descriptor: " + saZipURL);
            }
            return deployServiceAssembly(tmpDir, sa);
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.deployment.Descriptor

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.