Examples of CASMgr


Examples of org.apache.uima.cas.admin.CASMgr

   * @param aCas the CAS to unmarshal into
   * @param aReplaceCasTypeSystem if true, assumes serialized data contains the type system
   * @throws CASException passthru
   */
   public void unmarshalCas(CAS aCas, boolean aReplaceCasTypeSystem) throws CASException {
    CASMgr casMgr = (CASMgr) aCas;
    if (aReplaceCasTypeSystem) {
      Serialization.deserializeCASComplete(mCasSer, casMgr);
    } else {
      Serialization.createCAS(casMgr, mCasSer.getCASSerializer());
    }
View Full Code Here

Examples of org.apache.uima.cas.admin.CASMgr

        casSerializerOut.byteHeapArray = (byte[]) getSerializedDataJNI(BYTEHEAP);
        casSerializerOut.shortHeapArray = (short[]) getSerializedDataJNI(SHORTHEAP);
        casSerializerOut.longHeapArray = (long[]) getSerializedDataJNI(LONGHEAP);

        CASMgr casMgr = (CASMgr) cas;
        CAS newCAS = Serialization.createCAS(casMgr, casSerializerOut);
        if (newCAS != casMgr) {
          throw new RuntimeException("CASMgr and CAS should be identical");
        }
      }
View Full Code Here

Examples of org.apache.uima.cas.admin.CASMgr

        casSerializerOut.byteHeapArray = (byte[]) getSerializedSegmentDataJNI(BYTEHEAP);
        casSerializerOut.shortHeapArray = (short[]) getSerializedSegmentDataJNI(SHORTHEAP);
        casSerializerOut.longHeapArray = (long[]) getSerializedSegmentDataJNI(LONGHEAP);
        releaseSegmentJNI();

        CASMgr casMgr = (CASMgr) segment;
        CAS newCAS = Serialization.createCAS(casMgr, casSerializerOut);
        if (newCAS != casMgr) {
          throw new RuntimeException("CASMgr and CAS should be identical");
        }
      } else {
View Full Code Here

Examples of org.apache.uima.cas.admin.CASMgr

        useJcasCache = false;
      }
    }

    // create CAS using either aTypeSystem or aTypeSystemDesc
    CASMgr casMgr;
    if (aTypeSystem != null) {
      if (initialHeapSizeStr != null) {
        casMgr = CASFactory.createCAS(Integer.parseInt(initialHeapSizeStr), aTypeSystem, useJcasCache);
      } else {
        casMgr = CASFactory.createCAS(aTypeSystem, useJcasCache);
      }
    } else // no TypeSystem to reuse - create a new one
    {
      if (initialHeapSizeStr != null) {
        casMgr = CASFactory.createCAS(Integer.parseInt(initialHeapSizeStr), useJcasCache);
      } else {
        casMgr = CASFactory.createCAS(CASImpl.DEFAULT_INITIAL_HEAP_SIZE, useJcasCache);
      }
      // install type system
      setupTypeSystem(casMgr, aTypeSystemDesc);
      // Commit the type system
      ((CASImpl) casMgr).commitTypeSystem();
    }

    try {
      // install TypePriorities into CAS
      setupTypePriorities(casMgr, aTypePriorities);

      // install Built-in indexes into CAS
      casMgr.initCASIndexes();
    } catch (CASException e) {
      throw new ResourceInitializationException(e);
    }

    // install AnalysisEngine's custom indexes into CAS
    setupIndexes(casMgr, aFsIndexes);

    // Commit the index repository
    casMgr.getIndexRepositoryMgr().commit();

    // Set JCas ClassLoader
    if (aResourceManager.getExtensionClassLoader() != null) {
      casMgr.setJCasClassLoader(aResourceManager.getExtensionClassLoader());
    }

    return casMgr.getCAS().getView(CAS.NAME_DEFAULT_SOFA);
  }
View Full Code Here

Examples of org.apache.uima.cas.admin.CASMgr

   *
   * @param aDataContainer
   *          the AnalysisProcessData to unmarshal into
   */
  public void unmarshalCas(CAS aCas, boolean aReplaceCasTypeSystem) throws CASException {
    CASMgr casMgr = (CASMgr) aCas;
    if (aReplaceCasTypeSystem) {
      Serialization.deserializeCASComplete(mCasSer, casMgr);
    } else {
      Serialization.createCAS(casMgr, mCasSer.getCASSerializer());
    }
View Full Code Here

Examples of org.apache.uima.cas.admin.CASMgr

        useJcasCache = false;
      }
    }

    // create CAS using either aTypeSystem or aTypeSystemDesc
    CASMgr casMgr;
    if (aTypeSystem != null) {
      if (initialHeapSizeStr != null) {
        casMgr = CASFactory.createCAS(Integer.parseInt(initialHeapSizeStr), aTypeSystem, useJcasCache);
      } else {
        casMgr = CASFactory.createCAS(aTypeSystem, useJcasCache);
      }
    } else // no TypeSystem to reuse - create a new one
    {
      if (initialHeapSizeStr != null) {
        casMgr = CASFactory.createCAS(Integer.parseInt(initialHeapSizeStr), useJcasCache);
      } else {
        casMgr = CASFactory.createCAS(CASImpl.DEFAULT_INITIAL_HEAP_SIZE, useJcasCache);
      }
      // install type system
      setupTypeSystem(casMgr, aTypeSystemDesc);
      // Commit the type system
      ((CASImpl) casMgr).commitTypeSystem();
    }

    try {
      // install TypePriorities into CAS
      setupTypePriorities(casMgr, aTypePriorities);

      // install Built-in indexes into CAS
      casMgr.initCASIndexes();
    } catch (CASException e) {
      throw new ResourceInitializationException(e);
    }

    // install AnalysisEngine's custom indexes into CAS
    setupIndexes(casMgr, aFsIndexes);

    // Commit the index repository
    casMgr.getIndexRepositoryMgr().commit();

    // Set JCas ClassLoader
    if (aResourceManager.getExtensionClassLoader() != null) {
      casMgr.setJCasClassLoader(aResourceManager.getExtensionClassLoader());
    }

    return casMgr.getCAS().getView(CAS.NAME_DEFAULT_SOFA);
  }
