Deploy an archive.

@param deployment The ShrinkWrap archive to deploy.
@return The container.
@throws DeploymentException if an error occurs.
163128
public Container deploy(Archive<?> deployment) throws DeploymentException {
        if (!this.running) {
            throw new RuntimeException("The Container has not been started.");
        }

        this.deployer.deploy(deployment);

        return this;
    }
111953
public static String getDeployment(DeploymentType deployment, boolean indent) throws IOException {
        try {
            if (m_jc == null || m_schema == null) {
                throw new RuntimeException("Error schema validation.");
            }
            Marshaller marshaller = m_jc.createMarshaller();
            marshaller.setSchema(m_schema);
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.valueOf(indent));
            StringWriter sw = new StringWriter();
            marshaller.marshal(new JAXBElement<>(new QName("","deployment"), DeploymentType.class, deployment), sw);
            return sw.toString();
        } catch (JAXBException e) {
            // Convert some linked exceptions to more friendly errors.
            if (e.getLinkedException() instanceof java.io.FileNotFoundException) {
                hostLog.error(e.getLinkedException().getMessage());
                return null;
            } else if (e.getLinkedException() instanceof org.xml.sax.SAXParseException) {
                hostLog.error("Error schema validating deployment.xml file. " + e.getLinkedException().getMessage());
                return null;
            } else {
                throw new RuntimeException(e);
            }
        }
    }
442789
protected Set<String> resumePreviousByDeploymentName(CommandContext commandContext, DeploymentEntity deployment) {
    List<Deployment> previousDeployments = new DeploymentQueryImpl().deploymentName(deployment.getName()).list();
    Set<String> deploymentIds = new HashSet<String>(previousDeployments.size());
    for (Deployment d : previousDeployments) {
      deploymentIds.add(d.getId());
    }
    return deploymentIds;
  }
728169
public static Deployment of(final URL url) {
        final DeploymentContent deploymentContent = DeploymentContent.of(Assert.checkNotNullParam("url", url));
        return new Deployment(deploymentContent, null);
    }
594799
@Override
    public DeploymentPlanBuilder andDeploy() {
        String addedKey = getAddedContentKey();
        DeploymentActionImpl deployMod = DeploymentActionImpl.getDeployAction(addedKey);
        return new DeploymentPlanBuilderImpl(this, deployMod);
    }
170629
private void removeDeployment(File deployment) throws IOException
   {
      if (deployment == null)
         throw new IllegalArgumentException("Deployment is null");

      if (deployment.exists() || (shrinkwrapDeployments != null && shrinkwrapDeployments.contains(deployment)))
      {
         shrinkwrapDeployments.remove(deployment);

         if (shrinkwrapDeployments.isEmpty())
            shrinkwrapDeployments = null;

         recursiveDelete(deployment);
      }
   }
492177
public static DeploymentEntry merge(DeploymentEntry deployment1, DeploymentEntry deployment2) {
		final Map<String, String> mergedProperties = new HashMap<>(deployment1.asMap());
		mergedProperties.putAll(deployment2.asMap());

		final DescriptorProperties properties = new DescriptorProperties(true);
		properties.putProperties(mergedProperties);

		return new DeploymentEntry(properties);
	}
1337440
public void setDeploy(java.util.Collection<String> deploy) {
        if (deploy == null) {
            this.deploy = null;
            return;
        }

        this.deploy = new com.amazonaws.internal.SdkInternalList<String>(deploy);
    }
1200488
protected function deploy()
    {
        // create deploy outputfile
        $this->createOutputFile($this->outputFile, false);

        // create undo deploy outputfile
        $this->createOutputFile($this->undoOutputFile, true);
    }
453814
public static Operation createDeployOperation(final DeploymentDescription deployment) {
        Assert.checkNotNullParam("deployment", deployment);
        final CompositeOperationBuilder builder = CompositeOperationBuilder.create(true);
        addDeployOperationStep(builder, deployment);
        return builder.build();
    }
