Package org.apache.uima.aae.error

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


                "handleProcessResponseFromRemote", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                "UIMAEE_number_parallel_delegates_FINE",
                new Object[] { totalNumberOfParallelDelegatesProcessingCas, Thread.currentThread().getId(), Thread.currentThread().getName() });
      }
      if (cas == null) {
        throw new AsynchAEException(Thread.currentThread().getName()
                + "-Cache Does not contain a CAS. Cas Reference Id::" + casReferenceId);
      }
      if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(),
                "handleProcessResponseFromRemote", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
View Full Code Here


                  UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAEE_cas_not_in_cache__INFO",
                  new Object[] { getController().getName(), casReferenceId,
                      aMessageContext.getEndpoint().getEndpoint() });
        }
        throw new AsynchAEException("CAS with Reference Id:" + casReferenceId
                + " Not Found in CasManager's CAS Cache");
      }
    } catch (Exception e) {

      ErrorContext errorContext = new ErrorContext();
View Full Code Here

      } else if (AsynchAEMessage.None == payload && AsynchAEMessage.Ping == command) {
        handlePingReply(messageContext);
      } else if (AsynchAEMessage.None == payload && AsynchAEMessage.ServiceInfo == command) {
        handleServiceInfoReply(messageContext);
      } else {
        throw new AsynchAEException("Invalid Payload. Expected XMI or CasReferenceId Instead Got::"
                + payload);
      }

      // Handled Request to Process with A given Payload
      return;
