Examples of UimaASPingTimeout


Examples of org.apache.uima.aae.error.UimaASPingTimeout

        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_meta_timeout_INFO", new Object[] { anEndpoint });
        }
        status.addEventStatus("Ping", "Failed", new UimaASPingTimeout());
        notifyListeners(null, status, AsynchAEMessage.Ping);
        // The main thread could be stuck waiting for a CAS. Grab any CAS in the
        // client cache and release it so that we can shutdown.
        if (!clientCache.isEmpty()) {
          ClientRequest anyCasRequest = clientCache.elements().nextElement();
          if (anyCasRequest.getCAS() != null) {
            anyCasRequest.getCAS().release();
          }
        }
        abort = true;
        break;
      case (CpCTimeout):
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_cpc_timeout_INFO", new Object[] { anEndpoint });
        }
        status.addEventStatus("CpC", "Failed", new UimaASCollectionProcessCompleteTimeout());
        // release the semaphore acquired in collectionProcessingComplete()
        cpcReplySemaphore.release();
        notifyListeners(null, status, AsynchAEMessage.CollectionProcessComplete);
        break;

      case (ProcessTimeout):
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_process_timeout_INFO", new Object[] { anEndpoint });
        }
        ClientRequest cachedRequest = (ClientRequest) clientCache.get(casReferenceId);
        if (cachedRequest == null) {
          if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
            // if missing for any reason ...
            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                    "handleProcessReply", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                    "UIMAJMS_received_expired_msg_INFO",
                    new Object[] { anEndpoint, casReferenceId });
          }
          return;
        }
        // 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());

        // mark timeout exception
        cachedRequest.setTimeoutException();

        if (cachedRequest.isSynchronousInvocation()) {
          // Signal a thread that we received a reply, if in the map
          if (threadMonitorMap.containsKey(cachedRequest.getThreadId())) {
            ThreadMonitor threadMonitor = (ThreadMonitor) threadMonitorMap.get(cachedRequest
                    .getThreadId());
            // Unblock the sending thread so that it can complete processing with an error
            if (threadMonitor != null) {
              threadMonitor.getMonitor().release();
              cachedRequest.setReceivedProcessCasReply(); // should not be needed
            }
          }
        } else {
          // notify the application listener with the error
          if ( serviceDelegate.isPingTimeout()) {
            exc = new UimaASProcessCasTimeout(new UimaASPingTimeout());
            serviceDelegate.resetPingTimeout();
          } else {
            exc = new UimaASProcessCasTimeout();
          }
          status.addEventStatus("Process", "Failed", exc);
View Full Code Here

Examples of org.apache.uima.aae.error.UimaASPingTimeout

        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_meta_timeout_WARNING", new Object[] { anEndpoint });
        }
        status.addEventStatus("Ping", "Failed", new UimaASPingTimeout("UIMA AS Client Timed Out Waiting For Ping Reply From a Service On Queue:"+anEndpoint));
        notifyListeners(null, status, AsynchAEMessage.Ping);
        // The main thread could be stuck waiting for a CAS. Grab any CAS in the
        // client cache and release it so that we can shutdown.
        if (!clientCache.isEmpty()) {
          ClientRequest anyCasRequest = clientCache.elements().nextElement();
          if (anyCasRequest.getCAS() != null) {
            anyCasRequest.getCAS().release();
          }
        }
        abort = true;
        break;
      case (CpCTimeout):
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_cpc_timeout_INFO", new Object[] { anEndpoint });
        }
        status.addEventStatus("CpC", "Failed",
                new UimaASCollectionProcessCompleteTimeout("UIMA AS Client Timed Out Waiting For CPC Reply From a Service On Queue:"+anEndpoint));
        // release the semaphore acquired in collectionProcessingComplete()
        cpcReplySemaphore.release();
        notifyListeners(null, status, AsynchAEMessage.CollectionProcessComplete);
        break;

      case (ProcessTimeout):
        if ( casReferenceId != null ) {
              ClientRequest cachedRequest = (ClientRequest) clientCache.get(casReferenceId);
              if (cachedRequest != null) {
                if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
                  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                        "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                        "UIMAJMS_process_timeout_WARNING", new Object[] { anEndpoint, getBrokerURI(), cachedRequest.getHostIpProcessingCAS() });
                }
              } else {
                if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
                  // if missing for any reason ...
                  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                          "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                          "UIMAJMS_received_expired_msg_INFO",
                          new Object[] { anEndpoint, casReferenceId });
                }
                return;
              }
              // 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());

              // mark timeout exception
              cachedRequest.setTimeoutException();

              if (cachedRequest.isSynchronousInvocation()) {
                // Signal a thread that we received a reply, if in the map
                if (threadMonitorMap.containsKey(cachedRequest.getThreadId())) {
                  ThreadMonitor threadMonitor = (ThreadMonitor) threadMonitorMap.get(cachedRequest
                          .getThreadId());
                  // Unblock the sending thread so that it can complete processing with an error
                  if (threadMonitor != null) {
                    threadMonitor.getMonitor().release();
                    cachedRequest.setReceivedProcessCasReply(); // should not be needed
                  }
                }
              } else {
                // notify the application listener with the error
                if ( serviceDelegate.isPingTimeout()) {
                  exc = new UimaASProcessCasTimeout(new UimaASPingTimeout("UIMA AS Client Ping Time While Waiting For Reply From a Service On Queue:"+anEndpoint));
                  serviceDelegate.resetPingTimeout();
                } else {
                  exc = new UimaASProcessCasTimeout("UIMA AS Client Timed Out Waiting For CAS:"+casReferenceId+ " Reply From a Service On Queue:"+anEndpoint);
                }
                status.addEventStatus("Process", "Failed", exc);
View Full Code Here

Examples of org.apache.uima.aae.error.UimaASPingTimeout

        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_meta_timeout_WARNING", new Object[] { anEndpoint });
        }
        status.addEventStatus("Ping", "Failed", new UimaASPingTimeout("UIMA AS Client Timed Out Waiting For Ping Reply From a Service On Queue:"+anEndpoint));
        notifyListeners(null, status, AsynchAEMessage.Ping);
        // The main thread could be stuck waiting for a CAS. Grab any CAS in the
        // client cache and release it so that we can shutdown.
        if (!clientCache.isEmpty()) {
          ClientRequest anyCasRequest = clientCache.elements().nextElement();
          if (anyCasRequest.getCAS() != null) {
            anyCasRequest.getCAS().release();
          }
        }
        abort = true;
        break;
      case (CpCTimeout):
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_cpc_timeout_INFO", new Object[] { anEndpoint });
        }
        status.addEventStatus("CpC", "Failed",
                new UimaASCollectionProcessCompleteTimeout("UIMA AS Client Timed Out Waiting For CPC Reply From a Service On Queue:"+anEndpoint));
        // release the semaphore acquired in collectionProcessingComplete()
        cpcReplySemaphore.release();
        notifyListeners(null, status, AsynchAEMessage.CollectionProcessComplete);
        break;

      case (ProcessTimeout):
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_process_timeout_WARNING", new Object[] { anEndpoint });
        }
        ClientRequest cachedRequest = (ClientRequest) clientCache.get(casReferenceId);
        if (cachedRequest == null) {
          if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
            // if missing for any reason ...
            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                    "handleProcessReply", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                    "UIMAJMS_received_expired_msg_INFO",
                    new Object[] { anEndpoint, casReferenceId });
          }
          return;
        }
        // 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());

        // mark timeout exception
        cachedRequest.setTimeoutException();

        if (cachedRequest.isSynchronousInvocation()) {
          // Signal a thread that we received a reply, if in the map
          if (threadMonitorMap.containsKey(cachedRequest.getThreadId())) {
            ThreadMonitor threadMonitor = (ThreadMonitor) threadMonitorMap.get(cachedRequest
                    .getThreadId());
            // Unblock the sending thread so that it can complete processing with an error
            if (threadMonitor != null) {
              threadMonitor.getMonitor().release();
              cachedRequest.setReceivedProcessCasReply(); // should not be needed
            }
          }
        } else {
          // notify the application listener with the error
          if ( serviceDelegate.isPingTimeout()) {
            exc = new UimaASProcessCasTimeout(new UimaASPingTimeout("UIMA AS Client Ping Time While Waiting For Reply From a Service On Queue:"+anEndpoint));
            serviceDelegate.resetPingTimeout();
          } else {
            exc = new UimaASProcessCasTimeout("UIMA AS Client Timed Out Waiting For CAS:"+casReferenceId+ " Reply From a Service On Queue:"+anEndpoint);
          }
          status.addEventStatus("Process", "Failed", exc);
View Full Code Here

Examples of org.apache.uima.aae.error.UimaASPingTimeout

        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_meta_timeout_WARNING", new Object[] { anEndpoint });
        }
        status.addEventStatus("Ping", "Failed", new UimaASPingTimeout("UIMA AS Client Timed Out Waiting For Ping Reply From a Service On Queue:"+anEndpoint));
        notifyListeners(null, status, AsynchAEMessage.Ping);
        // The main thread could be stuck waiting for a CAS. Grab any CAS in the
        // client cache and release it so that we can shutdown.
        if (!clientCache.isEmpty()) {
          ClientRequest anyCasRequest = clientCache.elements().nextElement();
          if (anyCasRequest.getCAS() != null) {
            anyCasRequest.getCAS().release();
          }
        }
        abort = true;
        break;
      case (CpCTimeout):
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_cpc_timeout_INFO", new Object[] { anEndpoint });
        }
        status.addEventStatus("CpC", "Failed",
                new UimaASCollectionProcessCompleteTimeout("UIMA AS Client Timed Out Waiting For CPC Reply From a Service On Queue:"+anEndpoint));
        // release the semaphore acquired in collectionProcessingComplete()
        cpcReplySemaphore.release();
        notifyListeners(null, status, AsynchAEMessage.CollectionProcessComplete);
        break;

      case (ProcessTimeout):
        if ( casReferenceId != null ) {
              ClientRequest cachedRequest = (ClientRequest) clientCache.get(casReferenceId);
              if (cachedRequest != null) {
                if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
                  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                        "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                        "UIMAJMS_process_timeout_WARNING", new Object[] { anEndpoint, getBrokerURI(), cachedRequest.getHostIpProcessingCAS() });
                }
              } else {
                if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
                  // if missing for any reason ...
                  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                          "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                          "UIMAJMS_received_expired_msg_INFO",
                          new Object[] { anEndpoint, casReferenceId });
                }
                return;
              }
              // 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());

              // mark timeout exception
              cachedRequest.setTimeoutException();

              if (cachedRequest.isSynchronousInvocation()) {
                // Signal a thread that we received a reply, if in the map
                if (threadMonitorMap.containsKey(cachedRequest.getThreadId())) {
                  ThreadMonitor threadMonitor = (ThreadMonitor) threadMonitorMap.get(cachedRequest
                          .getThreadId());
                  // Unblock the sending thread so that it can complete processing with an error
                  if (threadMonitor != null) {
                    threadMonitor.getMonitor().release();
                    cachedRequest.setReceivedProcessCasReply(); // should not be needed
                  }
                }
              } else {
                // notify the application listener with the error
                if ( serviceDelegate.isPingTimeout()) {
                  exc = new UimaASProcessCasTimeout(new UimaASPingTimeout("UIMA AS Client Ping Time While Waiting For Reply From a Service On Queue:"+anEndpoint));
                  serviceDelegate.resetPingTimeout();
                } else {
                  exc = new UimaASProcessCasTimeout("UIMA AS Client Timed Out Waiting For CAS:"+casReferenceId+ " Reply From a Service On Queue:"+anEndpoint);
                }
                status.addEventStatus("Process", "Failed", exc);
View Full Code Here

Examples of org.apache.uima.aae.error.UimaASPingTimeout

        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_meta_timeout_WARNING", new Object[] { anEndpoint });
        }
        status.addEventStatus("Ping", "Failed", new UimaASPingTimeout("UIMA AS Client Timed Out Waiting For Ping Reply From a Service On Queue:"+anEndpoint));
        notifyListeners(null, status, AsynchAEMessage.Ping);
        // The main thread could be stuck waiting for a CAS. Grab any CAS in the
        // client cache and release it so that we can shutdown.
        if (!clientCache.isEmpty()) {
          ClientRequest anyCasRequest = clientCache.elements().nextElement();
          if (anyCasRequest.getCAS() != null) {
            anyCasRequest.getCAS().release();
          }
        }
        abort = true;
        break;
      case (CpCTimeout):
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_cpc_timeout_INFO", new Object[] { anEndpoint });
        }
        status.addEventStatus("CpC", "Failed",
                new UimaASCollectionProcessCompleteTimeout("UIMA AS Client Timed Out Waiting For CPC Reply From a Service On Queue:"+anEndpoint));
        // release the semaphore acquired in collectionProcessingComplete()
        cpcReplySemaphore.release();
        notifyListeners(null, status, AsynchAEMessage.CollectionProcessComplete);
        break;

      case (ProcessTimeout):
        if ( casReferenceId != null ) {
              ClientRequest cachedRequest = (ClientRequest) clientCache.get(casReferenceId);
              if (cachedRequest != null) {
                if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
                  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                        "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                        "UIMAJMS_process_timeout_WARNING", new Object[] { anEndpoint, getBrokerURI(), cachedRequest.getHostIpProcessingCAS() });
                }
              } else {
                if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
                  // if missing for any reason ...
                  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                          "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                          "UIMAJMS_received_expired_msg_INFO",
                          new Object[] { anEndpoint, casReferenceId });
                }
                return;
              }
              // 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());

              // mark timeout exception
              cachedRequest.setTimeoutException();

              if (cachedRequest.isSynchronousInvocation()) {
                // Signal a thread that we received a reply, if in the map
                if (threadMonitorMap.containsKey(cachedRequest.getThreadId())) {
                  ThreadMonitor threadMonitor = (ThreadMonitor) threadMonitorMap.get(cachedRequest
                          .getThreadId());
                  // Unblock the sending thread so that it can complete processing with an error
                  if (threadMonitor != null) {
                    threadMonitor.getMonitor().release();
                    cachedRequest.setReceivedProcessCasReply(); // should not be needed
                  }
                }
              } else {
                // notify the application listener with the error
                if ( serviceDelegate.isPingTimeout()) {
                  exc = new UimaASProcessCasTimeout(new UimaASPingTimeout("UIMA AS Client Ping Time While Waiting For Reply From a Service On Queue:"+anEndpoint));
                  serviceDelegate.resetPingTimeout();
                } else {
                  exc = new UimaASProcessCasTimeout("UIMA AS Client Timed Out Waiting For CAS:"+casReferenceId+ " Reply From a Service On Queue:"+anEndpoint);
                }
                status.addEventStatus("Process", "Failed", exc);
View Full Code Here

Examples of org.apache.uima.aae.error.UimaASPingTimeout

                                "handleError", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                                "UIMAJMS_client_reject_by_forced_timeout__WARNING", new Object[] { de.getCasReferenceId(), String.valueOf(cachedRequest.getCAS().hashCode())});
                      }
                      //dumpDelayedList();
                      try {
                        clientUimaAsEngine.handleException(new UimaASProcessCasTimeout("Service Not Responding to Ping - CAS:"+de.getCasReferenceId(), new UimaASPingTimeout("Forced Timeout on CAS in PendingDispatch list. The CAS Has Not Been Dispatched since the Service Appears to be Unavailable")), de.getCasReferenceId(), null,cachedRequest, !cachedRequest.isSynchronousInvocation(), false);
                      } catch( Exception ex) {
                        ex.printStackTrace();
                      }
                    }
                    if ( clientUimaAsEngine.running ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.