com.metamatrix.connector.xml.streaming
Class BaseStreamingExecution

java.lang.Object
  extended by com.metamatrix.connector.xml.streaming.BaseStreamingExecution
All Implemented Interfaces:
XMLExecution, Execution, ResultSetExecution
Direct Known Subclasses:
FileExecution, HTTPExecution

public abstract class BaseStreamingExecution
extends java.lang.Object
implements XMLExecution


Field Summary
protected  XMLConnectionImpl connection
           
protected  ConnectorEnvironment connEnv
           
protected  ExecutionContext exeContext
           
protected  ExecutionInfo exeInfo
           
protected  ConnectorLogger logger
           
protected  RuntimeMetadata metadata
           
protected  IQuery query
           
protected  java.util.List<ResultProducer> resultProducers
           
protected  java.util.List<java.lang.Object[]> results
           
protected  StreamingResultsProducer rowProducer
           
protected  java.util.List<java.lang.String> xpaths
           
 
Constructor Summary
BaseStreamingExecution(IQuery command, XMLConnectionImpl conn, RuntimeMetadata rtMetadata, ExecutionContext context, ConnectorEnvironment env)
           
 
Method Summary
 void cancel()
          Cancels the execution abnormally.
 void close()
          Terminates the execution normally.
 XMLConnection getConnection()
           
 ExecutionContext getExeContext()
           
 java.util.List next()
          Earlier implementations retrieved the XML in the execute method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.metamatrix.connector.xml.XMLExecution
getStreamProducer
 
Methods inherited from interface org.teiid.connector.api.Execution
execute
 

Field Detail

xpaths

protected java.util.List<java.lang.String> xpaths

rowProducer

protected StreamingResultsProducer rowProducer

results

protected java.util.List<java.lang.Object[]> results

resultProducers

protected java.util.List<ResultProducer> resultProducers

exeInfo

protected ExecutionInfo exeInfo

query

protected IQuery query

metadata

protected RuntimeMetadata metadata

exeContext

protected ExecutionContext exeContext

connEnv

protected ConnectorEnvironment connEnv

connection

protected XMLConnectionImpl connection

logger

protected ConnectorLogger logger
Constructor Detail

BaseStreamingExecution

public BaseStreamingExecution(IQuery command,
                              XMLConnectionImpl conn,
                              RuntimeMetadata rtMetadata,
                              ExecutionContext context,
                              ConnectorEnvironment env)
Method Detail

cancel

public void cancel()
            throws ConnectorException
Description copied from interface: Execution
Cancels the execution abnormally. This will happen via a different thread from the one performing the execution, so should be expected to happen in a multi-threaded scenario.

Specified by:
cancel in interface Execution
Throws:
ConnectorException

close

public void close()
           throws ConnectorException
Description copied from interface: Execution
Terminates the execution normally.

Specified by:
close in interface Execution
Throws:
ConnectorException

next

public java.util.List next()
                    throws ConnectorException,
                           DataNotAvailableException
Earlier implementations retrieved the XML in the execute method. Because this can be any number of documents of any size, this caused memory problems because the xml was completely realized in memory. In this impl the setup work is done in execute and the xml is streamed in the next function.

Specified by:
next in interface ResultSetExecution
Throws:
ConnectorException
DataNotAvailableException

getExeContext

public ExecutionContext getExeContext()
Specified by:
getExeContext in interface XMLExecution

getConnection

public XMLConnection getConnection()
Specified by:
getConnection in interface XMLExecution


Copyright © 2009. All Rights Reserved.