Package org.apache.uima.adapter.vinci
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 Summary
FieldsModifier and TypeFieldDescriptionbooleanbooleanorg.apache.uima.UimaContext -
Constructor Summary
ConstructorsConstructorDescriptionCASTransportable(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.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. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidcleanup()voidvoidendElement(String uri, String name, String qName) protected voidfinalize()org.apache.vinci.transport.KeyValuePairorg.apache.uima.cas.CASgetCas()Gets the cas.Gets the command.org.apache.vinci.transport.VinciFrameGets the extra data frame.org.apache.uima.cas.impl.OutOfTypeSystemDataGets the out of type system data.voidsetCommand(String command) Sets the command.voidvoidstartElement(String uri, String name, String qName, Attributes atts) voidtoStream(OutputStream os) Serialize the CAS to the stream in XTalk format.Create a SAXException that wraps the given IOException.Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
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 pooloutOfTypeSystemData- the out of type system datauimaContext- the uima contextincludeDocText- 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 casoutOfTypeSystemData- the out of type system datauimaContext- the uima contextincludeDocText- 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
Gets the command.- Returns:
- the command
-
setCommand
Sets the command.- Parameters:
command- the new command
-
getCas
public org.apache.uima.cas.CAS getCas()Gets the cas.- Returns:
- the cas
-
fromStream
- Specified by:
fromStreamin interfaceorg.apache.vinci.transport.Transportable- Throws:
IOException
-
toStream
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:
toStreamin interfaceorg.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() -
startElement
public void startElement(String uri, String name, String qName, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
wrapAsSAXException
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 returne.
-