Package org.apache.uima.aae.error

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


      } 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


        invokeProcess(cas, casReferenceId, null, aMessageContext, newCASProducedBy);
      }
    } catch (AsynchAEException e) {
      throw e;
    } catch (Exception e) {
      throw new AsynchAEException(e);
    }

  }
View Full Code Here

      }

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

  }
View Full Code Here

                "BaseAnalysisEngineController",
                UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                "UIMAEE_incompatible_version_WARNING",
                new Object[] { getComponentName(), uimaAsVersion.getVersionString(),
                    UIMAFramework.getVersionString() });
        throw new ResourceInitializationException(new AsynchAEException(
                "Version of UIMA-AS is Incompatible with a Version of UIMA Core. UIMA-AS Version:"
                        + uimaAsVersion.getVersionString() + " Core UIMA Version:"
                        + UIMAFramework.getVersionString()));
      }
      logPlatformInfo(getComponentName());
View Full Code Here

          key = aDelegateEndpointName;
        }
      }

      if (key == null) {
        throw new AsynchAEException(getName() + "-Unable to look up delegate "
                + aDelegateEndpointName + " in internal map");
      }
      UimaContextAdmin uctx = getUimaContextAdmin();

      // retrieve the sofa mappings for input/output sofas of this analysis engine
View Full Code Here

    return errorContext;
  }

  public void validate(Object anObjectToHandle) throws AsynchAEException {
    if (anObjectToHandle == null) {
      throw new AsynchAEException("Nothing to Handle - Input Object is Null");
    }
    if (!(anObjectToHandle instanceof MessageContext)) {
      throw new AsynchAEException(
              "Invalid Object in Handler. Expected MessageContext Instead Got::"
                      + anObjectToHandle.getClass().getName());
    }
  }
View Full Code Here

        }
      } else if (controller instanceof PrimitiveAnalysisEngineController) {
        ((PrimitiveAnalysisEngineController) controller).process(aCAS, anInputCasReferenceId,
                aMessageContext.getEndpoint());
      } else {
        throw new AsynchAEException(
                "Invalid Controller. Expected AggregateController or PrimitiveController. Got:"
                        + controller.getClass().getName());
      }
    } catch (AsynchAEException e) {
      throw e;
    } catch (Exception e) {
      throw new AsynchAEException(e);
    }

  }
