Skip to content
Permalink
Browse files
This closes #1167
  • Loading branch information
ahgittin committed Jan 25, 2016
2 parents ac0636c + 39e2a4e commit b50e17645d404b09b254a754c41d90462586a307
Showing 1 changed file with 53 additions and 46 deletions.
@@ -107,63 +107,68 @@ public void start() {
skipStart = entityStarted.or(false);
}
if (!skipStart) {
Optional<Boolean> locationInstalled = Optional.fromNullable(getLocation().getConfig(BrooklynConfigKeys.SKIP_ENTITY_INSTALLATION));
Optional<Boolean> entityInstalled = Optional.fromNullable(entity.getConfig(BrooklynConfigKeys.SKIP_ENTITY_INSTALLATION));
boolean skipInstall = locationInstalled.or(entityInstalled).or(false);
if (!skipInstall) {
DynamicTasks.queue("copy-pre-install-resources", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.PRE_INSTALL_RESOURCES_LATCH);
copyPreInstallResources();
}});

DynamicTasks.queue("pre-install", new Runnable() { public void run() {
preInstall();
}});

DynamicTasks.queue("pre-install-command", new Runnable() { public void run() {
runPreInstallCommand();
}});
DynamicTasks.queue("setup", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.SETUP_LATCH);
setup();
}});

DynamicTasks.queue("copy-install-resources", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.INSTALL_RESOURCES_LATCH);
copyInstallResources();
}});
DynamicTasks.queue("install", new Runnable() { public void run() {

Optional<Boolean> locationInstalled = Optional.fromNullable(getLocation().getConfig(BrooklynConfigKeys.SKIP_ENTITY_INSTALLATION));
Optional<Boolean> entityInstalled = Optional.fromNullable(entity.getConfig(BrooklynConfigKeys.SKIP_ENTITY_INSTALLATION));
boolean skipInstall = locationInstalled.or(entityInstalled).or(false);
if (!skipInstall) {
DynamicTasks.queue("copy-pre-install-resources", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.PRE_INSTALL_RESOURCES_LATCH);
copyPreInstallResources();
}});

DynamicTasks.queue("pre-install", new Runnable() { public void run() {
preInstall();
}});

DynamicTasks.queue("pre-install-command", new Runnable() { public void run() {
runPreInstallCommand();
}});
DynamicTasks.queue("setup", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.SETUP_LATCH);
setup();
}});

DynamicTasks.queue("copy-install-resources", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.INSTALL_RESOURCES_LATCH);
copyInstallResources();
}});

DynamicTasks.queue("install (main)", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.INSTALL_LATCH);
install();
}});
}

DynamicTasks.queue("install", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.INSTALL_LATCH);
install();
DynamicTasks.queue("post-install-command", new Runnable() { public void run() {
runPostInstallCommand();
}});
}

DynamicTasks.queue("post-install-command", new Runnable() { public void run() {
runPostInstallCommand();
}});

DynamicTasks.queue("customize", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.CUSTOMIZE_LATCH);
customize();
}});

DynamicTasks.queue("copy-runtime-resources", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.RUNTIME_RESOURCES_LATCH);
copyRuntimeResources();
}});
DynamicTasks.queue("launch", new Runnable() { public void run() {
DynamicTasks.queue("copy-runtime-resources", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.RUNTIME_RESOURCES_LATCH);
copyRuntimeResources();
}});

DynamicTasks.queue("pre-launch-command", new Runnable() { public void run() {
runPreLaunchCommand();
}});
DynamicTasks.queue("pre-launch-command", new Runnable() { public void run() {
runPreLaunchCommand();
}});

DynamicTasks.queue("launch", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.LAUNCH_LATCH);
launch();
}});
DynamicTasks.queue("launch (main)", new Runnable() { public void run() {
waitForConfigKey(BrooklynConfigKeys.LAUNCH_LATCH);
launch();
}});

DynamicTasks.queue("post-launch-command", new Runnable() { public void run() {
runPostLaunchCommand();
DynamicTasks.queue("post-launch-command", new Runnable() { public void run() {
runPostLaunchCommand();
}});
}});
}

@@ -187,6 +192,7 @@ public void preInstall() {}
public abstract void customize();
public abstract void runPreLaunchCommand();
public abstract void launch();
/** Only run if launch is run (if start is not skipped). */
public abstract void runPostLaunchCommand();

@Override
@@ -195,7 +201,8 @@ public void kill() {
}

/**
* Implement this method in child classes to add some post-launch behavior
* Implement this method in child classes to add some post-launch behavior.
* This is run even if start is skipped and launch is not run.
*/
public void postLaunch() {}

0 comments on commit b50e176

Please sign in to comment.