public void collectionProcessComplete(ProcessTrace arg0) throws ResourceProcessException, IOException { super.collectionProcessComplete(arg0); try { iv_bw.flush(); iv_bw.close(); } catch(Exception e) { throw new ResourceProcessException(e); } } }
if (e.getCause() instanceof KillPipelineException) { cpm.pipelineKilled(Thread.currentThread().getName()); releaseCAS = true;
public void collectionProcessComplete(ProcessTrace arg0) throws ResourceProcessException, IOException { super.collectionProcessComplete(arg0); try { iv_bw.flush(); iv_bw.close(); } catch(Exception e) { throw new ResourceProcessException(e); } } }
public void collectionProcessComplete(ProcessTrace arg0) throws ResourceProcessException, IOException { super.collectionProcessComplete(arg0); try { iv_bw.flush(); iv_bw.close(); } catch(Exception e) { throw new ResourceProcessException(e); } } }
public void collectionProcessComplete(ProcessTrace arg0) throws ResourceProcessException, IOException { super.collectionProcessComplete(arg0); try { iv_bw.flush(); iv_bw.close(); } catch(Exception e) { throw new ResourceProcessException(e); } } }
public void processCas(CAS aCAS) throws ResourceProcessException { try { process(aCAS); } catch (AnalysisEngineProcessException e) { throw new ResourceProcessException(e); } }
/** * @param sourcedata - * @return the encounter id * @throws ResourceProcessException if the encounter id does not exist or is not parseable as an int */ static public int getEncounterNum( final SourceData sourcedata ) throws ResourceProcessException { final String encounter = sourcedata.getSourceEncounterId(); int encounterNum; try { encounterNum = Integer.parseInt( encounter ); } catch ( NumberFormatException nfE ) { // thrown by Integer.parseInt throw new ResourceProcessException( nfE ); } return encounterNum; }
/** * @param sourcedata - * @return the encounter id * @throws ResourceProcessException if the encounter id does not exist or is not parseable as an int */ static public int getEncounterNum( final SourceData sourcedata ) throws ResourceProcessException { final String encounter = sourcedata.getSourceEncounterId(); int encounterNum; try { encounterNum = Integer.parseInt( encounter ); } catch ( NumberFormatException nfE ) { // thrown by Integer.parseInt throw new ResourceProcessException( nfE ); } return encounterNum; }
/** * @param sourcedata - * @return the instance id or -1 if there isn't one * @throws ResourceProcessException if the internal value is not parseable as long */ static public long getInstanceNum( final SourceData sourcedata ) throws ResourceProcessException { final String instance = sourcedata.getSourceInstanceId(); if ( instance == null || instance.isEmpty() ) { return -1; } long instanceNum; try { instanceNum = Long.parseLong( instance ); } catch ( NumberFormatException nfE ) { // thrown by Integer.parseInt throw new ResourceProcessException( nfE ); } return instanceNum; }
/** * @param sourcedata - * @return the instance id or -1 if there isn't one * @throws ResourceProcessException if the internal value is not parseable as long */ static public long getInstanceNum( final SourceData sourcedata ) throws ResourceProcessException { final String instance = sourcedata.getSourceInstanceId(); if ( instance == null || instance.isEmpty() ) { return -1; } long instanceNum; try { instanceNum = Long.parseLong( instance ); } catch ( NumberFormatException nfE ) { // thrown by Integer.parseInt throw new ResourceProcessException( nfE ); } return instanceNum; }
/** * Uses configured transport to delegate given CAS to the remote service. * * @param aCAS CAS to be analyzed * @throws ResourceProcessException wraps Exception, SocketException */ @Override public void processCas(CAS aCAS) throws ResourceProcessException { try { // delegate analysis of the CAS to remote object transport.process(socket, aCAS); } catch (SocketException e) { throw new ResourceProcessException(new ServiceConnectionException(e)); } catch (Exception e) { throw new ResourceProcessException(e); } }
/** * process */ public void processCas(CAS aCAS) throws ResourceProcessException { JCas jcas; try { jcas = aCAS.getJCas(); } catch (CASException e) { throw new ResourceProcessException(e); } printTimexAnnotationsInline(jcas); }
/** * process */ public void processCas(CAS aCAS) throws ResourceProcessException { JCas jcas; try { jcas = aCAS.getJCas(); } catch (CASException e) { throw new ResourceProcessException(e); } printTimexAnnotations(jcas); }
/** * Uses configured transport to delegate given CASes to the remote service. * * @param aCASes - an array of CASes to be analyzed * @throws ResourceProcessException wraps SocketException, SocketTimeoutException */ @Override public void processCas(CAS[] aCASes) throws ResourceProcessException { try { for (int i = 0; i < aCASes.length; i++) { // delegate analysis of the CASes to remote object transport.process(socket, aCASes[i]); } } catch (SocketException e) { throw new ResourceProcessException(new ServiceConnectionException(e)); } catch (SocketTimeoutException e) { throw new ResourceProcessException(e); } }
/** * Create an xml file from the data in the cas. */ public void processCas( CAS cas ) throws ResourceProcessException { iv_logger.info( "Started" ); try { JCas currentView = cas.getCurrentView().getJCas(); processView( currentView ); } catch ( Exception e ) { throw new ResourceProcessException( e ); } }
/** * Create an xml file from the data in the cas. */ @Override public void processCas( CAS cas ) throws ResourceProcessException { iv_logger.info( "Started" ); try { JCas currentView = cas.getCurrentView().getJCas(); processView( currentView ); } catch ( Exception e ) { throw new ResourceProcessException( e ); } }
/** * Create an xml file from the data in the cas. */ public void processCas( CAS cas ) throws ResourceProcessException { iv_logger.info( "Started" ); try { JCas currentView = cas.getCurrentView().getJCas(); processView( currentView ); } catch ( Exception e ) { throw new ResourceProcessException( e ); } }
@Override public void processCas( CAS cas ) throws ResourceProcessException { try { JCas jcas; jcas = cas.getJCas(); // jcas = cas.getJCas().getView("_InitialView"); // jcas = cas.getJCas().getView("plaintext"); String documentText = jcas.getDocumentText(); String documentID = DocumentIDAnnotationUtil.getDeepDocumentId( jcas ); if ( documentID == null || documentID.equals( DocumentIDAnnotationUtil.NO_DOCUMENT_ID ) ) { documentID = "doc_" + new java.util.Date().getTime() + ".xml"; // use timestamp in name: doc_TIMESTAMP.xml LOGGER.warn( "Unable to find DocumentIDAnnotation, using " + documentID ); } writeToFile( documentID, documentText ); } catch ( Exception e ) { throw new ResourceProcessException( e ); } }
/** * Create an xml file from the data in the cas. */ @Override public void processCas( CAS cas ) throws ResourceProcessException { iv_logger.info( "Started" ); try { JCas currentView = cas.getCurrentView().getJCas(); processView( currentView ); } catch ( Exception e ) { throw new ResourceProcessException( e ); } }
/** * Main method used during analysis. The ProcessingUnit calls this method to initiate analysis of * the content in the CasData instance. This handles processing of multiple Cas'es at a time. * * @param aCasList - array of CasData instances to analyze * @return CasData - array of CasData instances containing results of the analysis */ public CasData[] process(CasData[] aCasList) throws ResourceProcessException { if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) { UIMAFramework.getLogger(this.getClass()).log( Level.FINEST, Thread.currentThread().getName() + " ===================================Calling Proxy"); } if (textAnalysisProxy == null) { throw new ResourceProcessException(new Exception(Thread.currentThread().getName() + CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_no_proxy__WARNING", new Object[] { Thread.currentThread() .getName() }))); } try { ProcessTrace pt = new ProcessTrace_impl(); return textAnalysisProxy.analyze(aCasList, pt, name); } catch (ServiceConnectionException e) { throw new ResourceProcessException(e); } catch (ServiceException e) { throw new ResourceProcessException(e); } }