Examples of CasProcessorErrorHandling


Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

   *
   * @param aAction -
   *          action string
   */
  public void setActionOnMaxError(String aAction) {
    CasProcessorErrorHandling eh = getErrorHandling();
    if (eh != null && eh.getErrorRateThreshold() != null) {
      eh.getErrorRateThreshold().setAction(aAction);
    }
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

   * Return action associated with CasProcessor error tolerance.
   *
   * @return - action as string ( terminate, continue, disable), null when not defined
   */
  public String getActionOnMaxError() {
    CasProcessorErrorHandling eh = getErrorHandling();
    if (eh != null && eh.getErrorRateThreshold() != null) {
      return eh.getErrorRateThreshold().getAction();
    }
    return null;
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

   *
   * @param aAction -
   *          action string
   */
  public void setActionOnMaxRestart(String aAction) {
    CasProcessorErrorHandling eh = getErrorHandling();
    if (eh != null && eh.getMaxConsecutiveRestarts() != null) {
      eh.getMaxConsecutiveRestarts().setAction(aAction);
    }
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

   * Return action associated with CasProcessor restart tolerance.
   *
   * @return - action as string ( terminate, continue, disable), null when not defined
   */
  public String getActionOnMaxRestart() {
    CasProcessorErrorHandling eh = getErrorHandling();
    if (eh != null && eh.getMaxConsecutiveRestarts() != null) {
      return eh.getMaxConsecutiveRestarts().getAction();
    }
    return null;
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

   *
   * @param aRestartCount -
   *          max number of restarts
   */
  public void setMaxRestartCount(int aRestartCount) {
    CasProcessorErrorHandling eh = getErrorHandling();
    if (eh != null && eh.getMaxConsecutiveRestarts() != null) {
      eh.getMaxConsecutiveRestarts().setRestartCount(aRestartCount);
    }
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

   * Returns max restart tolerance for this CasProcessor.
   *
   * @return - restart count as int, 0 if not defined
   */
  public int getMaxRestartCount() {
    CasProcessorErrorHandling eh = getErrorHandling();
    if (eh != null && eh.getMaxConsecutiveRestarts() != null) {
      return eh.getMaxConsecutiveRestarts().getRestartCount();
    }
    return 0;
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

   *
   * @param aTimeoutValue -
   *          millis to wait for response
   */
  public void setTimeout(int aTimeoutValue) {
    CasProcessorErrorHandling eh = getErrorHandling();
    if (eh != null && eh.getTimeout() != null) {
      eh.getTimeout().set(aTimeoutValue);
    }
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

   * Returns max millis to wait for CasProcessor response
   *
   * @return - millis, 0 if not defined
   */
  public int getTimeout() {
    CasProcessorErrorHandling eh = getErrorHandling();
    if (eh != null && eh.getTimeout() != null) {
      return eh.getTimeout().get();
    }

    return 0;
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

     * @return
     * @return boolean
     */
    public boolean compareWithCpeDefaultErrorHandling (CasProcessorErrorHandling errorHandling)
    {
        CasProcessorErrorHandling def = null;
        if (defaultCasProcessorSettings != null) {
            def = defaultCasProcessorSettings.getErrorHandling();
        }
        if (def == null) {
            // Use CPE's default value
            def = cpeDefaultErrorHandling;
        }
        if (def != null) {
            if (!compareWithDefaultCasProcessorErrorRateThreshold(errorHandling.getErrorRateThreshold(),
                    def.getErrorRateThreshold())) {
                return false;
            }
           
            if (!compareWithDefaultCasProcessorMaxRestarts(errorHandling.getMaxConsecutiveRestarts(),
                    def.getMaxConsecutiveRestarts())) {
                return false;
            }
           
            if (errorHandling.getTimeout().get() != def.getTimeout().get()) {
                return false;
            }
        } else {
            Trace.bug("Cannot get CpeDefaultErrorHandling");
            return false;
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorErrorHandling

*/       
        aContentHandler.startElement(getXmlizationInfo().namespace,
                "", "errorHandling", attrs);   
       
        attrs.clear();
        CasProcessorErrorHandling errorHandling = getDefaultCasProcessorSettings().getErrorHandling();
        if (errorHandling != null) {
           
            attrs.addAttribute("","action","action",null,errorHandling.getErrorRateThreshold().getAction());
            attrs.addAttribute("","count","count",null, ""+errorHandling.getErrorRateThreshold().getMaxErrorCount());
            attrs.addAttribute("","sample_size","sample_size",null, ""+errorHandling.getErrorRateThreshold().getMaxErrorSampleSize());
            aContentHandler.startElement(getXmlizationInfo().namespace,
                    "", "errorRateThreshold", attrs);       
            aContentHandler.endElement(getXmlizationInfo().namespace, "","errorRateThreshold");
        }
        aContentHandler.endElement(getXmlizationInfo().namespace,
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.