Docker integration - Start/Stop container actions

This commit is contained in:
Michael Golubev
2014-12-22 22:34:07 +01:00
parent 6cc18c1280
commit a9a09f01e5
7 changed files with 19 additions and 14 deletions
@@ -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<Config extends CloudAgentConfig> extends CloudAgent {
public interface CloudAgentBase<Config extends CloudAgentConfig, AppIdentity extends CloudRemoteApplication> extends CloudAgent {
void connect(Config config, CloudAgentCallback callback, CloudAgentLogger logger, CloudAgentErrorHandler errorHandler);
@@ -26,5 +26,5 @@ public interface CloudAgentBase<Config extends CloudAgentConfig> extends CloudAg
void disconnect();
@ChildCall
CloudAgentApplication createApplication(String applicationName);
CloudAgentApplication createApplication(AppIdentity applicationIdentity);
}
@@ -20,9 +20,9 @@ import com.intellij.remoteServer.agent.annotation.ChildCall;
/**
* @author michael.golubev
*/
public interface CloudAgentWithDeployment<Config extends CloudAgentConfig,
public interface CloudAgentWithDeployment<Config extends CloudAgentConfig, AppIdentity extends CloudRemoteApplication,
DeploymentConfig extends CloudAgentDeploymentConfig>
extends CloudAgentBase<Config> {
extends CloudAgentBase<Config, AppIdentity> {
@ChildCall
CloudAgentDeployment createDeployment(DeploymentConfig config, CloudAgentLoggingHandler loggingHandler);
@@ -17,4 +17,5 @@ package com.intellij.remoteServer.impl.runtime.ui.tree;
public interface ServersTreeNode {
Object getValue();
}
@@ -51,5 +51,9 @@ public abstract class CloudApplicationRuntimeBase extends CloudApplicationRuntim
}, callback);
}
protected ServerTaskExecutor getTaskExecutor() {
return myTaskExecutor;
}
protected abstract CloudAgentApplication getApplication();
}
@@ -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<?, CloudRemoteApplication> agent,
CloudRemoteApplication applicationIdentity) {
super(taskExecutor, applicationIdentity.getName());
myAgentApplication = agent.createApplication(applicationIdentity);
}
@Override
@@ -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);
@@ -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);
}