Examples of CasProcessorDeployer


Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

              container.getName(), String.valueOf(container.getStatus()));
        }
        ProcessTrace pTrTemp = new ProcessTrace_impl(cpm.getPerformanceTuningSettings());
        pTrTemp.startEvent(container.getName(), "End of Batch", "");
        try {
          CasProcessorDeployer deployer = container.getDeployer();

          if (deployer != null) {
            if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
              logFinest("UIMA_CPM_undeploy_cp_instances__FINEST", container.getName(), deployer.getClass().getName());
            }
            deployer.undeploy();
          }
          container.destroy();
        } catch (Exception e) {

          logWarning("UIMA_CPM_exception_during_cp_stop__WARNING", container.getName(), e.getMessage());
View Full Code Here

Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

  private void deployConsumers() throws AbortCPMException {

    if (consumerDeployList == null || consumerDeployList.size() == 0) {
      return;
    }
    CasProcessorDeployer deployer = null;
    // Deploy each CASProcessor in a seperate container
    for (int i = consumerDeployList.size(); i > 0; i--) {
      try {
        // Deployer deploys as many instances of CASProcessors as there are threads
        List cpList = (ArrayList) consumerDeployList.get((i - 1)); // list is zero-based
        String name = ((CasProcessor) cpList.get(0)).getProcessingResourceMetaData().getName();
        if (cpList.size() > 0) {
          //
          // Get a deployer for this type of CasProcessor. The type of deployer is determined from
          // the
          // CPE Configuration. Specifically from the deployment model for this CasProcessor.
          //  
          CpeCasProcessor casProcessorType = (CpeCasProcessor) cpeFactory.casProcessorConfigMap
                  .get(name);
          deployer = DeployFactory.getDeployer(cpeFactory, casProcessorType, pca);
          // Deploy CasConsumer.
          ProcessingContainer container = deployer.deployCasProcessor(cpList, false);
          consumerList.add(container);
        }
      } catch (Exception e) {
        e.printStackTrace();
        throw new AbortCPMException(e.getMessage());
View Full Code Here

Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

    if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
      UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
              "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_deploying_cp__FINEST",
              new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName() });
    }
    CasProcessorDeployer deployer = aProcessingContainer.getDeployer();
    deployer.deployCasProcessor(aProcessingContainer);
  }
