From a9a09f01e537069e42efb145b3dabea6b83bde2d Mon Sep 17 00:00:00 2001 From: Michael Golubev Date: Mon, 22 Dec 2014 22:24:53 +0100 Subject: [PATCH] Docker integration - Start/Stop container actions --- .../intellij/remoteServer/agent/util/CloudAgentBase.java | 4 ++-- .../agent/util/CloudAgentWithDeployment.java | 4 ++-- .../impl/runtime/ui/tree/ServersTreeNode.java | 1 + .../remoteServer/util/CloudApplicationRuntimeBase.java | 4 ++++ .../remoteServer/util/CloudApplicationRuntimeImpl.java | 9 ++++++--- .../util/CloudMultiSourceServerRuntimeInstance.java | 5 +++-- .../remoteServer/util/CloudServerRuntimeInstance.java | 6 +----- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentBase.java b/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentBase.java index 9963a9dd5715..d24c91e58f59 100644 --- a/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentBase.java +++ b/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentBase.java @@ -18,7 +18,7 @@ package com.intellij.remoteServer.agent.util; import com.intellij.remoteServer.agent.annotation.ChildCall; import com.intellij.remoteServer.agent.annotation.FinalCall; -public interface CloudAgentBase extends CloudAgent { +public interface CloudAgentBase extends CloudAgent { void connect(Config config, CloudAgentCallback callback, CloudAgentLogger logger, CloudAgentErrorHandler errorHandler); @@ -26,5 +26,5 @@ public interface CloudAgentBase extends CloudAg void disconnect(); @ChildCall - CloudAgentApplication createApplication(String applicationName); + CloudAgentApplication createApplication(AppIdentity applicationIdentity); } diff --git a/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentWithDeployment.java b/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentWithDeployment.java index cf76eaa5216a..a52279b20063 100644 --- a/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentWithDeployment.java +++ b/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentWithDeployment.java @@ -20,9 +20,9 @@ import com.intellij.remoteServer.agent.annotation.ChildCall; /** * @author michael.golubev */ -public interface CloudAgentWithDeployment - extends CloudAgentBase { + extends CloudAgentBase { @ChildCall CloudAgentDeployment createDeployment(DeploymentConfig config, CloudAgentLoggingHandler loggingHandler); diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeNode.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeNode.java index 84cd735aaba6..8d345e53bdad 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeNode.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeNode.java @@ -17,4 +17,5 @@ package com.intellij.remoteServer.impl.runtime.ui.tree; public interface ServersTreeNode { + Object getValue(); } diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeBase.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeBase.java index a4689b16d57a..7b5da382028e 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeBase.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeBase.java @@ -51,5 +51,9 @@ public abstract class CloudApplicationRuntimeBase extends CloudApplicationRuntim }, callback); } + protected ServerTaskExecutor getTaskExecutor() { + return myTaskExecutor; + } + protected abstract CloudAgentApplication getApplication(); } diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeImpl.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeImpl.java index a3d780ab8cc4..bdbe0b93d98f 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeImpl.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeImpl.java @@ -17,15 +17,18 @@ package com.intellij.remoteServer.util; import com.intellij.remoteServer.agent.util.CloudAgentApplication; import com.intellij.remoteServer.agent.util.CloudAgentBase; +import com.intellij.remoteServer.agent.util.CloudRemoteApplication; import com.intellij.remoteServer.runtime.ServerTaskExecutor; public class CloudApplicationRuntimeImpl extends CloudApplicationRuntimeBase { private final CloudAgentApplication myAgentApplication; - public CloudApplicationRuntimeImpl(ServerTaskExecutor taskExecutor, CloudAgentBase agent, String applicationName) { - super(taskExecutor, applicationName); - myAgentApplication = agent.createApplication(applicationName); + public CloudApplicationRuntimeImpl(ServerTaskExecutor taskExecutor, + CloudAgentBase agent, + CloudRemoteApplication applicationIdentity) { + super(taskExecutor, applicationIdentity.getName()); + myAgentApplication = agent.createApplication(applicationIdentity); } @Override diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudMultiSourceServerRuntimeInstance.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudMultiSourceServerRuntimeInstance.java index 3fd3f24b190c..dbaeca7e0dd7 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudMultiSourceServerRuntimeInstance.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudMultiSourceServerRuntimeInstance.java @@ -7,6 +7,7 @@ import com.intellij.remoteServer.ServerType; import com.intellij.remoteServer.agent.util.CloudAgentConfigBase; import com.intellij.remoteServer.agent.util.CloudAgentLogger; import com.intellij.remoteServer.agent.util.CloudGitAgent; +import com.intellij.remoteServer.agent.util.CloudRemoteApplication; import com.intellij.remoteServer.configuration.deployment.DeploymentSource; import com.intellij.remoteServer.impl.configuration.deployment.DeployToServerRunConfiguration; import com.intellij.remoteServer.runtime.ServerConnector; @@ -175,8 +176,8 @@ public abstract class CloudMultiSourceServerRuntimeInstance< } @Override - protected CloudApplicationRuntime createApplicationRuntime(String applicationName) { - return new CloudGitApplicationRuntime(this, applicationName, null); + protected CloudApplicationRuntime createApplicationRuntime(CloudRemoteApplication application) { + return new CloudGitApplicationRuntime(this, application.getName(), null); } protected abstract void doConnect(SC configuration, CloudAgentLogger logger); diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudServerRuntimeInstance.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudServerRuntimeInstance.java index 8b9cc7f52029..3f9aecd8ba77 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudServerRuntimeInstance.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudServerRuntimeInstance.java @@ -125,9 +125,5 @@ public abstract class CloudServerRuntimeInstance }); } - protected CloudApplicationRuntime createApplicationRuntime(CloudRemoteApplication application) { - return createApplicationRuntime(application.getName()); - } - - protected abstract CloudApplicationRuntime createApplicationRuntime(String applicationName); + protected abstract CloudApplicationRuntime createApplicationRuntime(CloudRemoteApplication application); }