Skip to content

Commit

Permalink
PetalsEsbInstaller should be independent of PetalsEsbEngine to not ha…
Browse files Browse the repository at this point in the history
…ve circular dependencies.
  • Loading branch information
simonharrer committed Sep 29, 2015
1 parent 3fa8b17 commit de74eca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ public void shutdown() {

@Override
public void install() {
PetalsEsbInstaller installer = new PetalsEsbInstaller(this);
PetalsEsbInstaller installer = new PetalsEsbInstaller();
installer.setServerDir(getServerPath());
installer.setFileName("petals-esb-distrib-4.1.0.zip");
installer.setTargetEsbInstallDir(getServerPath().resolve("petals-esb-4.1/install"));
installer.setBpelComponentPath(getServerPath().resolve("petals-esb-distrib-4.1.0/esb-components/petals-se-bpel-1.1.0.zip"));
installer.setSoapComponentPath(getServerPath().resolve("petals-esb-distrib-4.1.0/esb-components/petals-bc-soap-4.2.0.zip"));
installer.setSourceFile(getServerPath().resolve("petals-esb-distrib-4.1.0/esb/petals-esb-4.1.zip"));
installer.setCliFile(getServerPath().resolve("petals-esb-distrib-4.1.0/esb/petals-cli-2.0.0.zip"));
installer.setPetalsBinFolder(getPetalsBinFolder());
installer.install();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,15 @@ public void shutdown() {

@Override
public void install() {
PetalsEsbInstaller installer = new PetalsEsbInstaller(this);
PetalsEsbInstaller installer = new PetalsEsbInstaller();
installer.setServerDir(getServerPath());
installer.setFileName("petals-esb-distrib-4.0.zip");
installer.setTargetEsbInstallDir(getServerPath().resolve("petals-esb-4.0/install"));
installer.setBpelComponentPath(getServerPath().resolve("petals-esb-distrib-4.0/esb-components/petals-se-bpel-1.1.0.zip"));
installer.setSoapComponentPath(getServerPath().resolve("petals-esb-distrib-4.0/esb-components/petals-bc-soap-4.1.0.zip"));
installer.setSourceFile(getServerPath().resolve("petals-esb-distrib-4.0/esb/petals-esb-4.0.zip"));
installer.setCliFile(getServerPath().resolve("petals-esb-distrib-4.0/esb/petals-cli-1.0.0.zip"));
installer.setPetalsBinFolder(getPetalsBinFolder());
installer.install();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ public class PetalsEsbInstaller {
private Path bpelComponentPath;
private Path soapComponentPath;
private Path sourceFile;
private PetalsEsbEngine engine;
private Path petalsBinFolder;
private Path cliFile;

public PetalsEsbInstaller(PetalsEsbEngine engine){
this.engine = engine;
}

public void install() {
FileTasks.deleteDirectory(serverDir);
FileTasks.mkdirs(serverDir);
Expand All @@ -41,9 +37,13 @@ public void install() {
FileTasks.copyFileIntoFolder(bpelComponentPath, targetEsbInstallDir);
FileTasks.copyFileIntoFolder(soapComponentPath, targetEsbInstallDir);

FileTasks.createFile(engine.getPetalsBinFolder().resolve("start-petals.sh"), "export JAVA_HOME=$JAVA7_HOME\ncd \"" + engine.getPetalsBinFolder().toAbsolutePath() + "\" && ./petals-esb.sh >/dev/null 2>&1 &");
ConsoleTasks.executeOnUnix(ConsoleTasks.CliCommand.build(engine.getPetalsBinFolder(), "chmod").values("+x", "start-petals.sh"));
ConsoleTasks.executeOnUnix(ConsoleTasks.CliCommand.build(engine.getPetalsBinFolder(), "chmod").values("+x", "petals-esb.sh"));
FileTasks.createFile(petalsBinFolder.resolve("start-petals.sh"), "export JAVA_HOME=$JAVA7_HOME\ncd \"" + petalsBinFolder.toAbsolutePath() + "\" && ./petals-esb.sh >/dev/null 2>&1 &");
ConsoleTasks.executeOnUnix(ConsoleTasks.CliCommand.build(petalsBinFolder, "chmod").values("+x", "start-petals.sh"));
ConsoleTasks.executeOnUnix(ConsoleTasks.CliCommand.build(petalsBinFolder, "chmod").values("+x", "petals-esb.sh"));
}

public void setPetalsBinFolder(Path petalsBinFolder) {
this.petalsBinFolder = petalsBinFolder;
}

public void setServerDir(Path serverDir) {
Expand Down

0 comments on commit de74eca

Please sign in to comment.