View Full Code Here

Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

    if (checkpointData != null) {
      // Restore CPM related stats from the checkppoint
      restoreFromCheckpoint("CPM", "CPM PROCESSING TIME");
    }

    CasProcessorDeployer deployer = null;
    // Deploy each CASProcessor in a seperate container
    for (int i = 0; i < annotatorDeployList.size(); i++) {
      try {
        // Deployer deploys as many instances of CASProcessors as there are threads
        List cpList = (ArrayList) annotatorDeployList.get(i);
        String name = ((CasProcessor) cpList.get(0)).getProcessingResourceMetaData().getName();
        if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
          UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
                  "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                  "UIMA_CPM_deploying_new_cp__CONFIG",
                  new Object[] { Thread.currentThread().getName(), name });
        }
        if (cpList.size() > 0) {

          //
          // Get a deployer for this type of CasProcessor. The type of deployer is determined from
          // the
          // CPE Configuration. Specifically from the deployment model for this CasProcessor. The
          // first
          //  
          if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
            UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
                    "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_lookup_cp__FINEST",
                    new Object[] { Thread.currentThread().getName(), name });
          }
          if (!cpeFactory.casProcessorConfigMap.containsKey(name)) {
            if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
              UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
                      this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_invalid_processor_configuration__SEVERE",
                      new Object[] { Thread.currentThread().getName(), name });
            }
            throw new Exception(CpmLocalizedMessage.getLocalizedMessage(
                    CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_cp__WARNING",
                    new Object[] { Thread.currentThread().getName(), name }));
          }
          CpeCasProcessor casProcessorCPEConfig = (CpeCasProcessor) cpeFactory.casProcessorConfigMap
                  .get(name);
          if (casProcessorCPEConfig == null) {
            if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {

              UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
                      this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_cp_configuration_not_defined__SEVERE",
                      new Object[] { Thread.currentThread().getName(), name });
            }
            throw new Exception(CpmLocalizedMessage.getLocalizedMessage(
                    CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_cp__WARNING",
                    new Object[] { Thread.currentThread().getName(), name }));
          } else if (casProcessorCPEConfig.getDeployment() == null
                  || casProcessorCPEConfig.getDeployment().trim().length() == 0) {
            if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
              UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
                      this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_cp_deployment_mode_not_defined__SEVERE",
                      new Object[] { Thread.currentThread().getName(), name });
            }
            throw new Exception(CpmLocalizedMessage.getLocalizedMessage(
                    CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                    "UIMA_CPM_Exception_invalid_deployment__WARNING", new Object[] {
                        Thread.currentThread().getName(), name,
                        casProcessorCPEConfig.getDeployment() }));
          }

          deployer = DeployFactory.getDeployer(cpeFactory, casProcessorCPEConfig, pca);
          // Deploy CasConsumer.
          ProcessingContainer container = deployer.deployCasProcessor(cpList, false);
          annotatorList.add(container);
        }
      } catch (Exception e) {
        UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
                "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
View Full Code Here

Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

        if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
          UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
                  "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_stop_container__FINEST",
                  new Object[] { Thread.currentThread().getName(), container.getName() });
        }
        CasProcessorDeployer deployer = container.getDeployer();
        if (deployer != null)
          deployer.undeploy();
        container.destroy();
      }
    }
    // Destroy Cas Consumers
    for (int i = 0; consumerList != null && i < consumerList.size(); i++) {
View Full Code Here

Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

                      String.valueOf(container.getStatus()) });
        }
        ProcessTrace pTrTemp = new ProcessTrace_impl(cpm.getPerformanceTuningSettings());
        pTrTemp.startEvent(container.getName(), "End of Batch", "");
        try {
          CasProcessorDeployer deployer = container.getDeployer();

          if (deployer != null) {
            if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
              UIMAFramework.getLogger(this.getClass()).logrb(
                      Level.FINEST,
                      this.getClass().getName(),
                      "process",
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_undeploy_cp_instances__FINEST",
                      new Object[] { Thread.currentThread().getName(), container.getName(),
                          deployer.getClass().getName() });
            }
            deployer.undeploy();
          }
          container.destroy();
        } catch (Exception e) {
          e.printStackTrace();
        } finally {
View Full Code Here

Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

                      String.valueOf(container.getStatus()) });
        }
        ProcessTrace pTrTemp = new ProcessTrace_impl(cpm.getPerformanceTuningSettings());
        pTrTemp.startEvent(container.getName(), "End of Batch", "");
        try {
          CasProcessorDeployer deployer = container.getDeployer();

          if (deployer != null) {
            if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
              UIMAFramework.getLogger(this.getClass()).logrb(
                      Level.FINEST,
                      this.getClass().getName(),
                      "process",
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_undeploy_cp_instances__FINEST",
                      new Object[] { Thread.currentThread().getName(), container.getName(),
                          deployer.getClass().getName() });
            }
            deployer.undeploy();
          }
          container.destroy();
        } catch (Exception e) {
          e.printStackTrace();
        } finally {
View Full Code Here

Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

  private void deployConsumers() throws AbortCPMException {

    if (consumerDeployList == null || consumerDeployList.size() == 0) {
      return;
    }
    CasProcessorDeployer deployer = null;
    // Deploy each CASProcessor in a seperate container
    for (int i = consumerDeployList.size(); i > 0; i--) {
      try {
        // Deployer deploys as many instances of CASProcessors as there are threads
        List cpList = (ArrayList) consumerDeployList.get((i - 1)); // list is zero-based
        String name = ((CasProcessor) cpList.get(0)).getProcessingResourceMetaData().getName();
        if (cpList.size() > 0) {
          //
          // Get a deployer for this type of CasProcessor. The type of deployer is determined from
          // the
          // CPE Configuration. Specifically from the deployment model for this CasProcessor.
          //  
          CpeCasProcessor casProcessorType = (CpeCasProcessor) cpeFactory.casProcessorConfigMap
                  .get(name);
          deployer = DeployFactory.getDeployer(cpeFactory, casProcessorType, pca);
          // Deploy CasConsumer.
          ProcessingContainer container = deployer.deployCasProcessor(cpList, false);
          consumerList.add(container);
        }
      } catch (Exception e) {
        e.printStackTrace();
        throw new AbortCPMException(e.getMessage());
View Full Code Here

Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

    if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
      UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
              "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_deploying_cp__FINEST",
              new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName() });
    }
    CasProcessorDeployer deployer = aProcessingContainer.getDeployer();
    deployer.deployCasProcessor(aProcessingContainer);
  }
