Package org.apache.derby.impl.sql.conn
Class GenericLanguageConnectionFactory
java.lang.Object
org.apache.derby.impl.sql.conn.GenericLanguageConnectionFactory
- All Implemented Interfaces:
CacheableFactory
,ModuleControl
,ModuleSupportable
,PropertySetCallback
,LanguageConnectionFactory
public class GenericLanguageConnectionFactory
extends Object
implements LanguageConnectionFactory, CacheableFactory, PropertySetCallback, ModuleControl, ModuleSupportable
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
FieldsModifier and TypeFieldDescriptionprivate int
private ClassFactory
private DataValueFactory
private ExecutionFactory
private JavaFactory
private int
private OptimizerFactory
private PropertyFactory
private CacheManager
private TypeCompilerFactory
private UUIDFactory
Fields inherited from interface org.apache.derby.iapi.sql.conn.LanguageConnectionFactory
MODULE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply
(String key, Serializable value, Dictionary p) Apply a property change.void
boot
(boolean create, Properties startParams) Start-up method for this instance of the language connection factory.private static Object
bootServiceModule
(boolean create, Object serviceModule, String factoryInterface, Properties properties) Privileged startup.boolean
canSupport
(Properties startParams) this implementation will not support caching of statements.private static Object
findServiceModule
(Object serviceModule, String factoryInterface) Privileged startup.private static Object
findSystemModule
(String factoryInterface) Privileged lookup.Get the ClassFactory to use with this language connectionGet the DataValueFactory to use with this language connectionGet the ExecutionFactory to use with this language connectionGet 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?(package private) static ModuleFactory
Privileged Monitor lookup.protected int
Get the instance # for the next LCC.Get the OptimizerFactory to use with this language connectionGet the PropertyFactory to use with this language connectionprivate static Object
getServiceModule
(Object serviceModule, String factoryInterface) Privileged module lookup.getStatement
(SchemaDescriptor compilationSchema, String statementText, boolean forReadOnly) Get a Statement for the connectionreturns the statement cache that this connection should use; currently there is a statement cache per database.Get the TypeCompilerFactory to use with this language connectionGet 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?void
init
(boolean dbOnly, Dictionary p) Initialize the properties for this callback.map
(String key, Serializable value, Dictionary p) Map a proposed new value for a property to an official value.newLanguageConnectionContext
(ContextManager cm, TransactionController tc, LanguageFactory lf, Database db, String userName, String drdaID, String dbname) 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.protected void
private static Object
startSystemModule
(String factoryInterface) Privileged startup.private int
statementCacheSize
(Properties startParams) void
stop()
Stop this module.boolean
validate
(String key, Serializable value, Dictionary p) Validate a property change.
-
Field Details
-
ef
-
of
-
tcf
-
dvf
-
uuidFactory
-
javaFactory
-
classFactory
-
pf
-
nextLCCInstanceNumber
private int nextLCCInstanceNumber -
cacheSize
private int cacheSize -
singleStatementCache
-
-
Constructor Details
-
GenericLanguageConnectionFactory
public GenericLanguageConnectionFactory()
-
-
Method Details
-
getStatement
public Statement getStatement(SchemaDescriptor compilationSchema, String statementText, boolean forReadOnly) Get a Statement for the connection- Specified by:
getStatement
in interfaceLanguageConnectionFactory
- Parameters:
compilationSchema
- schemastatementText
- the text for the statementforReadOnly
- if concurrency is CONCUR_READ_ONLY- Returns:
- The Statement
-
newLanguageConnectionContext
public LanguageConnectionContext newLanguageConnectionContext(ContextManager cm, TransactionController tc, LanguageFactory lf, Database db, String userName, String drdaID, String dbname) throws StandardException 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.
- Specified by:
newLanguageConnectionContext
in interfaceLanguageConnectionFactory
- Returns:
- a language connection context for the context stack.
- Throws:
StandardException
- the usual -- for the subclass
-
newCacheable
- Specified by:
newCacheable
in interfaceCacheableFactory
-
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?- Specified by:
getUUIDFactory
in interfaceLanguageConnectionFactory
-
getClassFactory
Get the ClassFactory to use with this language connection- Specified by:
getClassFactory
in interfaceLanguageConnectionFactory
-
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?- Specified by:
getJavaFactory
in interfaceLanguageConnectionFactory
-
getExecutionFactory
Get the ExecutionFactory to use with this language connection- Specified by:
getExecutionFactory
in interfaceLanguageConnectionFactory
-
getPropertyFactory
Get the PropertyFactory to use with this language connection- Specified by:
getPropertyFactory
in interfaceLanguageConnectionFactory
-
getOptimizerFactory
Get the OptimizerFactory to use with this language connection- Specified by:
getOptimizerFactory
in interfaceLanguageConnectionFactory
-
getTypeCompilerFactory
Get the TypeCompilerFactory to use with this language connection- Specified by:
getTypeCompilerFactory
in interfaceLanguageConnectionFactory
-
getDataValueFactory
Get the DataValueFactory to use with this language connection- Specified by:
getDataValueFactory
in interfaceLanguageConnectionFactory
-
canSupport
this implementation will not support caching of statements.- Specified by:
canSupport
in interfaceModuleSupportable
- Returns:
- true if this instance can be used, false otherwise.
-
statementCacheSize
-
boot
Start-up method for this instance of the language connection factory. Note these are expected to be booted relative to a Database.- Specified by:
boot
in interfaceModuleControl
- Parameters:
startParams
- The start-up parameters (ignored in this case)- Throws:
StandardException
- Thrown on failure to boot- See Also:
-
getStatementCache
returns the statement cache that this connection should use; currently there is a statement cache per database.- Specified by:
getStatementCache
in interfaceLanguageConnectionFactory
-
stop
public void stop()Stop this module.- Specified by:
stop
in interfaceModuleControl
- See Also:
-
init
Description copied from interface:PropertySetCallback
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.
- Specified by:
init
in interfacePropertySetCallback
- Parameters:
dbOnly
- true if only per-database properties are to be looked atp
- the complete set of per-database properties.
-
validate
Description copied from interface:PropertySetCallback
Validate a property change.- Specified by:
validate
in interfacePropertySetCallback
- Parameters:
key
- Property key for the property being setvalue
- proposed new value for the property being set or null if the property is being dropped.p
- Property set before the change. SettingProperty may read but must never change p.- Returns:
- true if this object was interested in this property, false otherwise.
- Throws:
StandardException
- Thrown on error.- See Also:
-
apply
Description copied from interface:PropertySetCallback
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.- Specified by:
apply
in interfacePropertySetCallback
- Parameters:
key
- Property key for the property being setvalue
- proposed new value for the property being set or null if the property is being dropped.p
- Property set before the change. SettingProperty may read but must never change p.- Returns:
- post commit work for the property change.
- See Also:
-
map
Description copied from interface:PropertySetCallback
Map a proposed new value for a property to an official value. Will only be called after apply() has been called.- Specified by:
map
in interfacePropertySetCallback
- Parameters:
key
- Property key for the property being setvalue
- proposed new value for the property being set or null if the property is being dropped.p
- Property set before the change. SettingProperty may read but must never change p.- Returns:
- new value for the change
- See Also:
-
setValidation
- Throws:
StandardException
-
newParser
- Specified by:
newParser
in interfaceLanguageConnectionFactory
-
getNextLCCInstanceNumber
protected int getNextLCCInstanceNumber()Get the instance # for the next LCC. (Useful for logStatementText=true output.- Returns:
- instance # of next LCC.
-
getMonitor
Privileged Monitor lookup. Must be package private so that user code can't call this entry point. -
startSystemModule
Privileged startup. Must be private so that user code can't call this entry point.- Throws:
StandardException
-
findSystemModule
Privileged lookup. Must be private so that user code can't call this entry point.- Throws:
StandardException
-
bootServiceModule
private static Object bootServiceModule(boolean create, Object serviceModule, String factoryInterface, Properties properties) throws StandardException Privileged startup. Must be private so that user code can't call this entry point.- Throws:
StandardException
-
findServiceModule
private static Object findServiceModule(Object serviceModule, String factoryInterface) throws StandardException Privileged startup. Must be private so that user code can't call this entry point.- Throws:
StandardException
-
getServiceModule
Privileged module lookup. Must be private so that user code can't call this entry point.
-