Search in sources :

Example 11 with Deployment

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);
    }
}
Also used : Deployment(org.glassfish.internal.deployment.Deployment) ApplicationMetaDataProvider(org.glassfish.api.deployment.ApplicationMetaDataProvider)

Example 12 with Deployment

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);
}
Also used : ApplicationRegistry(org.glassfish.internal.data.ApplicationRegistry) ApplicationInfo(org.glassfish.internal.data.ApplicationInfo) Deployment(org.glassfish.internal.deployment.Deployment) ApplicationLoaderService(com.sun.enterprise.v3.server.ApplicationLoaderService)

Aggregations

Deployment (org.glassfish.internal.deployment.Deployment)12 ExtendedDeploymentContext (org.glassfish.internal.deployment.ExtendedDeploymentContext)9 ActionReport (org.glassfish.api.ActionReport)7 DeployCommandParameters (org.glassfish.api.deployment.DeployCommandParameters)7 File (java.io.File)6 ApplicationInfo (org.glassfish.internal.data.ApplicationInfo)6 UndeployCommandParameters (org.glassfish.api.deployment.UndeployCommandParameters)5 IOException (java.io.IOException)4 Properties (java.util.Properties)3 ReadableArchive (org.glassfish.api.deployment.archive.ReadableArchive)3 ApplicationRegistry (org.glassfish.internal.data.ApplicationRegistry)3 ApplicationRef (com.sun.enterprise.config.serverbeans.ApplicationRef)2 ArchiveFactory (com.sun.enterprise.deploy.shared.ArchiveFactory)2 ApplicationLoaderService (com.sun.enterprise.v3.server.ApplicationLoaderService)2 PropertyVetoException (java.beans.PropertyVetoException)2 ServerEnvironment (org.glassfish.api.admin.ServerEnvironment)2 ApplicationMetaDataProvider (org.glassfish.api.deployment.ApplicationMetaDataProvider)2 ArchiveHandler (org.glassfish.api.deployment.archive.ArchiveHandler)2 EventListener (org.glassfish.api.event.EventListener)2 Events (org.glassfish.api.event.Events)2