Examples of CasProcessor


Examples of org.apache.uima.collection.base_cpm.CasProcessor

        UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
                "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_redeploying_cp__FINEST",
                new Object[] { Thread.currentThread().getName(), name });
      }
      URL descriptorUrl = casProcessorConfig.getDescriptorUrl();
      CasProcessor casProcessor = produceIntegratedCasProcessor(descriptorUrl);
      casProcessorPool.addCasProcessor(casProcessor);
    } catch (ResourceConfigurationException e) {
      e.printStackTrace();
      throw e;
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.uima.collection.base_cpm.CasProcessor

   *
   * @throws ResourceConfigurationException wraps Exception
   */
  private CasProcessor produceIntegratedCasProcessor(URL aDescriptor)
          throws ResourceConfigurationException {
    CasProcessor casProcessor = null;
    try {
      if (aDescriptor != null) {
        ResourceSpecifier resourceSpecifier = cpeFactory.getSpecifier(aDescriptor);

        if (resourceSpecifier instanceof AnalysisEngineDescription) {
View Full Code Here

Examples of org.apache.uima.collection.base_cpm.CasProcessor

   * Uses ProcessControllerAdapter instance to launch fenced CasProcessor.
   */
  public ProcessingContainer deployCasProcessor(List aCasProcessorList, boolean redeploy)
          throws ResourceConfigurationException {
    String name = null;
    CasProcessor cProcessor = null;
    CasProcessorConfiguration casProcessorConfig = null;
    ProcessingContainer processingContainer = null;
    if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
      UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
              "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_deploy_services__FINEST",
              Thread.currentThread().getName());
    }
    if (controller == null) {
      throw new ResourceConfigurationException(
              ResourceInitializationException.CONFIG_SETTING_ABSENT,
              new Object[] { "ProcessControllerAdapter" });
    }
    try {
      // Launch one instance of fenced CasProcessor per pipeline -Adam
      serviceUrls = controller.deploy(name, aCasProcessorList.size());

      ServiceProxyPool casProcessorPool = new ServiceProxyPool();
      // Deploy one Cas Processor at a time in sequential order
      for (int i = 0; i < aCasProcessorList.size(); i++) {
        cProcessor = (CasProcessor) aCasProcessorList.get(i);
        // Container may have already been instantiated. This will be the case if the CPM is
        // configured for concurrent
        // processing ( more than one processing pipeline). There is only one container per
        // CasProcessor type.
        // So each instance of the same CasProcessor will be associated with a single container.
        // Inside the
        // container instances are pooled. When deploying the very first CasProcessor of each type,
        // the
        // container will be created and initialized. Any subsequent deployments of this
        // CasProcessor will
        // simply use it, and will be added to this container's instance pool.
        if (processingContainer == null) {
          ProcessingResourceMetaData metaData = cProcessor.getProcessingResourceMetaData();
          CpeCasProcessor casProcessorType = (CpeCasProcessor) cpeFactory.casProcessorConfigMap
                  .get(metaData.getName());
          // Create a pool to hold instances of CasProcessors. Instances are managed by a container
          // through
          // getCasProcessor() and releaseProcessor() methods.
View Full Code Here

Examples of org.apache.uima.collection.base_cpm.CasProcessor

            }
            pool.wait()// pool has notifyall when it changes the pool.getSize() result
          } catch (Exception e) {
          }
        }
        CasProcessor cProcessor = pool.checkOut();
        if (cProcessor != null && cProcessor instanceof CasObjectNetworkCasProcessorImpl) {

          URL undeployUrl = ((CasObjectNetworkCasProcessorImpl) cProcessor).getEndpoint();
          undeploy(undeployUrl);
          pool.checkIn(cProcessor);
View Full Code Here

Examples of org.apache.uima.collection.base_cpm.CasProcessor

   * @return ProcessinContainer - instance of Container
   */
  public ProcessingContainer deployCasProcessor(List aCasProcessorList, boolean redeploy)
          throws ResourceConfigurationException {
    String name = null;
    CasProcessor casProcessor = null;
    CasProcessorConfiguration casProcessorConfig = null;
    ProcessingContainer processingContainer = null;
    try {
      // Deploy one Cas Processor at a time in sequential order
      for (int i = 0; i < aCasProcessorList.size(); i++) {
        casProcessor = (CasProcessor) aCasProcessorList.get(i);
        // Container may have already been instantiated. This will be the case if the CPM is
        // configured for concurrent
        // processing ( more than one processing pipeline). There is only one container per
        // CasProcessor type.
        // So each instance of the same CasProcessor will be associated with a single container.
        // Inside the
        // container instances are pooled. When deploying the very first CasProcessor of each type,
        // the
        // container will be created and initialized. Any subsequent deployments of this
        // CasProcessor will
        // simply use it, and will be added to this container's instance pool.
        if (processingContainer == null) {
          ProcessingResourceMetaData metaData = casProcessor.getProcessingResourceMetaData();
          CpeCasProcessor casProcessorType = (CpeCasProcessor) cpeFactory.casProcessorConfigMap
                  .get(metaData.getName());
          // Create a pool to hold instances of CasProcessors. Instances are managed by a container
          // through
          // getCasProcessor() and releaseProcessor() methods.
View Full Code Here

Examples of org.apache.uima.collection.base_cpm.CasProcessor

   *
   * @param aProcessingContainer -
   *          container where the metadata will be saved
   */
  private void associateMetadataWithContainer(ProcessingContainer aProcessingContainer) {
    CasProcessor processor = null;
    try {
      if (casProcessorPool != null) {
        processor = casProcessorPool.checkOut();
        if (processor != null) {
          ProcessingResourceMetaData metadata = processor.getProcessingResourceMetaData();
          if (aProcessingContainer != null && metadata != null) {
            aProcessingContainer.setMetadata(metadata);
          }
        }
      }
View Full Code Here

Examples of org.apache.uima.collection.base_cpm.CasProcessor

      if (redeploy == false && exclusiveAccess && serviceCount < concurrentThreadCount) {
        ServiceProxyPool pool = aProcessingContainer.getPool();
        int poolSize = pool.getSize();
        for (int i = 0; i < poolSize; i++) {
          // Adjust number of CasProcessors in the pool
          CasProcessor processor = pool.checkOut();
          if (processor instanceof NetworkCasProcessorImpl) {
            if (((NetworkCasProcessorImpl) processor).getProxy() == null) {
              if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
                UIMAFramework.getLogger(this.getClass()).logrb(
                        Level.FINEST,
View Full Code Here

Examples of org.apache.uima.collection.base_cpm.CasProcessor

                  CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                  "UIMA_CPM_retrieve_cp_from_failed_cplist__FINEST",
                  new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
                      casProcessorConfig.getDeploymentType() });
        }
        CasProcessor processor = (CasProcessor) ((ProcessingContainer_Impl) aProcessingContainer).failedCasProcessorList
                .get(0);
        // Extract old (stale) proxy from the CAS Processor
        VinciTAP tap = ((NetworkCasProcessorImpl) processor).getProxy();
        if (tap != null) {
          // Since the new service may have started on the same machine and the same port, make sure
View Full Code Here

Examples of org.apache.uima.collection.base_cpm.CasProcessor

              CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
              "UIMA_CPM_checked_in_cp_to_pool__FINEST",
              new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
                  aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
    }
    CasProcessor processor = null;
    boolean processorAssigned = false;
    try {
      if (redeploy) {
        // Check out the next Cas Processor from the pool
        if (((ProcessingContainer_Impl) aProcessingContainer).failedCasProcessorList.isEmpty()) {
View Full Code Here

Examples of org.apache.uima.collection.base_cpm.CasProcessor

      throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
          "casProcessor", "casProcessors" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
              CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
              new Object[] { Thread.currentThread().getName() })));
    }
    CasProcessor casProcessor = new NetworkCasProcessorImpl(aCasProcessorCfg);
    return casProcessor;
  }
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.