Class CASTransportable

java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.uima.adapter.vinci.CASTransportable
All Implemented Interfaces:
org.apache.vinci.transport.Transportable, ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class CASTransportable extends DefaultHandler implements org.apache.vinci.transport.Transportable
  • Field Details

    • uimaContext

      public org.apache.uima.UimaContext uimaContext
    • includeDocText

      public boolean includeDocText
    • ignoreResponse

      public boolean ignoreResponse
  • Constructor Details

    • CASTransportable

      public CASTransportable(org.apache.uima.util.CasPool casPool, org.apache.uima.cas.impl.OutOfTypeSystemData outOfTypeSystemData, org.apache.uima.UimaContext uimaContext, boolean includeDocText)
      This constructor is used on the service side - a CAS Pool reference is provided. We don't check a CAS out of the pool until we get a request.
      Parameters:
      casPool - the cas pool
      outOfTypeSystemData - the out of type system data
      uimaContext - the uima context
      includeDocText - the include doc text
    • CASTransportable

      public CASTransportable(org.apache.uima.cas.CAS cas, org.apache.uima.cas.impl.OutOfTypeSystemData outOfTypeSystemData, org.apache.uima.UimaContext uimaContext, boolean includeDocText)
      This constructor is used on the client side, where we have a dedicated CAS instance for the request.
      Parameters:
      cas - the cas
      outOfTypeSystemData - the out of type system data
      uimaContext - the uima context
      includeDocText - the include doc text
  • Method Details

    • getExtraDataFrame

      public org.apache.vinci.transport.VinciFrame getExtraDataFrame()
      Gets the extra data frame.
      Returns:
      the extra data frame
    • getOutOfTypeSystemData

      public org.apache.uima.cas.impl.OutOfTypeSystemData getOutOfTypeSystemData()
      Gets the out of type system data.
      Returns:
      the out of type system data
    • getCommand

      public String getCommand()
      Gets the command.
      Returns:
      the command
    • setCommand

      public void setCommand(String command)
      Sets the command.
      Parameters:
      command - the new command
    • getCas

      public org.apache.uima.cas.CAS getCas()
      Gets the cas.
      Returns:
      the cas
    • fromStream

      public org.apache.vinci.transport.KeyValuePair fromStream(InputStream is) throws IOException
      Specified by:
      fromStream in interface org.apache.vinci.transport.Transportable
      Throws:
      IOException
    • toStream

      public void toStream(OutputStream os) throws IOException
      Serialize the CAS to the stream in XTalk format. After serialization is complete the cas is returned to the pool (if it was allocated from a pool.)
      Specified by:
      toStream in interface org.apache.vinci.transport.Transportable
      Parameters:
      os - the os
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • cleanup

      public void cleanup()
    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • startElement

      public void startElement(String uri, String name, String qName, Attributes atts) throws SAXException
      Specified by:
      startElement in interface ContentHandler
      Overrides:
      startElement in class DefaultHandler
      Throws:
      SAXException
    • endElement

      public void endElement(String uri, String name, String qName) throws SAXException
      Specified by:
      endElement in interface ContentHandler
      Overrides:
      endElement in class DefaultHandler
      Throws:
      SAXException
    • characters

      public void characters(char[] ch, int start, int length) throws SAXException
      Specified by:
      characters in interface ContentHandler
      Overrides:
      characters in class DefaultHandler
      Throws:
      SAXException
    • startDocument

      public void startDocument() throws SAXException
      Specified by:
      startDocument in interface ContentHandler
      Overrides:
      startDocument in class DefaultHandler
      Throws:
      SAXException
    • endDocument

      public void endDocument() throws SAXException
      Specified by:
      endDocument in interface ContentHandler
      Overrides:
      endDocument in class DefaultHandler
      Throws:
      SAXException
    • wrapAsSAXException

      public SAXException wrapAsSAXException(IOException e)
      Create a SAXException that wraps the given IOException. The wrapping is done using the standard Java 1.4 mechanism, so that getCause() will work. Note that new SAXException(Exception) does NOT work.
      Parameters:
      e - an IOException to wrap
      Returns:
      a SAX exception for which getCause() will return e.