use of com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemFacadeWrapper in project intellij-community by JetBrains.
the class ExternalSystemFacadeManager method doCreateFacade.
@SuppressWarnings("unchecked")
@NotNull
private RemoteExternalSystemFacade doCreateFacade(@NotNull IntegrationKey key, @NotNull Project project, @NotNull ExternalSystemCommunicationManager communicationManager) throws Exception {
final RemoteExternalSystemFacade facade = communicationManager.acquire(key.getExternalProjectConfigPath(), key.getExternalSystemId());
if (facade == null) {
throw new IllegalStateException("Can't obtain facade to working with external api at the remote process. Project: " + project);
}
Disposer.register(project, new Disposable() {
@Override
public void dispose() {
myFacadeWrappers.clear();
myRemoteFacades.clear();
}
});
final RemoteExternalSystemFacade result = new ExternalSystemFacadeWrapper(facade, myProgressManager);
ExternalSystemExecutionSettings settings = ExternalSystemApiUtil.getExecutionSettings(project, key.getExternalProjectConfigPath(), key.getExternalSystemId());
Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings> newPair = Pair.create(result, settings);
myRemoteFacades.put(key, newPair);
result.applySettings(newPair.second);
return result;
}
Aggregations