Repository: airavata Updated Branches: refs/heads/master bf0f8efc8 -> 02aa95bd0
fixing an issue with passive mode Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/92442cc6 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/92442cc6 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/92442cc6 Branch: refs/heads/master Commit: 92442cc648dfefbc8285866f939b0b9e2a3b6c0b Parents: 73da33a Author: Lahiru Gunathilake <[email protected]> Authored: Fri Apr 24 13:39:46 2015 -0400 Committer: Lahiru Gunathilake <[email protected]> Committed: Fri Apr 24 13:39:46 2015 -0400 ---------------------------------------------------------------------- .../server/OrchestratorServerHandler.java | 51 +++++++++----------- 1 file changed, 22 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/92442cc6/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java index 63ab7da..88e1533 100644 --- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java +++ b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java @@ -134,37 +134,30 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface, // setGatewayName(ServerSettings.getDefaultUserGateway()); setAiravataUserName(ServerSettings.getDefaultUser()); - try { - zk = new ZooKeeper(zkhostPort, AiravataZKUtils.getZKTimeout(), this); // no watcher is - // required, this - // will only use to - // store some data - String OrchServer = ServerSettings - .getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_ORCHESTRATOR_SERVER_NODE); - synchronized (mutex) { - mutex.wait(); // waiting for the syncConnected event + if(!ServerSettings.isGFacPassiveMode()) { + try { + zk = new ZooKeeper(zkhostPort, AiravataZKUtils.getZKTimeout(), this); // no watcher is + // required, this + // will only use to + // store some data + String OrchServer = ServerSettings + .getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_ORCHESTRATOR_SERVER_NODE); + synchronized (mutex) { + mutex.wait(); // waiting for the syncConnected event + } + registerOrchestratorService(airavataServerHostPort, OrchServer); + // creating a watch in orchestrator to monitor the gfac + // instances + zk.getChildren(ServerSettings.getSetting( + Constants.ZOOKEEPER_GFAC_SERVER_NODE, "/gfac-server"), + this); + log.info("Finished starting ZK: " + zk); + } catch (IOException|InterruptedException|KeeperException e) { + log.error(e.getMessage(), e); + throw new OrchestratorException("Error while initializing orchestrator service, Error in Zookeeper", e); } - registerOrchestratorService(airavataServerHostPort, OrchServer); - // creating a watch in orchestrator to monitor the gfac - // instances - zk.getChildren(ServerSettings.getSetting( - Constants.ZOOKEEPER_GFAC_SERVER_NODE, "/gfac-server"), - this); - log.info("Finished starting ZK: " + zk); - } catch (IOException e) { - log.error(e.getMessage(), e); - throw new OrchestratorException("Error while initializing orchestrator service", e); - } catch (InterruptedException e) { - log.error(e.getMessage(), e); - throw new OrchestratorException("Error while initializing orchestrator service", e); - } catch (KeeperException e) { - log.error(e.getMessage(), e); - throw new OrchestratorException("Error while initializing orchestrator service", e); } - } catch (ApplicationSettingsException e) { - log.error(e.getMessage(), e); - throw new OrchestratorException("Error while initializing orchestrator service", e); - }catch (AiravataException e) { + } catch (AiravataException e) { log.error(e.getMessage(), e); throw new OrchestratorException("Error while initializing orchestrator service", e); }
