use of org.glassfish.internal.deployment.Deployment in project Payara by payara.
the class ApplicationState method reloadApplicationMetaData.
private void reloadApplicationMetaData(DeploymentContext dc) throws IOException {
Deployment deployment = habitat.getService(Deployment.class);
Map<Class, ApplicationMetaDataProvider> typeByProvider = deployment.getTypeByProvider();
for (Class requiredMetaDataClasse : this.requiredMetaDataClasses()) {
ApplicationMetaDataProvider metaDataProvider = typeByProvider.get(requiredMetaDataClasse);
metaDataProvider.load(dc);
}
}
use of org.glassfish.internal.deployment.Deployment in project Payara by payara.
the class InstallerThread method load.
/**
* <p> Load the Admin Console web application.</p>
*/
private void load() {
ApplicationRegistry appRegistry = habitat.<ApplicationRegistry>getService(ApplicationRegistry.class);
ApplicationInfo appInfo = appRegistry.get(AdminConsoleAdapter.ADMIN_APP_NAME);
if (appInfo != null && appInfo.isLoaded()) {
// Application is already loaded
adapter.setStateMsg(AdapterState.APPLICATION_LOADED);
return;
}
// hook for Jerome
Application config = adapter.getConfig();
if (config == null) {
throw new IllegalStateException("Admin Console application has no system app entry!");
}
// Set adapter state
adapter.setStateMsg(AdapterState.APPLICATION_LOADING);
// Load the Admin Console Application
String sn = env.getInstanceName();
// FIXME: An exception may not be thrown... check for errors!
ApplicationRef ref = domain.getApplicationRefInServer(sn, AdminConsoleAdapter.ADMIN_APP_NAME);
Deployment lifecycle = habitat.getService(Deployment.class);
for (Deployment.ApplicationDeployment depl : habitat.getService(ApplicationLoaderService.class).processApplication(config, ref)) {
lifecycle.initialize(depl.appInfo, depl.appInfo.getSniffers(), depl.context);
}
// Set adapter state
adapter.setStateMsg(AdapterState.APPLICATION_LOADED);
}
Aggregations