You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2011/10/20 19:43:47 UTC
svn commit: r1186961 - in /uima/uima-as/trunk/uimaj-as-jms/src/main:
java/org/apache/uima/adapter/jms/client/ resources/
Author: cwiklik
Date: Thu Oct 20 17:43:47 2011
New Revision: 1186961
URL: http://svn.apache.org/viewvc?rev=1186961&view=rev
Log:
UIMA-2239 fixed log messages
Modified:
uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseMessageSender.java
uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties
Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseMessageSender.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseMessageSender.java?rev=1186961&r1=1186960&r2=1186961&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseMessageSender.java (original)
+++ uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseMessageSender.java Thu Oct 20 17:43:47 2011
@@ -38,6 +38,7 @@ import org.apache.uima.aae.message.UimaM
import org.apache.uima.adapter.jms.JmsConstants;
import org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngineCommon_impl.ClientRequest;
import org.apache.uima.adapter.jms.message.PendingMessage;
+import org.apache.uima.cas.CAS;
import org.apache.uima.jms.error.handler.BrokerConnectionException;
import org.apache.uima.util.Level;
import org.apache.uima.util.impl.ProcessTrace_impl;
@@ -309,7 +310,9 @@ public abstract class BaseMessageSender
cacheEntry = (ClientRequest) engine.getCache().get(
pm.get(AsynchAEMessage.CasReference));
if (cacheEntry != null) {
- // Use Process Timeout value for the time-to-live property in the
+ CAS cas = cacheEntry.getCAS();
+
+ // Use Process Timeout value for the time-to-live property in the
// outgoing JMS message. When this time is exceeded
// while the message sits in a queue, the JMS Server will remove it from
// the queue. What happens with the expired message depends on the
@@ -329,13 +332,49 @@ public abstract class BaseMessageSender
UimaASProcessStatus status = new UimaASProcessStatusImpl(new ProcessTrace_impl(),cacheEntry.getCAS(),
cacheEntry.getCasReferenceId());
// Notify engine before sending a message
+ if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
+ UIMAFramework.getLogger(CLASS_NAME).logrb(
+ Level.FINE,
+ CLASS_NAME.getName(),
+ "run",
+ JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
+ "UIMAJMS_calling_onBeforeMessageSend__FINE",
+ new Object[] {
+ pm.get(AsynchAEMessage.CasReference),
+ String.valueOf(cas.hashCode())
+ });
+ }
engine.onBeforeMessageSend(status);
- }
+ } else {
+ if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
+ UIMAFramework.getLogger(CLASS_NAME).logrb(
+ Level.WARNING,
+ CLASS_NAME.getName(),
+ "run",
+ JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
+ "UIMAJMS_failed_cache_lookup__WARNING",
+ new Object[] {
+ pm.get(AsynchAEMessage.CasReference),
+ UimaMessageValidator.decodeIntToString(AsynchAEMessage.Command, message
+ .getIntProperty(AsynchAEMessage.Command)),
+ UimaMessageValidator.decodeIntToString(AsynchAEMessage.MessageType, message
+ .getIntProperty(AsynchAEMessage.MessageType)), destination });
+ }
+ }
+
}
// start timers
if( casProcessRequest ) {
+ CAS cas = cacheEntry.getCAS();
// Add the cas to a list of CASes pending reply. Also start the timer if necessary
engine.serviceDelegate.addCasToOutstandingList(cacheEntry.getCasReferenceId());
+ if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(),
+ "sendCAS", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
+ "UIMAJMS_cas_added_to_pending_FINE", new Object[] { cacheEntry.getCasReferenceId(), String.valueOf(cas.hashCode()), engine.serviceDelegate.toString()});
+ }
+
+
} else if ( pm.getMessageType() == AsynchAEMessage.GetMeta &&
engine.serviceDelegate.getGetMetaTimeout() > 0 ) {
// timer for PING has been started in sendCAS()
Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java?rev=1186961&r1=1186960&r2=1186961&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java (original)
+++ uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java Thu Oct 20 17:43:47 2011
@@ -1283,6 +1283,11 @@ public abstract class BaseUIMAAsynchrono
// Store the total latency for this CAS. The departure time is set right before the CAS
// is sent to a service.
cachedRequest.setTimeWaitingForReply(System.nanoTime() - cachedRequest.getCASDepartureTime());
+ if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(),
+ "handleProcessReply", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
+ "UIMAJMS_cas_reply_rcvd_FINE", new Object[] { casReferenceId, String.valueOf(cachedRequest.getCAS().hashCode())});
+ }
// If the CAS was sent from a synchronous API sendAndReceive(), wake up the thread that
// sent the CAS and process the reply
@@ -1882,7 +1887,7 @@ public abstract class BaseUIMAAsynchrono
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
"sendAndReceiveCAS", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
- "UIMAJMS_client_interrupted_INFO", new Object[] { casReferenceId, aCAS.hashCode()});
+ "UIMAJMS_client_interrupted_INFO", new Object[] { casReferenceId, String.valueOf(aCAS.hashCode())});
}
// cancel the timer if it is associated with a CAS this thread is waiting for. This would be
// the oldest CAS submitted to a queue for processing. The timer will be canceled and restarted
@@ -1894,6 +1899,12 @@ public abstract class BaseUIMAAsynchrono
try {
// send CAS. This call does not block. Instead we will block the sending thread below.
casReferenceId = sendCAS(aCAS, cachedRequest);
+ if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
+ "sendAndReceiveCAS", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
+ "UIMAJMS_cas_submitted_FINE", new Object[] { casReferenceId, String.valueOf(aCAS.hashCode()), Thread.currentThread().getName()});
+ }
+
} catch( ResourceProcessException e) {
threadMonitor.getMonitor().release();
throw e;
Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties?rev=1186961&r1=1186960&r2=1186961&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties (original)
+++ uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties Thu Oct 20 17:43:47 2011
@@ -213,11 +213,11 @@ UIMAJMS_caught_signal__INFO= Uima AS Ser
UIMAJMS_listener_added_after_initialize__WARNING = UIMA AS Already Initialized - Attempt to Add Callback Listener Failed. Add Callback Listener Before calling initialize().
UIMAJMS_client_interrupted_INFO= UIMA AS Client Thread Interrupted While Waiting For a Reply. CAS: {0} CasHashCode: {1}
UIMAJMS_failed_cache_lookup__WARNING= UIMA AS Client Failed Cache Look Up For CAS: {0} Command:{1} Message:{2} Destination:{3}
-UIMAJMS_calling_onBeforeMessageSend__INFO= UIMA AS Client Calling onBeforeMessageSend - CAS:{0} CasHashCode:{1}
+UIMAJMS_calling_onBeforeMessageSend__FINE= UIMA AS Client Calling onBeforeMessageSend - CAS:{0} CasHashCode:{1}
UIMAJMS_completed_onBeforeMessageSend__INFO= UIMA AS Client Completed onBeforeMessageSend - CAS:{0} CasHashCode:{1}
UIMAJMS_cas_dispatched__INFO= \t>>>>>>> UIMA AS Client Delivered CAS: {0} HashCode:{1} to Endpoint:{2}
-UIMAJMS_cas_reply_rcvd_INFO = \t<<<<<<< UIMA AS Client Received Reply For CAS:{0} Hashcode:{1}
-UIMAJMS_cas_added_to_pending_INFO = UIMA AS Dispatch Thread Added CAS:{0} Hashcode:{1} To Outstanding List. Current List:\n\n{2}\n\n
+UIMAJMS_cas_reply_rcvd_FINE = \t<<<<<<< UIMA AS Client Received Reply For CAS:{0} Hashcode:{1}
+UIMAJMS_cas_added_to_pending_FINE = UIMA AS Dispatch Thread Added CAS:{0} Hashcode:{1} To Outstanding List. Current List:\n\n{2}\n\n
UIMAJMS_cas_submitted_FINE=UIMA AS sendAndReceive Received CAS:{0} HashCode:{1} For Processing - Forwarding to sendCAS() on Thread:{2}
UIMAJMS_calling_onBeforeProcessCAS_INFO = UIMA AS Client Calling onBeforeMessageProcess For CAS:{0} Hashcode:{1}
UIMAJMS_completed_onBeforeProcessCAS_INFO = UIMA AS Client Completed onBeforeMessageProcess For CAS:{0} Hashcode:{1}