uima-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r708925 - in /incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq: JmsInputChannel.java UimaDefaultMessageListenerContainer.java
Date Wed, 29 Oct 2008 15:52:28 GMT
Author: eae
Date: Wed Oct 29 08:52:26 2008
New Revision: 708925

URL: http://svn.apache.org/viewvc?rev=708925&view=rev
Log:
UIMA-1191 apply core and activemq patch files

Modified:
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsInputChannel.java
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsInputChannel.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsInputChannel.java?rev=708925&r1=708924&r2=708925&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsInputChannel.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsInputChannel.java
Wed Oct 29 08:52:26 2008
@@ -869,17 +869,25 @@
     }
     return null;
   }
-  public void destroyListener( String anEndpointName, String aDelegateKey ) {
+  public synchronized void destroyListener( String anEndpointName, String aDelegateKey )
{
     final UimaDefaultMessageListenerContainer mListener = 
       getListenerForEndpoint(anEndpointName);
     if ( mListener == null ) {
       System.out.println("--- Listener For Endpoint: "+aDelegateKey+" Not Found");
       return;
     }
+    if ( !mListener.isRunning() ) {
+      return; // Already Stopped
+    }
     
     try {
-//      if ( messageListener.getDestination().toString().equals( anEndpointName)) {
+        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO) && mListener.getDestination()
!= null) {
+          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
+                    "destroyListener", JmsConstants.JMS_LOG_RESOURCE_BUNDLE, "UIMAJMS_stop_listener__INFO",
+                    new Object[] { mListener.getDestination().toString() });
+        }
         System.out.println("++++ Stopping Listener ...");
+        mListener.closeConnection();
         mListener.stop();
         System.out.println("++++ Destroying Listener ...");
         new Thread() {
@@ -888,7 +896,12 @@
           }
         };
         while( mListener.isRunning());      
-        System.out.println("++++ Listener on Queue:"+anEndpointName+" Has Been Stopped...");
+        System.out.println("Thread:"+Thread.currentThread().getId()+"++++ Listener on Queue:"+anEndpointName+"
Has Been Stopped...");
+        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO) && mListener.getDestination()
!= null) {
+          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
+                    "destroyListener", JmsConstants.JMS_LOG_RESOURCE_BUNDLE, "UIMAJMS_stopped_listener_INFO",
+                    new Object[] {controller.getComponentName(), mListener.getDestination().toString()
});
+        }
         Endpoint endpoint = ((AggregateAnalysisEngineController)getController()).lookUpEndpoint(aDelegateKey,
false);
         endpoint.setStatus(Endpoint.FAILED);
         if ( mListener.getConnectionFactory() != null) {
@@ -896,7 +909,6 @@
             if ( !failedListenerMap.containsKey(aDelegateKey )) {
               failedListenerMap.put( aDelegateKey, mListener);
               listenerContainerList.remove(mListener);
-              System.out.println("++++ Saving Connection Factory");
             }
           }
         }

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java?rev=708925&r1=708924&r2=708925&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java
Wed Oct 29 08:52:26 2008
@@ -369,6 +369,7 @@
 		try
 		{
 			setRecoveryInterval(0);
+			setAcceptMessagesWhileStopping(false);
 			setAutoStartup(false);
 			getSharedConnection().close();
 		}



Mime
View raw message