View Full Code Here

Examples of org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer

    if (checkpointData != null) {
      // Restore CPM related stats from the checkppoint
      restoreFromCheckpoint("CPM", "CPM PROCESSING TIME");
    }

    CasProcessorDeployer deployer = null;
    // Deploy each CASProcessor in a seperate container
    for (int i = 0; i < annotatorDeployList.size(); i++) {
      try {
        // Deployer deploys as many instances of CASProcessors as there are threads
        List cpList = (ArrayList) annotatorDeployList.get(i);
        String name = ((CasProcessor) cpList.get(0)).getProcessingResourceMetaData().getName();
        if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
          UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
                  "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                  "UIMA_CPM_deploying_new_cp__CONFIG",
                  new Object[] { Thread.currentThread().getName(), name });
        }
        if (cpList.size() > 0) {

          //
          // Get a deployer for this type of CasProcessor. The type of deployer is determined from
          // the
          // CPE Configuration. Specifically from the deployment model for this CasProcessor. The
          // first
          //  
          if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
            UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
                    "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_lookup_cp__FINEST",
                    new Object[] { Thread.currentThread().getName(), name });
          }
          if (!cpeFactory.casProcessorConfigMap.containsKey(name)) {
            if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
              UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
                      this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_invalid_processor_configuration__SEVERE",
                      new Object[] { Thread.currentThread().getName(), name });
            }
            throw new Exception(CpmLocalizedMessage.getLocalizedMessage(
                    CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_cp__WARNING",
                    new Object[] { Thread.currentThread().getName(), name }));
          }
          CpeCasProcessor casProcessorCPEConfig = (CpeCasProcessor) cpeFactory.casProcessorConfigMap
                  .get(name);
          if (casProcessorCPEConfig == null) {
            if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {

              UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
                      this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_cp_configuration_not_defined__SEVERE",
                      new Object[] { Thread.currentThread().getName(), name });
            }
            throw new Exception(CpmLocalizedMessage.getLocalizedMessage(
                    CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_cp__WARNING",
                    new Object[] { Thread.currentThread().getName(), name }));
          } else if (casProcessorCPEConfig.getDeployment() == null
                  || casProcessorCPEConfig.getDeployment().trim().length() == 0) {
            if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
              UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
                      this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_cp_deployment_mode_not_defined__SEVERE",
                      new Object[] { Thread.currentThread().getName(), name });
            }
            throw new Exception(CpmLocalizedMessage.getLocalizedMessage(
                    CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                    "UIMA_CPM_Exception_invalid_deployment__WARNING", new Object[] {
                        Thread.currentThread().getName(), name,
                        casProcessorCPEConfig.getDeployment() }));
          }

          deployer = DeployFactory.getDeployer(cpeFactory, casProcessorCPEConfig, pca);
          // Deploy CasConsumer.
          ProcessingContainer container = deployer.deployCasProcessor(cpList, false);
          annotatorList.add(container);
        }
      } catch (Exception e) {
        UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
                "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
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.