Package org.apache.uima

Examples of org.apache.uima.UIMA_IllegalStateException


      name = getClass().getName();
    }

    // check for repeat initialization
    if (mInitialized) {
      throw new UIMA_IllegalStateException(UIMA_IllegalStateException.RESOURCE_ALREADY_INITIALIZED,
              new Object[] { name });
    }

    // is there a UIMAContext provided in the aAdditionalParams map?
    if (aAdditionalParams != null) {
View Full Code Here


      enterProcess();
      try {
        // Make sure that the AnalysisComponent has a next CAS to return
        // Use the saved value so hasNext not called twice before next
        if (!casAvailable) {
          throw new UIMA_IllegalStateException(UIMA_IllegalStateException.NO_NEXT_CAS,
                  new Object[0]);
        }
        casAvailable = false;
        // call AnalysisComponent.next method to populate CAS
        try {
View Full Code Here

      try {
        // Make sure that the AnalysisComponent has a next output CAS to
        // return
        boolean analysisComponentHasNext = mAnalysisComponent.hasNext();
        if (!analysisComponentHasNext) {
          throw new UIMA_IllegalStateException(UIMA_IllegalStateException.NO_NEXT_CAS,
                  new Object[0]);
        }
        // call AnalyaisComponent.next method to populate CAS
        try {
          CAS cas = callAnalysisComponentNext();
View Full Code Here

      try {
        CAS toReturn = nextCas;
        if (toReturn == null)
          toReturn = processUntilNextOutputCas();
        if (toReturn == null) {
          throw new UIMA_IllegalStateException(UIMA_IllegalStateException.NO_NEXT_CAS,
                  new Object[0]);
        }
        nextCas = null;
        getMBean().incrementCASesProcessed();
        return toReturn;
View Full Code Here

   *           if no Session has been set
   */
  @SuppressWarnings("unchecked")
  private void setSessionParam(String aCompleteName, Object aValue) {
    if (mSession == null) {
      throw new UIMA_IllegalStateException();
    } else {
      Map<String, Object> m = (Map<String, Object>) mSession.get(SESSION_CONFIGURATION_KEY);
      if (m == null) {
        m = Collections.synchronizedMap(new HashMap<String, Object>());
        mSession.put(SESSION_CONFIGURATION_KEY, m);
View Full Code Here

    // resolve the class name and instantiate the class
    XMLizable object;
    try {
      object = (XMLizable) cls.newInstance();
    } catch (Exception e) {
      throw new UIMA_IllegalStateException(
              UIMA_IllegalStateException.COULD_NOT_INSTANTIATE_XMLIZABLE, new Object[] { cls
                      .getName() }, e);
    }
   
    callBuildFromXMLElement(aElement, object, aOptions);
View Full Code Here

    // resolve the class name and instantiate the class
    XMLizable object;
    try {
      object = (XMLizable) cls.newInstance();
    } catch (Exception e) {
      throw new UIMA_IllegalStateException(
              UIMA_IllegalStateException.COULD_NOT_INSTANTIATE_XMLIZABLE, new Object[] { cls
                      .getName() }, e);
    }

    // construct the XMLizable object from the XML element
View Full Code Here

    synchronized(this) {
      if (mCasManager == null) {
        mCasManager = aCasManager;
      }
      else {
        throw new UIMA_IllegalStateException(
                UIMA_IllegalStateException.CANNOT_SET_CAS_MANAGER, new Object[0]);
      }
    }
  }
View Full Code Here

   */
  public void initialize(CpeDescription aCpeDescription, Map aAdditionalParams)
          throws ResourceInitializationException {
    if (mCPM != null) // repeat initialization - not allowed
    {
      throw new UIMA_IllegalStateException(UIMA_IllegalStateException.RESOURCE_ALREADY_INITIALIZED,
              new Object[] { getClass().getName() });
    }

    // get the ResourceManager (if any) supplied in the aAdditionalParams map
    ResourceManager resMgr = aAdditionalParams == null ? null : (ResourceManager) aAdditionalParams
View Full Code Here

  /**
   * Throws a UIMA_IllegalStateException, since annotators are not allowed to create new CAS
   * instances. Only CasMultipliers are allowed to do this.
   */
  public final AbstractCas next() throws AnalysisEngineProcessException {
    throw new UIMA_IllegalStateException(UIMA_IllegalStateException.NO_NEXT_CAS, null);
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.UIMA_IllegalStateException

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.