View Full Code Here

Examples of org.apache.uima.cas.admin.CASMgr

        useJcasCache = false;
      }
    }

    // create CAS using either aTypeSystem or aTypeSystemDesc
    CASMgr casMgr;
    if (aTypeSystem != null) {
      if (initialHeapSizeStr != null) {
        casMgr = CASFactory.createCAS(Integer.parseInt(initialHeapSizeStr), aTypeSystem, useJcasCache);
      } else {
        casMgr = CASFactory.createCAS(aTypeSystem, useJcasCache);
      }
    } else // no TypeSystem to reuse - create a new one
    {
      if (initialHeapSizeStr != null) {
        casMgr = CASFactory.createCAS(Integer.parseInt(initialHeapSizeStr), useJcasCache);
      } else {
        casMgr = CASFactory.createCAS(CASImpl.DEFAULT_INITIAL_HEAP_SIZE, useJcasCache);
      }
      // install type system
      setupTypeSystem(casMgr, aTypeSystemDesc);
      // Commit the type system
      ((CASImpl) casMgr).commitTypeSystem();
    }

    try {
      // install TypePriorities into CAS
      setupTypePriorities(casMgr, aTypePriorities);

      // install Built-in indexes into CAS
      casMgr.initCASIndexes();
    } catch (CASException e) {
      throw new ResourceInitializationException(e);
    }

    // install AnalysisEngine's custom indexes into CAS
    setupIndexes(casMgr, aFsIndexes);

    // Commit the index repository
    casMgr.getIndexRepositoryMgr().commit();

    // Set JCas ClassLoader
    if (aResourceManager.getExtensionClassLoader() != null) {
      casMgr.setJCasClassLoader(aResourceManager.getExtensionClassLoader());
    }

    return casMgr.getCAS().getView(CAS.NAME_DEFAULT_SOFA);
  }
View Full Code Here

Examples of org.apache.uima.cas.admin.CASMgr

        casSerializerOut.byteHeapArray = (byte[]) getSerializedDataJNI(BYTEHEAP);
        casSerializerOut.shortHeapArray = (short[]) getSerializedDataJNI(SHORTHEAP);
        casSerializerOut.longHeapArray = (long[]) getSerializedDataJNI(LONGHEAP);

        CASMgr casMgr = (CASMgr) cas;
        CAS newCAS = Serialization.createCAS(casMgr, casSerializerOut);
        if (newCAS != casMgr) {
          throw new RuntimeException("CASMgr and CAS should be identical");
        }
      }
View Full Code Here

Examples of org.apache.uima.cas.admin.CASMgr

        casSerializerOut.byteHeapArray = (byte[]) getSerializedSegmentDataJNI(BYTEHEAP);
        casSerializerOut.shortHeapArray = (short[]) getSerializedSegmentDataJNI(SHORTHEAP);
        casSerializerOut.longHeapArray = (long[]) getSerializedSegmentDataJNI(LONGHEAP);
        releaseSegmentJNI();

        CASMgr casMgr = (CASMgr) segment;
        CAS newCAS = Serialization.createCAS(casMgr, casSerializerOut);
        if (newCAS != casMgr) {
          throw new RuntimeException("CASMgr and CAS should be identical");
        }
      } else {
View Full Code Here

Examples of org.apache.uima.cas.admin.CASMgr

    try {
      ResultSpecification_impl rs = new ResultSpecification_impl();
      rs.setResultTypesAndFeatures(mTypesAndFeatures);

      // create Type System
      CASMgr casMgr = CASFactory.createCAS();
      TypeSystemMgr tsMgr = casMgr.getTypeSystemMgr();
      Type fakeType = tsMgr.addType("FakeType", tsMgr.getTopType());
      Type anotherType = tsMgr.addType("AnotherType", tsMgr.getTopType());
      tsMgr.addFeature("FakeFeature", fakeType, tsMgr.getTopType());
      tsMgr.addFeature("FakeFeature2", fakeType, tsMgr.getTopType());
      tsMgr.addFeature("AnotherFeature", anotherType, tsMgr.getTopType());
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.