You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by pa...@apache.org on 2011/09/21 08:20:39 UTC

svn commit: r1173508 [2/2] - in /incubator/airavata/trunk/modules/ws-messenger: commons/src/main/java/org/apache/airavata/wsmg/commons/storage/ commons/src/main/java/org/apache/airavata/wsmg/commons/util/ messagebox/src/main/org/apache/airavata/wsmg/ms...

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java?rev=1173508&r1=1173507&r2=1173508&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java (original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java Wed Sep 21 06:20:38 2011
@@ -46,13 +46,11 @@ import javax.xml.stream.XMLStreamExcepti
 import org.apache.airavata.wsmg.broker.subscription.SubscriptionEntry;
 import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
 import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.config.ConfigurationManager;
 import org.apache.airavata.wsmg.commons.storage.DatabaseCreator.DatabaseType;
 import org.apache.airavata.wsmg.config.WSMGParameter;
 import org.apache.airavata.wsmg.util.Counter;
 import org.apache.airavata.wsmg.util.TimerThread;
 import org.apache.axiom.om.OMElement;
-import org.apache.axis2.AxisFault;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -67,13 +65,11 @@ public class WsmgPersistantStorage imple
 
     private String dbName = null;
 
-    public WsmgPersistantStorage(String ordinarySubsTblName, String specialSubsTblName, ConfigurationManager config)
-            throws AxisFault {
+    public WsmgPersistantStorage(String jdbcUrl, String jdbcDriver) {
 
-        this.dbName = ordinarySubsTblName;
+        this.dbName = WsmgCommonConstants.TABLE_NAME_EXPIRABLE_SUBCRIPTIONS;
 
-        db = new JdbcStorage(config.getConfig(WsmgCommonConstants.CONFIG_JDBC_URL),
-                config.getConfig(WsmgCommonConstants.CONFIG_JDBC_DRIVER));
+        db = new JdbcStorage(jdbcUrl, jdbcDriver);
 
         Connection conn = null;
         try {
@@ -90,10 +86,10 @@ public class WsmgPersistantStorage imple
 
             // inject dbname to sql statement.
             SubscriptionConstants.ORDINARY_SUBSCRIPTION_INSERT_QUERY = String.format(
-                    SubscriptionConstants.INSERT_SQL_QUERY, ordinarySubsTblName);
+                    SubscriptionConstants.INSERT_SQL_QUERY, WsmgCommonConstants.TABLE_NAME_EXPIRABLE_SUBCRIPTIONS);
 
             SubscriptionConstants.SPECIAL_SUBSCRIPTION_INSERT_QUERY = String.format(
-                    SubscriptionConstants.INSERT_SQL_QUERY, specialSubsTblName);
+                    SubscriptionConstants.INSERT_SQL_QUERY, WsmgCommonConstants.TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS);
 
             if (WSMGParameter.measureMessageRate) {
                 TimerThread timerThread = new TimerThread(storeToDBCounter, " StoreSubScriptionToDBCounter");
@@ -103,7 +99,7 @@ public class WsmgPersistantStorage imple
             initMessageQueueStorage();
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
-            throw AxisFault.makeFault(e);
+            throw new RuntimeException("Database failure");
         } finally {
             if (conn != null) {
                 db.closeConnection(conn);

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/resources/services.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/resources/services.xml?rev=1173508&r1=1173507&r2=1173508&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/resources/services.xml (original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/resources/services.xml Wed Sep 21 06:20:38 2011
@@ -19,140 +19,107 @@
  under the License.
 
 -->
-
 <serviceGroup>
-	<service name="EventingService" class="org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle">
-
-		<operation name="renew">
-			<messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-
-			<actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew
-			</actionMapping>
-			<outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse
-			</outputActionMapping>
-		</operation>
-
-		<operation name="getStatus">
-
-			<messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-
-			<actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus
-			</actionMapping>
-			<outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse
-			</outputActionMapping>
-		</operation>
-
-		<operation name="subscriptionEnd">
-
-			<messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-
-			<actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd
-			</actionMapping>
-		</operation>
-
-		<operation name="subscribe">
-
-			<messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-
-			<actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
-			</actionMapping>
-			<outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse
-			</outputActionMapping>
-		</operation>
-
-		<operation name="unsubscribe">
-
-			<messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-			<actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe
-			</actionMapping>
-
-			<outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse
-			</outputActionMapping>
-		</operation>
-
-		<operation name="publish">
-			<messageReceiver
-				class="org.apache.airavata.wsmg.broker.wseventing.WSEventingPublishMsgReceiver" />
-			<actionMapping>http://org.apache.airavata/WseNotification
-			</actionMapping>
-		</operation>
-
-	</service>
-
-	<service name="NotificationService" class="org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle">
-
-		<operation name="notify">
-			<messageReceiver
-				class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-
-			<actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/Notify
-			</actionMapping>
-			<outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/NotifyResponse
-			</outputActionMapping>
-		</operation>
-		<operation name="subscribe">
-
-			<messageReceiver
-				class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-
-			<actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequest
-			</actionMapping>
-			<outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequestResponse
-			</outputActionMapping>
-		</operation>
-
-		<operation name="getCurrentMessage">
-
-			<messageReceiver
-				class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-
-			<actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageRequest
-			</actionMapping>
-
-			<outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageResponse
-			</outputActionMapping>
-
-		</operation>
-		<operation name="pauseSubscription">
-
-			<messageReceiver
-				class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-
-			<actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubsriptionRequest
-			</actionMapping>
-
-			<outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubscriptionResponse
-			</outputActionMapping>
-
-		</operation>
-		<operation name="resumeSubscription">
-
-			<messageReceiver
-				class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-
-			<actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubsriptionRequest
-			</actionMapping>
-
-			<outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubscriptionResponse
-			</outputActionMapping>
-
-		</operation>
-
-		<operation name="unsubscribe">
-
-			<messageReceiver
-				class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+    <service name="EventingService" class="org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle">
 
-			<actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubsribeRequest
-			</actionMapping>
+        <operation name="renew">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew
+            </actionMapping>
+            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="getStatus">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus
+            </actionMapping>
+            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="subscriptionEnd">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd
+            </actionMapping>
+        </operation>
+
+        <operation name="subscribe">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
+            </actionMapping>
+            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="unsubscribe">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe
+            </actionMapping>
+            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="publish">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingPublishMsgReceiver" />
+            <actionMapping>http://org.apache.airavata/WseNotification
+            </actionMapping>
+        </operation>
+
+    </service>
+
+    <service name="NotificationService" class="org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle">
+
+        <operation name="notify">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/Notify
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/NotifyResponse
+            </outputActionMapping>
+        </operation>
+        
+        <operation name="subscribe">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequestResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="getCurrentMessage">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageResponse
+            </outputActionMapping>
+        </operation>
+        
+        <operation name="pauseSubscription">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubsriptionRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubscriptionResponse
+            </outputActionMapping>
+        </operation>
+        
+        <operation name="resumeSubscription">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubsriptionRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubscriptionResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="unsubscribe">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubsribeRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubscribeResponse
+            </outputActionMapping>
+        </operation>
 
-			<outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubscribeResponse
-			</outputActionMapping>
+    </service>
 
-		</operation>
+    <parameter name="configuration.file.name" locked="false">msgBroker.properties</parameter>
 
-	</service>
-	
-	 <parameter name="configuration.file.name" locked="false">msgBroker.properties</parameter>
-	  
 </serviceGroup>

Modified: incubator/airavata/trunk/modules/ws-messenger/messenger/src/main/java/org/apache/airavata/wsmg/messenger/MessengerServlet.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messenger/src/main/java/org/apache/airavata/wsmg/messenger/MessengerServlet.java?rev=1173508&r1=1173507&r2=1173508&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messenger/src/main/java/org/apache/airavata/wsmg/messenger/MessengerServlet.java (original)
+++ incubator/airavata/trunk/modules/ws-messenger/messenger/src/main/java/org/apache/airavata/wsmg/messenger/MessengerServlet.java Wed Sep 21 06:20:38 2011
@@ -40,12 +40,11 @@ import org.apache.airavata.wsmg.messenge
 import org.apache.airavata.wsmg.messenger.strategy.impl.ParallelSender;
 import org.apache.airavata.wsmg.messenger.strategy.impl.SerialSender;
 import org.apache.airavata.wsmg.util.RunTimeStatistics;
-import org.apache.axis2.AxisFault;
 import org.apache.log4j.Logger;
 
 public class MessengerServlet extends HttpServlet {
 
-    Logger logger = Logger.getLogger(MessengerServlet.class);
+    private static final Logger logger = Logger.getLogger(MessengerServlet.class);
 
     private static final long serialVersionUID = -7175511030332798604L;
 
@@ -143,15 +142,8 @@ public class MessengerServlet extends Ht
             throw new RuntimeException("invalid storage type specified: " + type);
         }
 
-        try {
-            WSMGParameter.OUT_GOING_QUEUE = new WsmgPersistantStorage(
-                    WsmgCommonConstants.TABLE_NAME_EXPIRABLE_SUBCRIPTIONS,
-                    WsmgCommonConstants.TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS, configMan);
-
-        } catch (AxisFault af) {
-            logger.fatal("failed to initialize storage", af);
-            throw new RuntimeException("unable to initialize storage", af);
-        }
-
+        String jdbcUrl = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_URL);
+        String jdbcDriver = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_DRIVER);
+        WSMGParameter.OUT_GOING_QUEUE = new WsmgPersistantStorage(jdbcUrl, jdbcDriver);
     }
 }