use of com.intellij.javaee.appServerIntegrations.ApplicationServer in project google-cloud-intellij by GoogleCloudPlatform.
the class JavaeeFrameworkSupportProviderTestCase method deleteApplicationServers.
public static void deleteApplicationServers() {
final ApplicationServersManager manager = ApplicationServersManager.getInstance();
final List<ApplicationServer> servers = manager.getApplicationServers();
final ApplicationServersManager.ApplicationServersManagerModifiableModel model = manager.createModifiableModel();
for (ApplicationServer server : servers) {
model.deleteApplicationServer(server);
}
ApplicationManager.getApplication().runWriteAction(model::commit);
}
use of com.intellij.javaee.appServerIntegrations.ApplicationServer in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineStandardUltimateWebIntegration method getOrCreateAppServer.
private static ApplicationServer getOrCreateAppServer() {
final CloudSdkService sdkService = CloudSdkService.getInstance();
if (sdkService == null) {
return null;
}
final AppEngineServerIntegration integration = AppEngineServerIntegration.getInstance();
// There are no distinguishing features about the App Engine servers so just return
// the first one found
final List<ApplicationServer> servers = ApplicationServersManager.getInstance().getApplicationServers(integration);
if (!servers.isEmpty()) {
return servers.iterator().next();
}
return ApplicationServersManager.getInstance().createServer(integration, new JavaeePersistentData());
}
use of com.intellij.javaee.appServerIntegrations.ApplicationServer in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineStandardUltimateWebIntegration method setupLocalDevRunConfiguration.
private void setupLocalDevRunConfiguration(Artifact artifact, @NotNull Project project, ModuleRunConfiguration existingConfiguration) {
final ApplicationServer appServer = getOrCreateAppServer();
if (appServer != null) {
AppEngineServerConfigurationType configurationType = AppEngineServerConfigurationType.getInstance();
CommonModel configuration;
if (existingConfiguration instanceof CommonModel && ((CommonModel) existingConfiguration).getServerModel() instanceof AppEngineServerModel) {
configuration = (CommonModel) existingConfiguration;
} else if (RunManager.getInstance(project).getConfigurationSettingsList(configurationType).isEmpty()) {
final RunnerAndConfigurationSettings settings = J2EEConfigurationFactory.getInstance().addAppServerConfiguration(project, configurationType.getLocalFactory(), appServer);
configuration = (CommonModel) settings.getConfiguration();
} else {
configuration = null;
}
if (artifact != null && configuration != null && configuration.getServerModel() instanceof AppEngineServerModel) {
((AppEngineServerModel) configuration.getServerModel()).setArtifact(artifact);
BuildArtifactsBeforeRunTaskProvider.setBuildArtifactBeforeRun(project, configuration, artifact);
}
}
}
use of com.intellij.javaee.appServerIntegrations.ApplicationServer in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineGwtServerProvider method getServers.
@Override
public List<? extends GwtDevModeServer> getServers() {
final List<ApplicationServer> servers = ApplicationServersManager.getInstance().getApplicationServers(AppEngineServerIntegration.getInstance());
final List<GwtDevModeServer> result = new ArrayList<GwtDevModeServer>();
for (ApplicationServer server : servers) {
result.add(new AppEngineGwtServer(server));
}
return result;
}
Aggregations