Top Description Fields Constructors Methods
org.apache.derby.impl.sql.conn

public Class GenericLanguageConnectionFactory

extends Object
implements LanguageConnectionFactory, CacheableFactory, PropertySetCallback, ModuleControl, ModuleSupportable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.monitor.ModuleSupportable, org.apache.derby.iapi.services.monitor.ModuleControl, org.apache.derby.iapi.services.property.PropertySetCallback, org.apache.derby.iapi.services.cache.CacheableFactory, org.apache.derby.iapi.sql.conn.LanguageConnectionFactory
Imports
org.apache.derby.iapi.sql.conn.LanguageConnectionFactory, .LanguageConnectionContext, org.apache.derby.iapi.sql.compile.CompilerContext, .TypeCompilerFactory, .Parser, .OptimizerFactory, org.apache.derby.iapi.sql.LanguageFactory, .Statement, org.apache.derby.impl.sql.GenericStatement, org.apache.derby.iapi.services.uuid.UUIDFactory, org.apache.derby.iapi.services.compiler.JavaFactory, org.apache.derby.iapi.services.loader.ClassFactory, org.apache.derby.iapi.db.Database, org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.property.PropertyFactory, .PropertyUtil, .PropertySetCallback, org.apache.derby.iapi.types.DataValueFactory, org.apache.derby.iapi.sql.execute.ExecutionFactory, org.apache.derby.iapi.sql.dictionary.SchemaDescriptor, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.monitor.Monitor, .ModuleControl, .ModuleFactory, .ModuleSupportable, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.services.cache.CacheFactory, .CacheManager, .CacheableFactory, .Cacheable, org.apache.derby.shared.common.reference.SQLState, .Property, .EngineType, java.util.Properties, .Dictionary, java.io.Serializable, org.apache.derby.iapi.util.IdUtil, .StringUtil, org.apache.derby.iapi.services.daemon.Serviceable, org.apache.derby.iapi.store.raw.data.DataFactory

LanguageConnectionFactory generates all of the items a language system needs that is specific to a particular connection. Alot of these are other factories.

Field Summary

Modifier and TypeField and Description
private int
private ClassFactory
private DataValueFactory
private ExecutionFactory
private JavaFactory
private int
private OptimizerFactory
private PropertyFactory
private CacheManager
private TypeCompilerFactory
private UUIDFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Serviceable
apply(String
Property key for the property being set
key
,
Serializable
proposed new value for the property being set or null if the property is being dropped.
value
,
Dictionary<K, V>
Property set before the change. SettingProperty may read but must never change p.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.apply.

Apply a property change.

public void
boot(boolean
True if the database should be created
create
,
Properties
The start-up parameters (ignored in this case)
startParams
)

Implements org.apache.derby.iapi.services.monitor.ModuleControl.boot.

Start-up method for this instance of the language connection factory.

private static Object
bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final Properties properties)

Must be private so that user code can't call this entry point.

public boolean
canSupport(Properties startParams)

Implements org.apache.derby.iapi.services.monitor.ModuleSupportable.canSupport.

this implementation will not support caching of statements.

private static Object
findServiceModule(final Object serviceModule, final String factoryInterface)

Must be private so that user code can't call this entry point.

private static Object
findSystemModule(final String factoryInterface)

Must be private so that user code can't call this entry point.

public ClassFactory
getClassFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getClassFactory.

Get the ClassFactory to use with this language connection

public DataValueFactory
getDataValueFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getDataValueFactory.

Get the DataValueFactory to use with this language connection

public ExecutionFactory
getExecutionFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getExecutionFactory.

Get the ExecutionFactory to use with this language connection

public JavaFactory
getJavaFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getJavaFactory.

Get the JavaFactory to use with this language connection REMIND: this is only used by the compiler; should there be a compiler module control class to boot compiler-only stuff?

pack-priv static ModuleFactory
getMonitor()

Must be package private so that user code can't call this entry point.

protected synchronized int

Returns:

instance # of next LCC.
getNextLCCInstanceNumber
()

Get the instance # for the next LCC.

public OptimizerFactory
getOptimizerFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getOptimizerFactory.

Get the OptimizerFactory to use with this language connection

public PropertyFactory
getPropertyFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getPropertyFactory.

Get the PropertyFactory to use with this language connection

private static Object
getServiceModule(final Object serviceModule, final String factoryInterface)

Must be private so that user code can't call this entry point.

public Statement

Returns:

