com.metamatrix.query.processor.proc
Class ProcedureEnvironment

java.lang.Object
  extended by com.metamatrix.query.processor.program.ProgramEnvironment
      extended by com.metamatrix.query.processor.proc.ProcedureEnvironment

public class ProcedureEnvironment
extends ProgramEnvironment

This class defines the environment that procedure language programs run in and what ProgramInstructions can access during execution. This environment holds references to the VariableContext, this variable context is updated with new variables and their values upon execution of the program instructions.


Constructor Summary
ProcedureEnvironment()
          Constructor for ProcedureEnvironment.
 
Method Summary
 void executePlan(java.lang.Object command, java.lang.String rsName)
          Execute a ProcessorPlan and return the tupelSourceID for the results.
 CommandContext getContext()
           
 java.util.List getCurrentRow(java.lang.String rsName)
           
 VariableContext getCurrentVariableContext()
           Get the current VariavleContext on this environment.
 ProcessorDataManager getDataManager()
           
 TupleSource getFinalTupleSource()
           
 java.util.List getOutputElements()
           
 java.util.List getSchema(java.lang.String rsName)
          Get the schema from the tuple source that represents the columns in a result set
 java.util.Set getTempContext()
           
 TempTableStore getTempTableStore()
           
 void incrementProgramCounter()
           
 void initialize(ProcessorPlan plan)
          Initialize the environment with the procedure plan.
 boolean isUpdateProcedure()
           
 boolean iterateCursor(java.lang.String rsName)
           
 void pop()
           
 void push(Program program)
           
 void removeResults(java.lang.String rsName)
          Remove the a data source from the environment.
 void reset()
           
 boolean resultSetExists(java.lang.String rsName)
           
 void setOutputElements(java.util.List outputElements)
           
 void setTempTableStore(TempTableStore tempTableStore)
           
 void setUpdateProcedure(boolean b)
           
 
Methods inherited from class com.metamatrix.query.processor.program.ProgramEnvironment
getProgramStack, peek
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcedureEnvironment

public ProcedureEnvironment()
Constructor for ProcedureEnvironment.

Method Detail

initialize

public void initialize(ProcessorPlan plan)
Initialize the environment with the procedure plan.

Specified by:
initialize in class ProgramEnvironment
Parameters:
plan - XMLPlan

getCurrentVariableContext

public VariableContext getCurrentVariableContext()

Get the current VariavleContext on this environment. The VariableContext is updated with variables and their values by ProgramInstructions that are part of the ProcedurePlan that use this environment.

Returns:
The current VariariableContext.

executePlan

public void executePlan(java.lang.Object command,
                        java.lang.String rsName)
                 throws MetaMatrixComponentException,
                        MetaMatrixProcessingException
Description copied from class: ProgramEnvironment

Execute a ProcessorPlan and return the tupelSourceID for the results. The TupleSourceID could be used by differrent ProgramInstructions that use this environment to access results. The

Specified by:
executePlan in class ProgramEnvironment
Parameters:
command - The command to execute which is a ProcessPlan
rsName - The name of the result set, which can be used later to obtain the tuple source.
Throws:
MetaMatrixComponentException
MetaMatrixProcessingException

pop

public void pop()
         throws MetaMatrixComponentException
Overrides:
pop in class ProgramEnvironment
Throws:
MetaMatrixComponentException
See Also:
ProgramEnvironment.pop()

push

public void push(Program program)
Overrides:
push in class ProgramEnvironment
See Also:
ProgramEnvironment.push(com.metamatrix.query.processor.program.Program)

incrementProgramCounter

public void incrementProgramCounter()
                             throws MetaMatrixComponentException
Overrides:
incrementProgramCounter in class ProgramEnvironment
Throws:
MetaMatrixComponentException
See Also:
ProgramEnvironment.incrementProgramCounter()

getTempContext

public java.util.Set getTempContext()

getCurrentRow

public java.util.List getCurrentRow(java.lang.String rsName)

iterateCursor

public boolean iterateCursor(java.lang.String rsName)
                      throws MetaMatrixComponentException,
                             MetaMatrixProcessingException
Throws:
MetaMatrixComponentException
MetaMatrixProcessingException

removeResults

public void removeResults(java.lang.String rsName)
                   throws MetaMatrixComponentException
Description copied from class: ProgramEnvironment
Remove the a data source from the environment.

Specified by:
removeResults in class ProgramEnvironment
Parameters:
rsName - The name of the result set.
Throws:
MetaMatrixComponentException

getSchema

public java.util.List getSchema(java.lang.String rsName)
                         throws MetaMatrixComponentException
Get the schema from the tuple source that represents the columns in a result set

Parameters:
rsName - the ResultSet name (not a temp group)
Returns:
List of elements
Throws:
QueryProcessorException - if the list of elements is null
MetaMatrixComponentException

resultSetExists

public boolean resultSetExists(java.lang.String rsName)

getDataManager

public ProcessorDataManager getDataManager()

getContext

public CommandContext getContext()

isUpdateProcedure

public boolean isUpdateProcedure()
Returns:

setUpdateProcedure

public void setUpdateProcedure(boolean b)
Parameters:
b -

getFinalTupleSource

public TupleSource getFinalTupleSource()
Returns:

getOutputElements

public java.util.List getOutputElements()

setOutputElements

public void setOutputElements(java.util.List outputElements)

reset

public void reset()

getTempTableStore

public TempTableStore getTempTableStore()
Returns:
Returns the tempTableStore.
Since:
5.5

setTempTableStore

public void setTempTableStore(TempTableStore tempTableStore)
Parameters:
tempTableStore - The tempTableStore to set.
Since:
5.5


Copyright © 2009. All Rights Reserved.