Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The performance reason for using the low level accessors is not present in V3; in fact, these, if implemented, would be slower than the other APIs.

 

JCas Class sharing

 

JCas cover classes now come in single classes, rather than in pairs.  These classes are either built-in or are generated; built-in ones cannot be generated

...

At instance creation time, a lookup is done, using the instance of the type system, to get the actual type associated with the registry number.  This mechanism is encapsulated within the JCasRegistry class.

Locating the corresponding UIMA Feature when accessing a feature using JCas APIs

The generated getter or setter code for a JCas feature need to access needs the feature instance associated with stored-feature-offset-index information for the feature being set.  This cannot be statically compiled into the JCas class for the same reasons as above. A similar registry is used, and a unique incrementing integer is assigned to each feature referenced in a JCas class; these int values are kept as static final int values in the loaded class, and are similarly looked up when needed.

These are used in the trampoline methods of the generated getters and setters.  A getBegin() gets converted into a getIntValue(_getFeat(_FI_begin)), where getIntValue is the plain API call and _getFeat is a method taking the registered unique identifier for this feature and looking up the FeatureImpl instance for it.

 

Collections

 

accessed.  In the use-case of having multiple type systems for one JCas class set loaded under one class loader, each type system might have a different number for this; this design would make it necessary to have all accesses go thru one level of indirection to get the particular type system's offset for a feature.

This is avoided using the following technique that assigns the offsets to match already assigned ones:

  • The first time a JCas class is loaded at type system commit time, it defines a final static int constant of the pre-computed offset.
  • The 2nd time a JCas class is accessed at type system commit time, the first value stored is read and is used for the offset.

This requires that no JCas class access is done prior to type system commit, since the static final value can only be assigned once at resolution time.  This is normally the case, since it would be invalid to do something with a JCas class before the pipeline is set up.

Collections

UIMA v2 supports specially-named arrays of primitives (+ string), e.g. BooleanArray. 

...

  • limit (initially) generic spec to only simple type names, no support for extends, ?, etc.  Use TOP for "Object".

 

Strings

 

Keep special UIMA String type for compatibility and subtyping.

...