The Statement
getStatement
(SchemaDescriptor
schema
compilationSchema
,
String
the text for the statement
statementText
,
boolean
if concurrency is CONCUR_READ_ONLY
forReadOnly
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getStatement.

Get a Statement for the connection

public CacheManager
getStatementCache()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getStatementCache.

returns the statement cache that this connection should use; currently there is a statement cache per database.

public TypeCompilerFactory
getTypeCompilerFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getTypeCompilerFactory.

Get the TypeCompilerFactory to use with this language connection

public UUIDFactory
getUUIDFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getUUIDFactory.

Get the UUIDFactory to use with this language connection REMIND: this is only used by the compiler; should there be a compiler module control class to boot compiler-only stuff?

public void
init(boolean
true if only per-database properties are to be looked at
dbOnly
,
Dictionary<K, V>
the complete set of per-database properties.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.init.

Initialize the properties for this callback.

public Serializable
map(String
Property key for the property being set
key
,
Serializable
proposed new value for the property being set or null if the property is being dropped.
value
,
Dictionary<K, V>
Property set before the change. SettingProperty may read but must never change p.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.map.

Map a proposed new value for a property to an official value.

public Cacheable
public LanguageConnectionContext

Returns:

a language connection context for the context stack.
newLanguageConnectionContext
(ContextManager cm, TransactionController tc, LanguageFactory lf, Database db, String userName, String drdaID, String dbname)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.newLanguageConnectionContext.

Get a LanguageConnectionContext.

public Parser
protected void
private static Object
startSystemModule(final String factoryInterface)

Must be private so that user code can't call this entry point.

private int
public void
public boolean
validate(String
Property key for the property being set
key
,
Serializable
proposed new value for the property being set or null if the property is being dropped.
value
,
Dictionary<K, V>
Property set before the change. SettingProperty may read but must never change p.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.validate.

Validate a property change.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheSizeback to summary
private int cacheSize
classFactoryback to summary
private ClassFactory classFactory
dvfback to summary
private DataValueFactory dvf
efback to summary
private ExecutionFactory ef
javaFactoryback to summary
private JavaFactory javaFactory
nextLCCInstanceNumberback to summary
private int nextLCCInstanceNumber
ofback to summary
private OptimizerFactory of
pfback to summary
private PropertyFactory pf
singleStatementCacheback to summary
private CacheManager singleStatementCache
tcfback to summary
private TypeCompilerFactory tcf
uuidFactoryback to summary
private UUIDFactory uuidFactory

Constructor Detail

GenericLanguageConnectionFactoryback to summary
public GenericLanguageConnectionFactory()

Method Detail

applyback to summary
public Serviceable apply(String key, Serializable value, Dictionary<K, V> p)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.apply.

Doc from org.apache.derby.iapi.services.property.PropertySetCallback.apply.

Apply a property change. Will only be called after validate has been called and only if validate returned true. If this method is called then the new value is the value to be used, ie. the property is not set in the overriding JVM system set.

Parameters
key:String

Property key for the property being set

value:Serializable

proposed new value for the property being set or null if the property is being dropped.

p:Dictionary<K, V>

Property set before the change. SettingProperty may read but must never change p.

Returns:Serviceable

post commit work for the property change.

See Also
PropertySetCallback#apply
bootback to summary
public void boot(boolean create, Properties startParams) throws StandardException

Implements org.apache.derby.iapi.services.monitor.ModuleControl.boot.

Start-up method for this instance of the language connection factory. Note these are expected to be booted relative to a Database.

Parameters
create:boolean

Doc from org.apache.derby.iapi.services.monitor.ModuleControl.boot.

True if the database should be created

startParams:Properties

The start-up parameters (ignored in this case)

Exceptions
StandardException:
Thrown on failure to boot
bootServiceModuleback to summary
private static Object bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final Properties properties) throws StandardException

Must be private so that user code can't call this entry point.

canSupportback to summary
public boolean canSupport(Properties startParams)

Implements org.apache.derby.iapi.services.monitor.ModuleSupportable.canSupport.

this implementation will not support caching of statements.

Returns:boolean

Doc from org.apache.derby.iapi.services.monitor.ModuleSupportable.canSupport.

true if this instance can be used, false otherwise.

findServiceModuleback to summary
private static Object findServiceModule(final Object serviceModule, final String factoryInterface) throws StandardException

Must be private so that user code can't call this entry point.

findSystemModuleback to summary
private static Object findSystemModule(final String factoryInterface) throws StandardException

Must be private so that user code can't call this entry point.

getClassFactoryback to summary
public ClassFactory getClassFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getClassFactory.

Get the ClassFactory to use with this language connection

getDataValueFactoryback to summary
public DataValueFactory getDataValueFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getDataValueFactory.

Get the DataValueFactory to use with this language connection

getExecutionFactoryback to summary
public ExecutionFactory getExecutionFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getExecutionFactory.

Get the ExecutionFactory to use with this language connection

getJavaFactoryback to summary
public JavaFactory getJavaFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getJavaFactory.

Get the JavaFactory to use with this language connection REMIND: this is only used by the compiler; should there be a compiler module control class to boot compiler-only stuff?

getMonitorback to summary
pack-priv static ModuleFactory getMonitor()

Must be package private so that user code can't call this entry point.

getNextLCCInstanceNumberback to summary
protected synchronized int getNextLCCInstanceNumber()

Get the instance # for the next LCC. (Useful for logStatementText=true output.

Returns:int

instance # of next LCC.

getOptimizerFactoryback to summary
public OptimizerFactory getOptimizerFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getOptimizerFactory.

Get the OptimizerFactory to use with this language connection

getPropertyFactoryback to summary
public PropertyFactory getPropertyFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getPropertyFactory.

Get the PropertyFactory to use with this language connection

getServiceModuleback to summary
private static Object getServiceModule(final Object serviceModule, final String factoryInterface)

Must be private so that user code can't call this entry point.

getStatementback to summary
public Statement getStatement(SchemaDescriptor compilationSchema, String statementText, boolean forReadOnly)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getStatement.

Get a Statement for the connection

Parameters
compilationSchema:SchemaDescriptor

schema

statementText:String

the text for the statement

forReadOnly:boolean

if concurrency is CONCUR_READ_ONLY

Returns:Statement

The Statement

getStatementCacheback to summary
public CacheManager getStatementCache()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getStatementCache.

returns the statement cache that this connection should use; currently there is a statement cache per database.

getTypeCompilerFactoryback to summary
public TypeCompilerFactory getTypeCompilerFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getTypeCompilerFactory.

Get the TypeCompilerFactory to use with this language connection

getUUIDFactoryback to summary
public UUIDFactory getUUIDFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.getUUIDFactory.

Get the UUIDFactory to use with this language connection REMIND: this is only used by the compiler; should there be a compiler module control class to boot compiler-only stuff?

initback to summary
public void init(boolean dbOnly, Dictionary<K, V> p)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.init.

Doc from org.apache.derby.iapi.services.property.PropertySetCallback.init.

Initialize the properties for this callback. Called when addPropertySetNotification() is called with a non-null transaction controller. This allows code to set read its initial property values at boot time.

Code within an init() method should use the 3 argument PropertyUtil method getPropertyFromSet() to obtain a property's value.

Parameters
dbOnly:boolean

true if only per-database properties are to be looked at

p:Dictionary<K, V>

the complete set of per-database properties.

mapback to summary
public Serializable map(String key, Serializable value, Dictionary<K, V> p)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.map.

Doc from org.apache.derby.iapi.services.property.PropertySetCallback.map.

Map a proposed new value for a property to an official value. Will only be called after apply() has been called.

Parameters
key:String

Property key for the property being set

value:Serializable

proposed new value for the property being set or null if the property is being dropped.

p:Dictionary<K, V>

Property set before the change. SettingProperty may read but must never change p.

Returns:Serializable

new value for the change

See Also
PropertySetCallback#map
newCacheableback to summary
public Cacheable newCacheable(CacheManager cm)

Implements org.apache.derby.iapi.services.cache.CacheableFactory.newCacheable.

newLanguageConnectionContextback to summary
public LanguageConnectionContext newLanguageConnectionContext(ContextManager cm, TransactionController tc, LanguageFactory lf, Database db, String userName, String drdaID, String dbname) throws StandardException

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.newLanguageConnectionContext.

Get a LanguageConnectionContext. this holds things we want to remember about activity in the language system, where this factory holds things that are pretty stable, like other factories.

The returned LanguageConnectionContext is intended for use only by the connection that requested it.

Returns:LanguageConnectionContext

a language connection context for the context stack.

Exceptions
StandardException:
the usual -- for the subclass
newParserback to summary
public Parser newParser(CompilerContext cc)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionFactory.newParser.

setValidationback to summary
protected void setValidation() throws StandardException
startSystemModuleback to summary
private static Object startSystemModule(final String factoryInterface) throws StandardException

Must be private so that user code can't call this entry point.

statementCacheSizeback to summary
private int statementCacheSize(Properties startParams)
stopback to summary
public void stop()

Implements org.apache.derby.iapi.services.monitor.ModuleControl.stop.

Stop this module.

validateback to summary
public boolean validate(String key, Serializable value, Dictionary<K, V> p) throws StandardException

Implements org.apache.derby.iapi.services.property.PropertySetCallback.validate.

Doc from org.apache.derby.iapi.services.property.PropertySetCallback.validate.

Validate a property change.

Parameters
key:String

Property key for the property being set

value:Serializable

proposed new value for the property being set or null if the property is being dropped.

p:Dictionary<K, V>

Property set before the change. SettingProperty may read but must never change p.

Returns:boolean

true if this object was interested in this property, false otherwise.

Exceptions
StandardException:
Thrown on error.
See Also
PropertySetCallback#validate