You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2017/04/05 19:10:37 UTC
[13/50] [abbrv] airavata git commit: Moving db event service starup
logic after server start
Moving db event service starup logic after server start
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/5808332f
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/5808332f
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/5808332f
Branch: refs/heads/develop
Commit: 5808332f3a3e3051a9e91451690d3e4ac5558f3b
Parents: c14db59
Author: Ajinkya Dhamnaskar <ad...@umail.iu.edu>
Authored: Mon Apr 3 16:10:08 2017 -0400
Committer: Ajinkya Dhamnaskar <ad...@umail.iu.edu>
Committed: Mon Apr 3 16:10:08 2017 -0400
----------------------------------------------------------------------
.../registry/server/SharingRegistryServer.java | 26 +++++++++++---------
1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/5808332f/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
index 94e1661..7b707f1 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
@@ -87,18 +87,6 @@ public class SharingRegistryServer implements IServer {
new Thread() {
public void run() {
server.serve();
- try {
- logger.info("Register sharing service with DB Event publishers");
- SharingServiceDBEventMessagingFactory.registerSharingServiceWithPublishers(Constants.PUBLISHERS);
-
-
- logger.info("Start sharing service DB Event subscriber");
- SharingServiceDBEventMessagingFactory.getDBEventSubscriber();
- } catch (AiravataException e) {
- e.printStackTrace();
- } catch (SharingRegistryException e) {
- e.printStackTrace();
- }
setStatus(IServer.ServerStatus.STOPPED);
logger.info("Sharing Registry Server Stopped.");
}
@@ -113,6 +101,20 @@ public class SharingRegistryServer implements IServer {
}
}
if (server.isServing()) {
+
+ try {
+
+ logger.info("Register sharing service with DB Event publishers");
+ SharingServiceDBEventMessagingFactory.registerSharingServiceWithPublishers(Constants.PUBLISHERS);
+
+ logger.info("Start sharing service DB Event subscriber");
+ SharingServiceDBEventMessagingFactory.getDBEventSubscriber();
+
+ } catch (AiravataException | SharingRegistryException e) {
+ logger.error("Error starting sharing service. Error setting up DB event services.");
+ server.stop();
+ }
+
setStatus(IServer.ServerStatus.STARTED);
logger.info("Starting Sharing Registry Server on Port " + serverPort);
logger.info("Listening to Sharing Registry server clients ....");