public String deploy()

in jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/DeploymentService.java [66:103]


    public String deploy(String saZipURL, boolean autoStart) throws Exception {
        try {
            if (saZipURL == null) {
                throw ManagementSupport.failure("deploy", "saZipURL must not be null");
            }
            File jarfile = new File(saZipURL);
            if (jarfile.exists() && jarfile.isFile()) {
                Descriptor root;
                try {
                    root = Transformer.getDescriptor(jarfile);
                } 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);
                }
                // TODO: Move the following code in the installer
                DescriptorFactory.checkDescriptor(root);
                ServiceAssemblyDesc sa = root.getServiceAssembly();
                if (sa == null) {
                    throw ManagementSupport.failure("deploy", "JBI descriptor is not an assembly descriptor: " + saZipURL);
                }
                checkSus(sa.getServiceUnits());
                String name = sa.getIdentification().getName();
                logger.info("Deploy ServiceAssembly {}", name);
                ServiceAssemblyInstaller installer = new ServiceAssemblyInstaller(deployer, root, jarfile, autoStart);
                installer.installBundle();
                installer.init();
                installer.install();
                return ManagementSupport.createSuccessMessage("deploy SA", name);
            } else {
                throw new RuntimeException("location for deployment SA: " + saZipURL + " isn't a valid file");
            }
        } catch (Exception e) {
            logger.error("Error deploying service assembly", e);
            throw e;
        }
    }