292497
@Override
    public void process() throws Exception {
        // if the deployment is Implicit, we don't want to process it
        if (deploymentContext != null && deploymentContext.isImplicit()) {
            return;
        }
        try {
            // First register OpenApiServletContextListener which triggers the final init
            WARArchive warArchive = archive.as(WARArchive.class);
            warArchive.findWebXmlAsset().addListener(LISTENER_CLASS);
        } catch (Exception e) {
            throw new RuntimeException("Failed to register OpenAPI listener", e);
        }

        OpenApiStaticFile staticFile = ArchiveUtil.archiveToStaticFile(archive);

        // Set models from annotations and static file
        OpenApiDocument openApiDocument = OpenApiDocument.INSTANCE;
        openApiDocument.config(config);
        openApiDocument.modelFromStaticFile(OpenApiProcessor.modelFromStaticFile(staticFile));
        openApiDocument.modelFromAnnotations(OpenApiProcessor.modelFromAnnotations(config, index));
    }
502967
static void addDeployOperationStep(final CompositeOperationBuilder builder, final DeploymentDescription deployment) {
        final String name = deployment.getName();

        final Set<String> serverGroups = deployment.getServerGroups();
        // If the server groups are empty this is a standalone deployment
        if (serverGroups.isEmpty()) {
            final ModelNode address = createAddress(DEPLOYMENT, name);
            builder.addStep(createOperation(DEPLOYMENT_DEPLOY_OPERATION, address));
        } else {
            for (String serverGroup : serverGroups) {
                final ModelNode address = createAddress(SERVER_GROUP, serverGroup, DEPLOYMENT, name);
                builder.addStep(createOperation(DEPLOYMENT_DEPLOY_OPERATION, address));
            }
        }
    }
120947
public void deployAll(String applicationName, Path directory) throws IOException {
        this.applicationName = applicationName;

        if (Files.isDirectory(directory)) {
            Files.list(directory)
                .filter(ResourceFilter::filterKubernetesResource)
                .map(p -> {
                    try {
                        return Files.newInputStream(p);
                    } catch (IOException e) {
                        throw new IllegalArgumentException(e);
                    }
                })
                .forEach(is -> {
                    try {
                        deploy(is);
                        is.close();
                    } catch (IOException e) {
                        throw new IllegalArgumentException(e);
                    }
                });
        } else {
            throw new IllegalArgumentException(String.format("%s should be a directory", directory));
        }
    }
442111
private void validateNotSameNameAndTypeOfDeployment(DeploymentDescription deployment) {
        for (Deployment existing : deployments) {
            if (existing.getDescription().getName().equals(deployment.getName())) {
                if (
                    (existing.getDescription().isArchiveDeployment() && deployment.isArchiveDeployment()) ||
                        (existing.getDescription().isDescriptorDeployment() && deployment.isDescriptorDeployment())) {
                    throw new IllegalArgumentException("Can not add multiple " +
                        Archive.class.getName() + " deployments with the same name: " + deployment.getName());
                }
            }
        }
    }
139409
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();    
    final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
    
    // must be EE Module
    if(eeModuleDescription == null) {
      return;
    }

    // discover user-provided component
    ComponentDescription paComponent = detectExistingComponent(deploymentUnit); 

    if(paComponent != null) {      
      log.log(Level.INFO, "Detected user-provided @"+ProcessApplication.class.getSimpleName()+" component with name '"+paComponent.getComponentName()+"'.");
      
      // mark this to be a process application
      ProcessApplicationAttachments.attachProcessApplicationComponent(deploymentUnit, paComponent);
      ProcessApplicationAttachments.mark(deploymentUnit);
      ProcessApplicationAttachments.markPartOfProcessApplication(deploymentUnit);
    }
  }
9250
@Override
	public void reloadContext() throws DeploymentException
	{
		Archive<?> archive = mssContainer.getArchive();
		deployableContainer.undeploy(archive);
		deployableContainer.deploy(archive);
	}
653623
public static void initialize(BeanManagerImpl deploymentManager, ServiceRegistry deploymentServices) {
        Container instance = new Container(RegistrySingletonProvider.STATIC_INSTANCE, deploymentManager, deploymentServices);
        Container.instance.set(RegistrySingletonProvider.STATIC_INSTANCE, instance);
    }