Search in sources :

Example 1 with LocalDeploymentImpl

use of com.intellij.remoteServer.impl.runtime.deployment.LocalDeploymentImpl in project intellij-community by JetBrains.

the class ServerConnectionImpl method getDeployments.

@NotNull
@Override
public Collection<Deployment> getDeployments() {
    Set<Deployment> result = new LinkedHashSet<>();
    Map<Deployment, DeploymentImpl> orderedDeployments = new TreeMap<>(getServer().getType().getDeploymentComparator());
    synchronized (myLocalDeployments) {
        synchronized (myRemoteDeployments) {
            for (LocalDeploymentImpl localDeployment : myLocalDeployments.values()) {
                localDeployment.setRemoteDeployment(null);
                orderedDeployments.put(localDeployment, localDeployment);
            }
            result.addAll(orderedDeployments.keySet());
            for (DeploymentImpl remoteDeployment : myRemoteDeployments.values()) {
                DeploymentImpl deployment = orderedDeployments.get(remoteDeployment);
                if (deployment != null) {
                    if (deployment instanceof LocalDeploymentImpl) {
                        ((LocalDeploymentImpl) deployment).setRemoteDeployment(remoteDeployment);
                    }
                } else {
                    orderedDeployments.put(remoteDeployment, remoteDeployment);
                }
            }
            result.addAll(orderedDeployments.keySet());
        }
    }
    return result;
}
Also used : Deployment(com.intellij.remoteServer.runtime.Deployment) LocalDeploymentImpl(com.intellij.remoteServer.impl.runtime.deployment.LocalDeploymentImpl) DeploymentImpl(com.intellij.remoteServer.impl.runtime.deployment.DeploymentImpl) LocalDeploymentImpl(com.intellij.remoteServer.impl.runtime.deployment.LocalDeploymentImpl) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

DeploymentImpl (com.intellij.remoteServer.impl.runtime.deployment.DeploymentImpl)1 LocalDeploymentImpl (com.intellij.remoteServer.impl.runtime.deployment.LocalDeploymentImpl)1 Deployment (com.intellij.remoteServer.runtime.Deployment)1 NotNull (org.jetbrains.annotations.NotNull)1