com.sun.mdm.index.query
Class AssemblerEngineImpl

java.lang.Object
  extended bycom.sun.mdm.index.query.AssemblerEngineImpl
All Implemented Interfaces:
AssemblerEngine, java.lang.Cloneable

public class AssemblerEngineImpl
extends java.lang.Object
implements AssemblerEngine, java.lang.Cloneable

This AssemblerEngine is responsible to initialize the data structures that are used during Assembling. It holds reference to Array of QueryResultSet and call them in a loop until the next root composite object has been fetched and assembled. The actual assembling for each JDBC resultset is delegated to QueryResultSet.


Constructor Summary
AssemblerEngineImpl()
          Creates a new instance of AssemblerEngine
 
Method Summary
 java.lang.Object clone()
          clones the AssemblerEngine
 void close()
          close the underlying connection.
 void finalizer()
          finalizer closes the database connection
 boolean hasNext()
          returns true if there is another composite value object else returns false.
 void initCompile(SQLDescriptor[] sqlDesc, AssembleDescriptor assDesc)
          part of compilation is to create CreateObjectList and create AssembleObjectState These will be used during run time execution of engine.
 void initRun(java.sql.Connection con, java.sql.ResultSet[] resultSets, java.sql.Statement[] statements, int maxRows)
          This initialises data structures that are used during assembling.
 void initRun(java.sql.Connection con, java.sql.ResultSet[] resultSets, java.sql.Statement[] statements, int maxRows, boolean closeDbConnection)
          This initialises data structures that are used during assembling.
 java.lang.Object next()
          get the next Root Value object.
 boolean setDbConnectionCondition()
          Gets the value of mCloseDbConnection.
 void setDbConnectionCondition(boolean val)
          Sets the value of mCloseDbConnection.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssemblerEngineImpl

public AssemblerEngineImpl()
Creates a new instance of AssemblerEngine

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
clones the AssemblerEngine

Specified by:
clone in interface AssemblerEngine
Returns:
clone of this engine
Throws:
java.lang.CloneNotSupportedException - CloneNotSupportedException

close

public void close()
           throws QMException
close the underlying connection.

Specified by:
close in interface AssemblerEngine
Throws:
QMException - QMException

finalizer

public void finalizer()
               throws QMException
finalizer closes the database connection

Throws:
QMException - QMException

hasNext

public boolean hasNext()
                throws QMException
returns true if there is another composite value object else returns false.

Specified by:
hasNext in interface AssemblerEngine
Returns:
true or false
Throws:
QMException - QMException

initCompile

public void initCompile(SQLDescriptor[] sqlDesc,
                        AssembleDescriptor assDesc)
                 throws QMException
part of compilation is to create CreateObjectList and create AssembleObjectState These will be used during run time execution of engine.

Specified by:
initCompile in interface AssemblerEngine
Parameters:
sqlDesc - SQLDescriptor[]
assDesc - AssembleDescriptor
Throws:
QMException - QMException

initRun

public void initRun(java.sql.Connection con,
                    java.sql.ResultSet[] resultSets,
                    java.sql.Statement[] statements,
                    int maxRows)
             throws QMException
This initialises data structures that are used during assembling.

Specified by:
initRun in interface AssemblerEngine
Parameters:
con - JDBC DataSource Connection
resultSets - ResultSet[] that contain multiple ResultSets executed by QueryManager
maxRows - Maximum Rows
statements - Statement[]
Throws:
QMException - QMException

initRun

public void initRun(java.sql.Connection con,
                    java.sql.ResultSet[] resultSets,
                    java.sql.Statement[] statements,
                    int maxRows,
                    boolean closeDbConnection)
             throws QMException
This initialises data structures that are used during assembling.

Specified by:
initRun in interface AssemblerEngine
Parameters:
con - JDBC DataSource Connection
resultSets - ResultSet[] that contain multiple ResultSets executed by QueryManager
maxRows - maximum number of rows
closeDbConnection - set to true if the database connection is to be closed by the AssemblerEngineImpl, false if some other calling class is to close the database connection instead
statements - Statement[]
Throws:
QMException - QMException

next

public java.lang.Object next()
                      throws QMException
get the next Root Value object.

Specified by:
next in interface AssemblerEngine
Returns:
return next Root of Composite Value Object
Throws:
QMException - QMException

setDbConnectionCondition

public boolean setDbConnectionCondition()
Gets the value of mCloseDbConnection.

Returns:
value of mCloseDbConnection.

setDbConnectionCondition

public void setDbConnectionCondition(boolean val)
Sets the value of mCloseDbConnection.

Parameters:
val - value to which mCloseDbConnection is to be set.


Sun Microsystems, Inc.