RemoteExternalSystemFacade (@Nullable Project project, @NotNull String externalProjectPath, @NotNull ProjectSystemId externalSystemId) { if (project == null) { project = ProjectManager.getInstance().getDefaultProject(); } IntegrationKey key = new IntegrationKey(project, externalSystemId, externalProjectPath); final RemoteExternalSystemFacade facade = myFacadeWrappers.get(key); if (facade == null) { final RemoteExternalSystemFacade newFacade = (RemoteExternalSystemFacade)Proxy.newProxyInstance( ExternalSystemFacadeManager.class.getClassLoader(), new Class[]{RemoteExternalSystemFacade.class, Consumer.class}, new MyHandler(key) ); myFacadeWrappers.putIfAbsent(key, newFacade); } return myFacadeWrappers.get(key); }