mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CR-IU-595 - introduce createTemporaryConnection - fix
This commit is contained in:
+8
-3
@@ -42,11 +42,14 @@ public class ServerConnectionImpl<D extends DeploymentConfiguration> implements
|
||||
private final Map<String, DeploymentImpl> myLocalDeployments = new HashMap<String, DeploymentImpl>();
|
||||
private final Map<String, DeploymentLogManagerImpl> myLogManagers = new ConcurrentHashMap<String, DeploymentLogManagerImpl>();
|
||||
|
||||
public ServerConnectionImpl(RemoteServer<?> server, ServerConnector connector, ServerConnectionManagerImpl connectionManager) {
|
||||
public ServerConnectionImpl(RemoteServer<?> server,
|
||||
ServerConnector connector,
|
||||
@Nullable ServerConnectionManagerImpl connectionManager,
|
||||
ServerConnectionEventDispatcher eventDispatcher) {
|
||||
myServer = server;
|
||||
myConnector = connector;
|
||||
myConnectionManager = connectionManager;
|
||||
myEventDispatcher = myConnectionManager.getEventDispatcher();
|
||||
myEventDispatcher = eventDispatcher;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -85,7 +88,9 @@ public class ServerConnectionImpl<D extends DeploymentConfiguration> implements
|
||||
|
||||
@Override
|
||||
public void disconnect() {
|
||||
myConnectionManager.removeConnection(myServer);
|
||||
if (myConnectionManager != null) {
|
||||
myConnectionManager.removeConnection(myServer);
|
||||
}
|
||||
doDisconnect();
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -26,7 +26,7 @@ public class ServerConnectionManagerImpl extends ServerConnectionManager {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
ServerConnection connection = myConnections.get(server);
|
||||
if (connection == null) {
|
||||
connection = doCreateConnection(server);
|
||||
connection = doCreateConnection(server, this);
|
||||
myConnections.put(server, connection);
|
||||
myEventDispatcher.fireConnectionCreated(connection);
|
||||
}
|
||||
@@ -36,12 +36,13 @@ public class ServerConnectionManagerImpl extends ServerConnectionManager {
|
||||
@NotNull
|
||||
@Override
|
||||
public <C extends ServerConfiguration> ServerConnection createTemporaryConnection(@NotNull RemoteServer<C> server) {
|
||||
return doCreateConnection(server);
|
||||
return doCreateConnection(server, null);
|
||||
}
|
||||
|
||||
private <C extends ServerConfiguration> ServerConnection doCreateConnection(@NotNull RemoteServer<C> server) {
|
||||
private <C extends ServerConfiguration> ServerConnection doCreateConnection(@NotNull RemoteServer<C> server,
|
||||
ServerConnectionManagerImpl manager) {
|
||||
ServerTaskExecutorImpl executor = new ServerTaskExecutorImpl();
|
||||
return new ServerConnectionImpl(server, server.getType().createConnector(server, executor), this);
|
||||
return new ServerConnectionImpl(server, server.getType().createConnector(server, executor), manager, getEventDispatcher());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user