Package org.apache.uima

Examples of org.apache.uima.UIMARuntimeException


      // define CAS Pool in the CasManager
      try {
        getResourceManager().getCasManager().defineCasPool(this, mCasPoolSize,
                mPerformanceTuningSettings);
      } catch (ResourceInitializationException e) {
        throw new UIMARuntimeException(e);
      }
      mCasPoolCreated = true;
    }

    //check if component has exceeded its CAS pool
    if (mOutstandingCASes.size() == mCasPoolSize) {
      throw new UIMARuntimeException(UIMARuntimeException.REQUESTED_TOO_MANY_CAS_INSTANCES,
              new Object[] { getQualifiedContextName(), Integer.toString(mCasPoolSize + 1),
                  Integer.toString(mCasPoolSize) });
    }
    CasManager casManager = getResourceManager().getCasManager();
//    CAS cas = casManager.getCas(getQualifiedContextName());
View Full Code Here


      handler.endDocument();

      // return XML string
      return new String(byteArrayOutputStream.toByteArray(),"UTF-8");
    } catch (SAXException e) {
      throw new UIMARuntimeException(e);
    } catch (UnsupportedEncodingException e) {
      throw new UIMARuntimeException(e);
    }
  }
View Full Code Here

//    if (aSrcCasView == ((CASImpl)aSrcCasView).getBaseCAS() ||
//        aTgtCasView == ((CASImpl)aTgtCasView).getBaseCAS())
//      throw new UIMARuntimeException(UIMARuntimeException.UNSUPPORTED_CAS_COPY_TO_OR_FROM_BASE_CAS, null);
   
    if (mSrcBaseCas != ((CASImpl)aSrcCasView).getBaseCAS()) {
      throw new UIMARuntimeException(UIMARuntimeException.VIEW_NOT_PART_OF_CAS, new Object[] {"Source"});
    }
    if (mDestBaseCas != ((CASImpl)aTgtCasView).getBaseCAS()) {
      throw new UIMARuntimeException(UIMARuntimeException.VIEW_NOT_PART_OF_CAS, new Object[] {"Destination"});
    }
   
    mSrcCasViewName = aSrcCasView.getViewName();
    mTgtCasViewName = aTgtCasView.getViewName();

    if (null == mSrcCasViewName || null == mTgtCasViewName ) {
      throw new UIMARuntimeException(UIMARuntimeException.UNSUPPORTED_CAS_COPY_TO_OR_FROM_BASE_CAS, null);
    }
       
    mLowLevelDestCas = mDestBaseCas.getLowLevelCAS();
   
    // The top level sofa associated with this view is copied (or not)
View Full Code Here

      // If in lenient mode, do not act on this FS. Instead just
      // return (null) to the caller and let the caller deal with this case.
      if (lenient) {
        return null; // No FS to create
      } else {
        throw new UIMARuntimeException(UIMARuntimeException.TYPE_NOT_FOUND_DURING_CAS_COPY,
            new Object[] { srcType.getName() });
      }
    }
    // We need to use the LowLevel CAS interface to create the FS, because the usual
    // CAS.createFS() call doesn't allow us to create subtypes of AnnotationBase from
View Full Code Here

          // feature in this FS (if one exists)
          if (lenient) {
            continue; // Ignore this feature in the source CAS since it doesn't exist in
                      // in the target CAS.
          } else {
            throw new UIMARuntimeException(UIMARuntimeException.FEATURE_NOT_FOUND_DURING_CAS_COPY,
                new Object[] { srcFeat.getName() });
          }
        }
      }
View Full Code Here

          resultList.add(new NameClassPair(propName, propClass.getName()));
        }
      }
      return resultList;
    } catch (IntrospectionException e) {
      throw new UIMARuntimeException(e);
    }
  }
View Full Code Here

          }
        }
      }
      return null;
    } catch (Exception e) {
      throw new UIMARuntimeException(e);
    }
  }
View Full Code Here

          return Class.forName(ncp.getClassName());
        }
      }
      return null;
    } catch (Exception e) {
      throw new UIMARuntimeException(e);
    }
  }
View Full Code Here

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

    try {
      // do the default cloning
      clone = (MetaDataObject_impl) super.clone();
    } catch (CloneNotSupportedException e) {
      // assert false : "All MetaDataObjects are Cloneable";
      throw new UIMARuntimeException(e);
    }

    // now clone all values that are MetaDataObjects
    List<NameClassPair> attrs = listAttributes();
    Iterator<NameClassPair> i = attrs.iterator();
View Full Code Here

TOP

Related Classes of org.apache.uima.UIMARuntimeException

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.