Skip to content

Commit

Permalink
Merge pull request #43 from uniba-dsg/openesb-305standalone
Browse files Browse the repository at this point in the history
Integrate OpenESB v3.05 standalone
  • Loading branch information
lenhard committed Sep 21, 2015
2 parents d7f55d9 + a1849d9 commit 583f903
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ public class OpenEsb301StandaloneEngine extends AbstractLocalBPELEngine {

private static final Logger LOGGER = Logger.getLogger(OpenEsb301StandaloneEngine.class);
public static final String WEB_UI = "http://localhost:4848/webui";
private String openEsbFolder = "OpenESB-SE-3.0.1";
private String binariesFileName = "OpenESB-Quickstart-Standalone-v301-server-only.zip";
private String adminBinariesFile = "openesb-oeadmin-1.0.1.jar";

public OpenEsb301StandaloneEngine(){
}

public OpenEsb301StandaloneEngine(String openEsbFolder, String binariesFileName, String adminBinariesFile){
this.openEsbFolder = openEsbFolder;
this.binariesFileName = binariesFileName;
this.adminBinariesFile = adminBinariesFile;
}

public Path getXsltPath() {
return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/openesb");
Expand All @@ -35,15 +47,15 @@ public void deploy(BPELProcess process) {
Path passwordFilePath = getServerPath().resolve("password.txt");
FileTasks.createFile(passwordFilePath, "OE_ADMIN_PASSWORD=admin");

String[] deployParams = {"-jar", "openesb-oeadmin-1.0.1.jar", "deploy-jbi-service-assembly",
String[] deployParams = {"-jar", adminBinariesFile, "deploy-jbi-service-assembly",
"--user", "admin",
"--passwordfile", StringUtils.toUnixStyle(passwordFilePath),
StringUtils.toUnixStyle(packageFilePath)};

ConsoleTasks.executeOnWindowsAndIgnoreError(ConsoleTasks.CliCommand.build(getInstanceFolder().resolve("lib"), "java").values(deployParams));
ConsoleTasks.executeOnUnixAndIgnoreError(ConsoleTasks.CliCommand.build(getInstanceFolder().resolve("lib"), "java").values(deployParams));

String[] startParams = {"-jar", "openesb-oeadmin-1.0.1.jar", "start-jbi-service-assembly",
String[] startParams = {"-jar", adminBinariesFile, "start-jbi-service-assembly",
"--user", "admin",
"--passwordfile", StringUtils.toUnixStyle(passwordFilePath),
processName + "Application"};
Expand Down Expand Up @@ -105,9 +117,8 @@ public void install() {
FileTasks.deleteDirectory(getServerPath());
FileTasks.mkdirs(getServerPath());

String filename = "OpenESB-Quickstart-Standalone-v301-server-only.zip";
NetworkTasks.downloadFileFromBetsyRepo(filename);
ZipTasks.unzip(Configuration.getDownloadsDir().resolve(filename), getServerPath());
NetworkTasks.downloadFileFromBetsyRepo(binariesFileName);
ZipTasks.unzip(Configuration.getDownloadsDir().resolve(binariesFileName), getServerPath());

FileTasks.createFile(getServerPath().resolve("start-openesb.bat"), "cd \"" + getInstanceBinFolder().toAbsolutePath() + "\" && start \"" + getName() + "\" /min openesb.bat");

Expand Down Expand Up @@ -148,7 +159,7 @@ public void startup() {
WaitTasks.waitForAvailabilityOfUrl(10 * 1000, 500, WEB_UI);

// install bpelse
Path components = getServerPath().resolve("OpenESB-SE-3.0.1").resolve("OE-Components");
Path components = getServerPath().resolve(openEsbFolder).resolve("OE-Components");
Path installFolder = getInstanceFolder().resolve("server").resolve("jbi").resolve("autoinstall");

WaitTasks.waitFor(10 * 1000, 500, () -> FileTasks.hasFolder(installFolder));
Expand All @@ -160,7 +171,7 @@ public void startup() {
}

private Path getInstanceFolder() {
return getServerPath().resolve("OpenESB-SE-3.0.1").resolve("OE-Instance");
return getServerPath().resolve(openEsbFolder).resolve("OE-Instance");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package betsy.bpel.engines.openesb;

public class OpenEsb305StandaloneEngine extends OpenEsb301StandaloneEngine{

public OpenEsb305StandaloneEngine(){
super("OpenESB-SE-3.0.5", "OpenESB-SE-3.0.5-server-only.zip","openesb-oeadmin-1.0.2.jar");
}

@Override
public String getName() {
return "openesb305standalone";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
import betsy.bpel.engines.ode.Ode136InMemoryEngine;
import betsy.bpel.engines.ode.OdeEngine;
import betsy.bpel.engines.ode.OdeInMemoryEngine;
import betsy.bpel.engines.openesb.OpenEsb231Engine;
import betsy.bpel.engines.openesb.OpenEsb23Engine;
import betsy.bpel.engines.openesb.OpenEsb301StandaloneEngine;
import betsy.bpel.engines.openesb.OpenEsbEngine;
import betsy.bpel.engines.openesb.*;
import betsy.bpel.engines.orchestra.OrchestraEngine;
import betsy.bpel.engines.petalsesb.PetalsEsb41Engine;
import betsy.bpel.engines.petalsesb.PetalsEsbEngine;
Expand All @@ -37,7 +34,7 @@ public class BPELEngineRepository {
public BPELEngineRepository() {
List<AbstractBPELEngine> locals = Arrays.asList(
new OdeEngine(), new Ode136Engine(), new OdeInMemoryEngine(), new Ode136InMemoryEngine(),
new OpenEsbEngine(), new OpenEsb23Engine(), new OpenEsb231Engine(), new OpenEsb301StandaloneEngine(),
new OpenEsbEngine(), new OpenEsb23Engine(), new OpenEsb231Engine(), new OpenEsb301StandaloneEngine(), new OpenEsb305StandaloneEngine(),
new OrchestraEngine(),
new ActiveBpelEngine(),
new PetalsEsbEngine(), new PetalsEsb41Engine(),
Expand All @@ -47,7 +44,7 @@ public BPELEngineRepository() {
new BpelgEngine(),
new OrchestraEngine(),
new ActiveBpelEngine(),
new OpenEsb301StandaloneEngine(),
new OpenEsb305StandaloneEngine(),
new PetalsEsb41Engine(),
new Ode136Engine(),
new Wso2Engine_v3_2_0());
Expand Down

0 comments on commit 583f903

Please sign in to comment.