Package org.apache.uima.collection.metadata

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


      throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
          "errorHandling", "casProcessor" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
              CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
              new Object[] { Thread.currentThread().getName(), name, "<errorHandling>" })));
    }
    CasProcessorMaxRestarts maxRestarts = casProcessorErrorHandling.getMaxConsecutiveRestarts();
    if (maxRestarts == null) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
                  "maxConsecutiveRestarts", "CPE" }, new Exception(CpmLocalizedMessage
                      .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                              "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                                  Thread.currentThread().getName(), name,
                                  "<maxConsecutiveRestarts>" })));
    }
    maxRetryThreshold = maxRestarts.getRestartCount();
    waitTimeBetweenRestarts = maxRestarts.getWaitTimeBetweenRetries();

    maxRestartThreshold = maxRestarts.getRestartCount();

    if (!validActionOnError(maxRestarts.getAction())) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
                  "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
                      new Object[] { Thread.currentThread().getName(), name,
                          "<maxConsecutiveRestarts>", maxRestarts.getAction() })));
    }
    actionOnMaxRestarts = maxRestarts.getAction();

    // Setup Error rate Threshold in terms of (count)/(sample size) eg. 3/1000
    CasProcessorErrorRateThreshold errorRateThresholdType = casProcessorErrorHandling
            .getErrorRateThreshold();
    if (errorRateThresholdType == null) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
                  "errorRateThreshold", "CPE" },
              new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                          Thread.currentThread().getName(), name, "<errorRateThreshold>" })));
    }

    errorRate = errorRateThresholdType.getMaxErrorCount();
    errorSampleSize = errorRateThresholdType.getMaxErrorSampleSize();

    if (!validActionOnError(errorRateThresholdType.getAction())) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
                  "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
                      new Object[] { Thread.currentThread().getName(), name,
                          "<errorRateThreshold>", maxRestarts.getAction() })));

    }
    actionOnMaxError = errorRateThresholdType.getAction();

    CasProcessorTimeout timeoutType = casProcessorErrorHandling.getTimeout();
View Full Code Here


      setCasProcessorFilter(filter);
    }
    if (getErrorHandling() == null) {
      CasProcessorErrorHandling errorHandling = CpeDescriptorFactory
              .produceCasProcessorErrorHandling();
      CasProcessorMaxRestarts maxRestart = CpeDescriptorFactory.produceCasProcessorMaxRestarts();
      maxRestart.setRestartCount(30);
      maxRestart.setAction("terminate");
      errorHandling.setMaxConsecutiveRestarts(maxRestart);
      CasProcessorTimeout timeout = CpeDescriptorFactory.produceCasProcessorTimeout();
      timeout.set(100000);
      errorHandling.setTimeout(timeout);
      CasProcessorErrorRateThreshold errorThreshold = CpeDescriptorFactory
View Full Code Here

      throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
          "errorHandling", "casProcessor" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
              CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
              new Object[] { Thread.currentThread().getName(), name, "<errorHandling>" })));
    }
    CasProcessorMaxRestarts maxRestarts = casProcessorErrorHandling.getMaxConsecutiveRestarts();
    if (maxRestarts == null) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
                  "maxConsecutiveRestarts", "CPE" }, new Exception(CpmLocalizedMessage
                      .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                              "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                                  Thread.currentThread().getName(), name,
                                  "<maxConsecutiveRestarts>" })));
    }
    maxRetryThreshold = maxRestarts.getRestartCount();
    waitTimeBetweenRestarts = maxRestarts.getWaitTimeBetweenRetries();

    maxRestartThreshold = maxRestarts.getRestartCount();

    if (!validActionOnError(maxRestarts.getAction())) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
                  "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
                      new Object[] { Thread.currentThread().getName(), name,
                          "<maxConsecutiveRestarts>", maxRestarts.getAction() })));
    }
    actionOnMaxRestarts = maxRestarts.getAction();

    // Setup Error rate Threshold in terms of (count)/(sample size) eg. 3/1000
    CasProcessorErrorRateThreshold errorRateThresholdType = casProcessorErrorHandling
            .getErrorRateThreshold();
    if (errorRateThresholdType == null) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
                  "errorRateThreshold", "CPE" },
              new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                          Thread.currentThread().getName(), name, "<errorRateThreshold>" })));
    }

    errorRate = errorRateThresholdType.getMaxErrorCount();
    errorSampleSize = errorRateThresholdType.getMaxErrorSampleSize();

    if (!validActionOnError(errorRateThresholdType.getAction())) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
                  "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
                      new Object[] { Thread.currentThread().getName(), name,
                          "<errorRateThreshold>", maxRestarts.getAction() })));

    }
    actionOnMaxError = errorRateThresholdType.getAction();

    CasProcessorTimeout timeoutType = casProcessorErrorHandling.getTimeout();
