use of org.glassfish.api.deployment.DeployCommandParameters in project Payara by payara.
the class WebDeployer method loadWebModuleConfig.
private WebModuleConfig loadWebModuleConfig(DeploymentContext dc) {
WebModuleConfig wmInfo = new WebModuleConfig();
try {
DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class);
wmInfo.setDescriptor(dc.getModuleMetaData(WebBundleDescriptorImpl.class));
wmInfo.setVirtualServers(params.virtualservers);
wmInfo.setLocation(dc.getSourceDir());
wmInfo.setObjectType(dc.getAppProps().getProperty(ServerTags.OBJECT_TYPE));
} catch (Exception ex) {
String msg = rb.getString(LogFacade.UNABLE_TO_LOAD_CONFIG);
msg = MessageFormat.format(msg, wmInfo.getName());
logger.log(Level.WARNING, msg, ex);
}
return wmInfo;
}
use of org.glassfish.api.deployment.DeployCommandParameters in project Payara by payara.
the class AppClientGroupFacadeGenerator method earDirUserURIText.
private String earDirUserURIText(final DeploymentContext dc) {
final DeployCommandParameters deployParams = dc.getCommandParameters(DeployCommandParameters.class);
final String appName = deployParams.name();
try {
return VersioningUtils.getUntaggedName(appName) + "Client/";
} catch (VersioningSyntaxException ex) {
Logger.getLogger(JavaWebStartInfo.APPCLIENT_SERVER_MAIN_LOGGER, JavaWebStartInfo.APPCLIENT_SERVER_LOGMESSAGE_RESOURCE).log(Level.SEVERE, null, ex);
}
return appName;
}
use of org.glassfish.api.deployment.DeployCommandParameters in project Payara by payara.
the class StandaloneAppClientDeployerHelper method facadeNameOnly.
/**
* Returns the name (no path, no type) of the facade JAR. This is used
* in both creating the full name and URI of the facade as well as for
* the name of a subdirectory in the user's download directory.
*
* @param dc
* @return
*/
private String facadeNameOnly(DeploymentContext dc) {
DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class);
final String appName = params.name();
try {
return VersioningUtils.getUntaggedName(appName) + "Client";
} catch (VersioningSyntaxException ex) {
logger.log(Level.SEVERE, ex.getMessage(), ex);
}
return appName + "Client";
}
use of org.glassfish.api.deployment.DeployCommandParameters in project Payara by payara.
the class EarHandler method getApplicationHolder.
private ApplicationHolder getApplicationHolder(ReadableArchive source, DeploymentContext context, boolean isDirectory) {
ApplicationHolder holder = context.getModuleMetaData(ApplicationHolder.class);
if (holder == null || holder.app == null) {
try {
DeployCommandParameters params = context.getCommandParameters(DeployCommandParameters.class);
if (params != null && params.altdd != null) {
source.addArchiveMetaData(DeploymentProperties.ALT_DD, params.altdd);
}
long start = System.currentTimeMillis();
ApplicationArchivist archivist = habitat.getService(ApplicationArchivist.class);
archivist.setAnnotationProcessingRequested(true);
String xmlValidationLevel = dasConfig.getDeployXmlValidation();
archivist.setXMLValidationLevel(xmlValidationLevel);
if (xmlValidationLevel.equals("none")) {
archivist.setXMLValidation(false);
}
holder = new ApplicationHolder(archivist.createApplication(source, isDirectory));
_logger.log(FINE, "time to read application.xml {0}", System.currentTimeMillis() - start);
} catch (IOException | SAXParseException e) {
throw new RuntimeException(e);
}
context.addModuleMetaData(holder);
}
if (holder.app == null) {
throw new RuntimeException(strings.get("errReadMetadata"));
}
return holder;
}
use of org.glassfish.api.deployment.DeployCommandParameters in project Payara by payara.
the class ResourceValidator method event.
@Override
public void event(Event<?> event) {
if (event.is(Deployment.AFTER_APPLICATION_CLASSLOADER_CREATION)) {
DeploymentContext deploymentContext = (DeploymentContext) event.hook();
Application application = deploymentContext.getModuleMetaData(Application.class);
DeployCommandParameters commandParams = deploymentContext.getCommandParameters(DeployCommandParameters.class);
target = commandParams.target;
if (System.getProperty("deployment.resource.validation", "true").equals("false")) {
deplLogger.log(Level.INFO, SKIP_RESOURCE_VALIDATION);
return;
}
if (application == null) {
return;
}
AppResources appResources = new AppResources();
// Puts all resources found in the application via annotation or xml into appResources
parseResources(deploymentContext, application, appResources);
// Ensure we have a valid component invocation before triggering lookups
try (Context ctx = contextUtil.empty().pushContext()) {
validateResources(deploymentContext, application, appResources);
}
}
}
Aggregations