Search in sources :

Example 1 with ServerConnection

use of com.intellij.remoteServer.runtime.ServerConnection in project intellij-community by JetBrains.

the class DeployToServerState method execute.

@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    final ServerConnection connection = ServerConnectionManager.getInstance().getOrCreateConnection(myServer);
    final Project project = myEnvironment.getProject();
    RemoteServersView.getInstance(project).showServerConnection(connection);
    final DebugConnector<?, ?> debugConnector;
    if (DefaultDebugExecutor.getDebugExecutorInstance().equals(executor)) {
        debugConnector = myServer.getType().createDebugConnector();
    } else {
        debugConnector = null;
    }
    connection.deploy(new DeploymentTaskImpl(mySource, myConfiguration, project, debugConnector, myEnvironment), s -> RemoteServersView.getInstance(project).showDeployment(connection, (String) s));
    return null;
}
Also used : Project(com.intellij.openapi.project.Project) ServerConnection(com.intellij.remoteServer.runtime.ServerConnection) DeploymentTaskImpl(com.intellij.remoteServer.impl.runtime.deployment.DeploymentTaskImpl) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with ServerConnection

use of com.intellij.remoteServer.runtime.ServerConnection in project intellij-community by JetBrains.

the class ServerConnectionManagerImpl method getOrCreateConnection.

@NotNull
@Override
public <C extends ServerConfiguration> ServerConnection getOrCreateConnection(@NotNull RemoteServer<C> server) {
    ApplicationManager.getApplication().assertIsDispatchThread();
    ServerConnection connection = myConnections.get(server);
    if (connection == null) {
        connection = doCreateConnection(server, this);
        myConnections.put(server, connection);
        myEventDispatcher.fireConnectionCreated(connection);
    }
    return connection;
}
Also used : ServerConnection(com.intellij.remoteServer.runtime.ServerConnection) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ServerConnection (com.intellij.remoteServer.runtime.ServerConnection)2 Project (com.intellij.openapi.project.Project)1 DeploymentTaskImpl (com.intellij.remoteServer.impl.runtime.deployment.DeploymentTaskImpl)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1