View Full Code Here

    if (connectionMap.containsKey(brokerConnectionURL)) {
      brokerConnectionEntry = (BrokerConnectionEntry) connectionMap.get(brokerConnectionURL);
      // Findbugs thinks that the above may return null, perhaps due to a race condition. Add
      // the null check just in case
      if (brokerConnectionEntry == null) {
        throw new AsynchAEException("Controller:"
                + getAnalysisEngineController().getComponentName()
                + " Unable to Lookup Broker Connection For URL:" + brokerConnectionURL);
      }
      brokerConnectionEntry.setBrokerURL(brokerConnectionURL);
      if ( JmsEndpointConnection_impl.connectionClosedOrFailed(brokerConnectionEntry) ) {
        invalidateConnectionAndEndpoints(brokerConnectionEntry);
        brokerConnectionEntry = createConnectionEntry(brokerConnectionURL);
      }
    } else {
      brokerConnectionEntry = createConnectionEntry(brokerConnectionURL);
    }
    String key = getLookupKey(anEndpoint);
    String destination = getDestinationName(anEndpoint);
    if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
      UIMAFramework.getLogger(CLASS_NAME).logrb(
              Level.FINE,
              CLASS_NAME.getName(),
              "getEndpointConnection",
              JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
              "UIMAJMS_acquiring_connection_to_endpoint__FINE",
              new Object[] { getAnalysisEngineController().getComponentName(), destination,
                brokerConnectionURL });
    }

    // check the cache first
    if (!brokerConnectionEntry.endpointExists(key)) {
      if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
        UIMAFramework.getLogger(CLASS_NAME).logrb(
                Level.FINE,
                CLASS_NAME.getName(),
                "getEndpointConnection",
                JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                "UIMAJMS_create_new_connection__FINE",
                new Object[] { getAnalysisEngineController().getComponentName(), destination,
                  brokerConnectionURL });
      }
     
      Endpoint masterEndpoint = null;
      if ( getAnalysisEngineController() instanceof AggregateAnalysisEngineController ) {
        //  Check if the endpoint has previously FAILED. It may have been marked as FAILED
        //  due to a temp queue listener shutdown caused by a Broker failure. In such case,
        //  before sending a message to a remote delegate we need to start a new instance
        //  of a listener which creates a new temp reply queue.
        if ( !anEndpoint.isReplyEndpoint() ) {  // this just means that we are not sending reply to a client
          //  The masterEndoint has the most current state. The 'anEndpoint' instance passed into
          //  this method is a clone from the master made at the begining of processing. The master endpoint
          //  may have been marked as FAILED after the clone was made
          masterEndpoint = ((AggregateAnalysisEngineController) getAnalysisEngineController()).
                    lookUpEndpoint(anEndpoint.getDelegateKey(),false);
          if ( masterEndpoint != null ) {
            //  Only one thread at a time is allowed here.
            synchronized( masterEndpoint ) {
              if ( masterEndpoint.getStatus() == Endpoint.FAILED ) {
                //  Returns InputChannel if the Reply Listener for the delegate has previously failed.
                //  If the listener hasnt failed the getReplyInputChannel returns null
                InputChannel iC = getAnalysisEngineController().getReplyInputChannel(anEndpoint.getDelegateKey());
                if ( iC != null ) {
                  try {
                    // Create a new Listener, new Temp Queue and associate the listener with the Input Channel
                  // Also resets endpoint status to OK 
                    iC.createListener(anEndpoint.getDelegateKey(), anEndpoint);
                    iC.removeDelegateFromFailedList(masterEndpoint.getDelegateKey());
                  } catch( Exception exx) {
                    throw new AsynchAEException(exx);
                  }
                } else{
                  throw new AsynchAEException("Aggregate:"+getAnalysisEngineController()+" Has not yet recovered a listener for delegate: "+anEndpoint.getDelegateKey());
                }
              } else if ( !masterEndpoint.isFreeCasEndpoint() ) {
                //  In case this thread blocked while the reply queue listener was created, make sure
                //  that this endpoint uses the most up-date reply queue destination
                anEndpoint.setDestination(masterEndpoint.getDestination());
View Full Code Here

    } catch (AsynchAEException e) {
      throw e;
    }

    catch (Exception e) {
      throw new AsynchAEException(e);
    }

  }
View Full Code Here

                    new Object[] { getAnalysisEngineController().getComponentName(),
                        anEndpoint.getEndpoint() });
          }
        } catch (JMSException e) {
          if ( notifyOnJmsException ) {
            throw new AsynchAEException(e);
          }
          // Unable to establish connection to the endpoint. Log it and continue
          if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                    "sendReply", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                    "UIMAEE_service_exception_WARNING", getAnalysisEngineController().getComponentName());

            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(), "sendReply",
                    JmsConstants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_exception__WARNING",
                   e);
          }
        }

        catch (ServiceShutdownException e) {
          if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
           
            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                    "sendReply", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                    "UIMAEE_service_exception_WARNING", getAnalysisEngineController().getComponentName());

            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                    "sendReply", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                    "UIMAJMS_exception__WARNING", e);
          }
        }

        catch (AsynchAEException e) {
          throw e;
        } catch (Exception e) {
          throw new AsynchAEException(e);
        }

  }
View Full Code Here

        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(), "sendReply",
                JmsConstants.JMS_LOG_RESOURCE_BUNDLE, "UIMAJMS_unable_to_connect__INFO",
                new Object[] { getAnalysisEngineController().getName(), anEndpoint.getEndpoint() });
      }
    } catch (Exception e) {
      throw new AsynchAEException(e);
    }
  }
View Full Code Here

        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                "sendReply", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                "UIMAJMS_exception__WARNING", e);
      }
      throw new AsynchAEException(e);
    } finally {
      try {
        bos.close();
      } catch (Exception e) {
      }
View Full Code Here

      casStats.incrementCasSerializationTime(timeToSerializeCas);
      getAnalysisEngineController().getServicePerformance().incrementCasSerializationTime(
              timeToSerializeCas);
      return serializedCAS;
    } catch (Exception e) {
      throw new AsynchAEException(e);
    }

  }
View Full Code Here

                  serializedCAS);
        }
      }
      return serializedCAS;
    } catch (Exception e) {
      throw new AsynchAEException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.aae.error.AsynchAEException

Copyright © 2018 www.massapicom. 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.