Package org.apache.uima.resource

Examples of org.apache.uima.resource.ResourceProcessException


          throws ResourceProcessException {
    try {
      setCommonProperties(aCasReferenceId, msg, "binary");
      ((BytesMessage) msg).writeBytes(aSerializedCAS);
    } catch (Exception e) {
      throw new ResourceProcessException(e);
    }
  }
View Full Code Here


      msg.setBooleanProperty(AsynchAEMessage.AcceptsDeltaCas, true);
      msg.setJMSReplyTo(consumerDestination);

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

  }
View Full Code Here

              boolean releasedCas = false;
              for (int i = 0; i < casObjectList.length && casObjectList[i] != null; i++) {
                ChunkMetadata meta = CPMUtils.getChunkMetadata((CAS) casObjectList[i]);
                if (meta != null) {
                  if (timedoutDocs.containsKey(meta.getDocId())) {
                    notifyListeners(casList[i], new ResourceProcessException(new SkipCasException(
                            "Dropping CAS due chunk Timeout. Doc Id::" + meta.getDocId()
                                    + " Sequence:" + meta.getSequence())));

                    casPool.releaseCas((CAS) casObjectList[i]);
//                    synchronized (casPool) {  // redundant, releaseCas call does this
View Full Code Here

      return ((ActiveMQDestination)sender.getMessageProducer().getDestination()).getPhysicalName();
      //return (((ActiveMQDestination) producer.getDestination()).getPhysicalName());
    }
    catch (Exception e)
    {
      throw new ResourceProcessException(e);
    }
  }
View Full Code Here

      setCommonProperties(aCasReferenceId, msg);
      msg.setText(serializeCAS(aCAS));
    }
    catch (Exception e)
    {
      throw new ResourceProcessException(e);
    }
  }
View Full Code Here

      setCommonProperties(aCasReferenceId, msg);
      msg.setText(aSerializedCAS);
    }
    catch (Exception e)
    {
      throw new ResourceProcessException(e);
    }
  }
View Full Code Here

      msg.setIntProperty(AsynchAEMessage.Payload, AsynchAEMessage.XMIPayload);
      msg.setJMSReplyTo(consumerDestination);
    }
    catch (Exception e)
    {
      throw new ResourceProcessException(e);
    }
     
    }
View Full Code Here

    JCas jcas;
    try {
      jcas = aCAS.getJCas();
    } catch (CASException e) {
      throw new ResourceProcessException(e);
    }
   
    String originalFileName = DocumentIDAnnotationUtil.getDocumentID(jcas);
    File outFile = null;
    if (originalFileName != null && !originalFileName.isEmpty())
    {
      File inFile;
      try
      {
      String outFileName = null;
      if (originalFileName.contains("/"))
      {
          URI uri = UriUtils.quote(originalFileName);
          inFile = new File(uri);
          outFileName = inFile.getName();
      } else
      {
        outFileName = originalFileName;
      }
        outFileName += ".xmi";
        outFile = new File(mOutputDir, outFileName);
       
      } catch (URISyntaxException e)
      {
      // bad URI, use default processing below
      }
     
    }
    if (outFile == null) {
        outFile = new File(mOutputDir, "doc" + mDocNum++ + ".xmi"); // Jira UIMA-629
     }
    // serialize XCAS and write to output file
    try {
      writeXmi(jcas.getCas(), outFile, modelFileName);
    } catch (IOException e) {
      throw new ResourceProcessException(e);
    } catch (SAXException e) {
      throw new ResourceProcessException(e);
    }
  }
View Full Code Here

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

  public synchronized void process() throws ResourceProcessException
  {
    if (!initialized)
    {
      throw new ResourceProcessException();
    }
    if (collectionReader == null)
    {
      throw new ResourceProcessException();
    }
    try
    {
      CAS cas = null;
      boolean hasNext = true;
      while ((hasNext = collectionReader.hasNext()) == true)
      {
        if (initialized && running)
        {
          cas = getCAS();
          collectionReader.getNext(cas);
          sendCAS(cas);
        }
        else
        {
          break;
        }
      }

      if (hasNext == false)
      {
        collectionProcessingComplete();
      }
    }
    catch (Exception e)
    {
      throw new ResourceProcessException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.ResourceProcessException

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.