/** * Deploys the archive to a running container. * * @param archive the archive to deploy * * @return the runtime name of the deployment * * @throws DeploymentException if an error happens during deployment * @throws IllegalStateException if the client has been closed */ public String deploy(Archive<?> archive) throws DeploymentException { return deployInternal(archive); }
/** * Removes an archive from the running container. * <p> * All exceptions are caught and logged as a warning. {@link Error Errors} will still be thrown however. * </p> * * @param runtimeName the runtime name for the deployment */ public void undeploy(String runtimeName) { undeploy(runtimeName, true); }
/** * Checks if the deployment content is on the server. * * @param name the name of the deployment * * @return {@code true} if the deployment content exists otherwise {@code false} * * @throws IOException if a failure occurs communicating with the server */ public boolean hasDeployment(final String name) throws IOException { checkState(); return deploymentManager.hasDeployment(name); }
@Override public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { String runtimeName = archiveDeployer.get().deploy(archive); return getManagementClient().getProtocolMetaData(runtimeName); }
@Override public void setup(T config) { containerConfig = config; final String authenticationConfig = containerConfig.getAuthenticationConfig(); // Check for an Elytron configuration if (authenticationConfig != null) { this.authenticationConfig = URI.create(authenticationConfig); } final ManagementClient client = new ManagementClient(new DelegatingModelControllerClient(mccProvider), containerConfig); managementClient.set(client); archiveDeployer.set(new ArchiveDeployer(client)); }
private String deployInternal(Archive<?> archive) throws DeploymentException { checkState(); final InputStream input = archive.as(ZipExporter.class).exportAsInputStream(); try { return deployInternal(archive.getName(), input); } finally { if (input != null) try { input.close(); } catch (IOException e) { log.warnf(e, "Failed to close resource %s", input); } } }
private String deployInternal(String name, InputStream input) throws DeploymentException { checkState(); final DeploymentResult result; try { result = deploymentManager.deploy(Deployment.of(input, name)); } catch (Exception ex) { throw createException("Cannot deploy: " + name, ex); } if (result.successful()) { return name; } throw new DeploymentException(String.format("Cannot deploy %s: %s", name, result.getFailureMessage())); }
@Override public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { String runtimeName = archiveDeployer.get().deploy(archive); return getManagementClient().getProtocolMetaData(runtimeName); }
@Override public void setup(T config) { containerConfig = config; final String authenticationConfig = containerConfig.getAuthenticationConfig(); // Check for an Elytron configuration if (authenticationConfig != null) { this.authenticationConfig = URI.create(authenticationConfig); } final ManagementClient client = new ManagementClient(new DelegatingModelControllerClient(mccProvider), containerConfig); managementClient.set(client); archiveDeployer.set(new ArchiveDeployer(client)); }
private String deployInternal(Archive<?> archive) throws DeploymentException { checkState(); final InputStream input = archive.as(ZipExporter.class).exportAsInputStream(); try { return deployInternal(archive.getName(), input); } finally { if (input != null) try { input.close(); } catch (IOException e) { log.warnf(e, "Failed to close resource %s", input); } } }
private String deployInternal(String name, InputStream input) throws DeploymentException { checkState(); final DeploymentResult result; try { result = deploymentManager.deploy(Deployment.of(input, name)); } catch (Exception ex) { throw createException("Cannot deploy: " + name, ex); } if (result.successful()) { return name; } throw new DeploymentException(String.format("Cannot deploy %s: %s", name, result.getFailureMessage())); }
/** * Deploys the archive to a running container. * * @param archive the archive to deploy * * @return the runtime name of the deployment * * @throws DeploymentException if an error happens during deployment * @throws IllegalStateException if the client has been closed */ public String deploy(Archive<?> archive) throws DeploymentException { return deployInternal(archive); }
/** * Removes an archive from the running container. * <p> * All exceptions are caught and logged as a warning. {@link Error Errors} will still be thrown however. * </p> * * @param runtimeName the runtime name for the deployment */ public void undeploy(String runtimeName) { undeploy(runtimeName, true); }
@Override public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { String runtimeName = archiveDeployer.get().deploy(archive); return getManagementClient().getProtocolMetaData(runtimeName); }
managementClient.set(client); ArchiveDeployer deployer = new ArchiveDeployer(modelControllerClient); archiveDeployer.set(deployer);
/** * Checks if the deployment content is on the server. * * @param name the name of the deployment * * @return {@code true} if the deployment content exists otherwise {@code false} * * @throws IOException if a failure occurs communicating with the server */ public boolean hasDeployment(final String name) throws IOException { checkState(); return deploymentManager.hasDeployment(name); }
public String deploy(String name, InputStream input) throws DeploymentException { return deployInternal(name, input); }
@Override public void undeploy(Archive<?> archive) throws DeploymentException { archiveDeployer.get().undeploy(archive.getName()); }
@Override public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { String runtimeName = archiveDeployer.get().deploy(archive); return getManagementClient().getProtocolMetaData(runtimeName); }
managementClient.set(client); ArchiveDeployer deployer = new ArchiveDeployer(modelControllerClient); archiveDeployer.set(deployer);