View Full Code Here

      setCasProcessorFilter(filter);
    }
    if (getErrorHandling() == null) {
      CasProcessorErrorHandling errorHandling = CpeDescriptorFactory
              .produceCasProcessorErrorHandling();
      CasProcessorMaxRestarts maxRestart = CpeDescriptorFactory.produceCasProcessorMaxRestarts();
      maxRestart.setRestartCount(30);
      maxRestart.setAction("terminate");
      errorHandling.setMaxConsecutiveRestarts(maxRestart);
      CasProcessorTimeout timeout = CpeDescriptorFactory.produceCasProcessorTimeout();
      timeout.set(100000);
      errorHandling.setTimeout(timeout);
      CasProcessorErrorRateThreshold errorThreshold = CpeDescriptorFactory
View Full Code Here

      throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
          "errorHandling", "casProcessor" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
              CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
              new Object[] { Thread.currentThread().getName(), name, "<errorHandling>" })));
    }
    CasProcessorMaxRestarts maxRestarts = casProcessorErrorHandling.getMaxConsecutiveRestarts();
    if (maxRestarts == null) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
                  "maxConsecutiveRestarts", "CPE" }, new Exception(CpmLocalizedMessage
                      .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                              "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                                  Thread.currentThread().getName(), name,
                                  "<maxConsecutiveRestarts>" })));
    }
    maxRetryThreshold = maxRestarts.getRestartCount();
    waitTimeBetweenRestarts = maxRestarts.getWaitTimeBetweenRetries();

    maxRestartThreshold = maxRestarts.getRestartCount();

    if (!validActionOnError(maxRestarts.getAction())) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
                  "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
                      new Object[] { Thread.currentThread().getName(), name,
                          "<maxConsecutiveRestarts>", maxRestarts.getAction() })));
    }
    actionOnMaxRestarts = maxRestarts.getAction();

    // Setup Error rate Threshold in terms of (count)/(sample size) eg. 3/1000
    CasProcessorErrorRateThreshold errorRateThresholdType = casProcessorErrorHandling
            .getErrorRateThreshold();
    if (errorRateThresholdType == null) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
                  "errorRateThreshold", "CPE" },
              new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                          Thread.currentThread().getName(), name, "<errorRateThreshold>" })));
    }

    errorRate = errorRateThresholdType.getMaxErrorCount();
    errorSampleSize = errorRateThresholdType.getMaxErrorSampleSize();

    if (!validActionOnError(errorRateThresholdType.getAction())) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
                  "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
                      new Object[] { Thread.currentThread().getName(), name,
                          "<errorRateThreshold>", maxRestarts.getAction() })));

    }
    actionOnMaxError = errorRateThresholdType.getAction();

    CasProcessorTimeout timeoutType = casProcessorErrorHandling.getTimeout();
View Full Code Here

      setCasProcessorFilter(filter);
    }
    if (getErrorHandling() == null) {
      CasProcessorErrorHandling errorHandling = CpeDescriptorFactory
              .produceCasProcessorErrorHandling();
      CasProcessorMaxRestarts maxRestart = CpeDescriptorFactory.produceCasProcessorMaxRestarts();
      maxRestart.setRestartCount(30);
      maxRestart.setAction("terminate");
      errorHandling.setMaxConsecutiveRestarts(maxRestart);
      CasProcessorTimeout timeout = CpeDescriptorFactory.produceCasProcessorTimeout();
      timeout.set(100000);
      errorHandling.setTimeout(timeout);
      CasProcessorErrorRateThreshold errorThreshold = CpeDescriptorFactory
View Full Code Here

      setCasProcessorFilter(filter);
    }
    if (getErrorHandling() == null) {
      CasProcessorErrorHandling errorHandling = CpeDescriptorFactory
              .produceCasProcessorErrorHandling();
      CasProcessorMaxRestarts maxRestart = CpeDescriptorFactory.produceCasProcessorMaxRestarts();
      maxRestart.setRestartCount(30);
      maxRestart.setAction("terminate");
      errorHandling.setMaxConsecutiveRestarts(maxRestart);
      CasProcessorTimeout timeout = CpeDescriptorFactory.produceCasProcessorTimeout();
      timeout.set(100000);
      errorHandling.setTimeout(timeout);
      CasProcessorErrorRateThreshold errorThreshold = CpeDescriptorFactory
View Full Code Here

TOP

Related Classes of org.apache.uima.collection.metadata.CasProcessorMaxRestarts

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.