net.sf.farrago.fennel
Interface FennelDbHandle

All Superinterfaces:
ClosableAllocation, FarragoAllocation
All Known Implementing Classes:
FennelDbHandleImpl

public interface FennelDbHandle
extends FarragoAllocation

FennelDbHandle is a public wrapper for FennelStorage, and represents a handle to a loaded Fennel database.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/fennel/FennelDbHandle.java#27 $
Author:
John V. Sichi, turned into an interface by Hunter Payne

Method Summary
 FennelJavaHandle allocateNewObjectHandle(FarragoAllocationOwner owner, Object obj)
          Creates a native handle for a Java object for reference by XML commands.
 void closeAllocation()
          Closes this object.
 long executeCmd(FemCmd cmd)
          Executes a FemCmd object.
 long executeCmd(FemCmd cmd, FennelExecutionHandle execHandle)
          Executes a FemCmd object, associating an optional execution handle with the command.
 String getAccessorXmiForTupleDescriptorTraced(FemTupleDescriptor tupleDesc)
          Constructs a FemTupleAccessor for a FemTupleDescriptor.
 FemDbHandle getFemDbHandle(FarragoMetadataFactory callerFactory)
           
 FarragoMetadataFactory getMetadataFactory()
           
 EigenbaseException handleNativeException(SQLException ex)
           
 void setObjectHandle(long handle, Object obj)
          Changes the object referenced by a handle.
 

Method Detail

getMetadataFactory

FarragoMetadataFactory getMetadataFactory()

getFemDbHandle

FemDbHandle getFemDbHandle(FarragoMetadataFactory callerFactory)
Parameters:
callerFactory - override for metadataFactory
Returns:
FemDbHandle for this database

getAccessorXmiForTupleDescriptorTraced

String getAccessorXmiForTupleDescriptorTraced(FemTupleDescriptor tupleDesc)
Constructs a FemTupleAccessor for a FemTupleDescriptor. This shouldn't be called directly except from FennelRelUtil.

Parameters:
tupleDesc - source FemTupleDescriptor
Returns:
XMI string representation of FemTupleAccessor

executeCmd

long executeCmd(FemCmd cmd)
Executes a FemCmd object. If the command produces a resultHandle, it will be set after successful execution.

Parameters:
cmd - instance of FemCmd with all parameters set
Returns:
return handle as primitive

executeCmd

long executeCmd(FemCmd cmd,
                FennelExecutionHandle execHandle)
Executes a FemCmd object, associating an optional execution handle with the command. If the command produces a resultHandle, it will be set after successful execution.

Parameters:
cmd - instance of FemCmd with all parameters set
execHandle - the execution handle associated with the command; null if there is no associated execution handle
Returns:
return handle as primitive

allocateNewObjectHandle

FennelJavaHandle allocateNewObjectHandle(FarragoAllocationOwner owner,
                                         Object obj)
Creates a native handle for a Java object for reference by XML commands. After this, the Java object cannot be garbage collected until its owner explicitly calls closeAllocation.

Parameters:
owner - the object which will be made responsible for the handle's allocation as a result of this call
obj - object for which to create a handle, or null to create a placeholder handle
Returns:
native handle

setObjectHandle

void setObjectHandle(long handle,
                     Object obj)
Changes the object referenced by a handle.

Parameters:
handle - the handle to change
obj - new object

closeAllocation

void closeAllocation()
Description copied from interface: ClosableAllocation
Closes this object.

Specified by:
closeAllocation in interface ClosableAllocation

handleNativeException

EigenbaseException handleNativeException(SQLException ex)