Search in sources :

Example 1 with ExternalSystemFacadeWrapper

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;
}
Also used : Disposable(com.intellij.openapi.Disposable) ExternalSystemFacadeWrapper(com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemFacadeWrapper) ExternalSystemExecutionSettings(com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Disposable (com.intellij.openapi.Disposable)1 ExternalSystemExecutionSettings (com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings)1 ExternalSystemFacadeWrapper (com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemFacadeWrapper)1 NotNull (org.jetbrains.annotations.NotNull)1