View Full Code Here

      delegateKey = ((AggregateAnalysisEngineController) getController())
              .lookUpDelegateKey(aMessageContext.getEndpoint().getEndpoint());
      CacheEntry entry = getController().getInProcessCache().getCacheEntryForCAS(aCasReferenceId);
      if (entry == null) {
        throw new AsynchAEException("CasReferenceId:" + aCasReferenceId
                + " Not Found in the Cache.");
      }
      CacheEntry inputCasEntry = null;
      String inputCasReferenceId = entry.getInputCasReferenceId();
      ServicePerformance casStats = ((AggregateAnalysisEngineController) getController())
              .getCasStatistics(aCasReferenceId);
      if (inputCasReferenceId != null
              && getController().getInProcessCache().entryExists(inputCasReferenceId)) {
        String casProducerKey = entry.getCasProducerKey();
        if (casProducerKey != null
                && ((AggregateAnalysisEngineController) getController())
                        .isDelegateKeyValid(casProducerKey)) {
          // Get entry for the input CAS
          inputCasEntry = getController().getInProcessCache().getCacheEntryForCAS(
                  inputCasReferenceId);
        }

      }
      ServicePerformance delegateServicePerformance = ((AggregateAnalysisEngineController) getController())
              .getServicePerformance(delegateKey);

      if (aMessageContext.propertyExists(AsynchAEMessage.TimeToSerializeCAS)) {
        long timeToSerializeCAS = ((Long) aMessageContext
                .getMessageLongProperty(AsynchAEMessage.TimeToSerializeCAS)).longValue();
        if (timeToSerializeCAS > 0) {
          if (delegateServicePerformance != null) {
            delegateServicePerformance.incrementCasSerializationTime(timeToSerializeCAS);
          }
        }
      }
      if (aMessageContext.propertyExists(AsynchAEMessage.TimeToDeserializeCAS)) {
        long timeToDeserializeCAS = ((Long) aMessageContext
                .getMessageLongProperty(AsynchAEMessage.TimeToDeserializeCAS)).longValue();
        if (timeToDeserializeCAS > 0) {
          if (delegateServicePerformance != null) {
            delegateServicePerformance.incrementCasDeserializationTime(timeToDeserializeCAS);
          }
        }
      }

      if (aMessageContext.propertyExists(AsynchAEMessage.IdleTime)) {
        long idleTime = ((Long) aMessageContext.getMessageLongProperty(AsynchAEMessage.IdleTime))
                .longValue();
        if (idleTime > 0 && delegateServicePerformance != null) {
          Endpoint endp = aMessageContext.getEndpoint();
          if (endp != null && endp.isRemote()) {
            delegateServicePerformance.incrementIdleTime(idleTime);
          }
        }
      }

      if (aMessageContext.propertyExists(AsynchAEMessage.TimeWaitingForCAS)) {
        long timeWaitingForCAS = ((Long) aMessageContext
                .getMessageLongProperty(AsynchAEMessage.TimeWaitingForCAS)).longValue();
        if (timeWaitingForCAS > 0 && aMessageContext.getEndpoint().isRemote()) {
          entry.incrementTimeWaitingForCAS(timeWaitingForCAS);
          delegateServicePerformance.incrementCasPoolWaitTime(timeWaitingForCAS
                  - delegateServicePerformance.getRawCasPoolWaitTime());
          if (inputCasEntry != null) {
            inputCasEntry.incrementTimeWaitingForCAS(timeWaitingForCAS);
          }
        }
      }
      if (aMessageContext.propertyExists(AsynchAEMessage.TimeInProcessCAS)) {
        long timeInProcessCAS = ((Long) aMessageContext
                .getMessageLongProperty(AsynchAEMessage.TimeInProcessCAS)).longValue();
        Endpoint endp = aMessageContext.getEndpoint();
        if (endp != null && endp.isRemote()) {
          if (delegateServicePerformance != null) {
            // calculate the time spent in analysis. The remote service returns total time
            // spent in the analysis. Compute the delta.
            long dt = timeInProcessCAS - delegateServicePerformance.getRawAnalysisTime();
            // increment total time in analysis
            delegateServicePerformance.incrementAnalysisTime(dt);
            getController().getServicePerformance().incrementAnalysisTime(dt);
          }
        } else {
          getController().getServicePerformance().incrementAnalysisTime(timeInProcessCAS);
        }
        casStats.incrementAnalysisTime(timeInProcessCAS);

        if (inputCasReferenceId != null) {
          ServicePerformance inputCasStats = ((AggregateAnalysisEngineController) getController())
                  .getCasStatistics(inputCasReferenceId);
          // Update processing time for this CAS
          if (inputCasStats != null) {
            inputCasStats.incrementAnalysisTime(timeInProcessCAS);
          }
        }

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

  public synchronized CacheEntry getCacheEntryForCAS(String aCasReferenceId)
          throws AsynchAEException {
    CacheEntry casRefEntry = getEntry(aCasReferenceId);
    if (casRefEntry == null) {
      throw new AsynchAEException("Cas Not Found In CasManager Cache. CasReferenceId::"
              + aCasReferenceId + " is Invalid");
    }
    return casRefEntry;
  }
View Full Code Here

              "initialize",
              UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
              "UIMAEE_incompatible_version_WARNING",
              new Object[] { "UIMA AS Client", UimaAsVersion.getUimajFullVersionString(),
                UimaVersion.getFullVersionString() });
      throw new ResourceInitializationException(new AsynchAEException(
              "Version of UIMA-AS is Incompatible with a Version of UIMA Core. UIMA-AS Version is built to depend on Core UIMA version:"
                      + UimaAsVersion.getUimajFullVersionString() + " but is running with version:"
                      + UimaVersion.getFullVersionString()));
    }
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.