|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.keel.core.container.AbstractKeelServiceable
org.keel.services.persist.base.AbstractPersistentFactory
A PersistentFactory is a class that generates new Persistent objects, Transactions, and Queries
| Field Summary | |
private AuthorizationManager |
byPassAuthManager |
private boolean |
configured |
protected DatabaseType |
databaseTypeDatabaseType service we use. |
protected DataSourceComponent |
dataSourceData source service itself. |
protected java.lang.String |
dataSourceNameThe name of the data source we will access for all Persistent objects created with this factory. |
private java.lang.String |
dbTypeNameThe database type service we will use for all of our database-specific information defined with the element |
private boolean |
initialized |
protected Context |
keelContextThe Keel context for getting user env. |
protected static Logger |
log |
protected java.util.Map |
metas |
private Configuration |
myConfig |
protected java.lang.String |
myNameName of this instance of the PersistentFactory |
protected java.util.Map |
schemaDescrips |
protected java.util.Map |
schemasA HashMap of the schema configurations we have available, for rapid access to the correct schema |
private java.lang.String |
securityThe (optional) name of another persistent factory that should be used for all accesses to the keel standard security objects (e.g. |
| Fields inherited from class org.keel.core.container.AbstractKeelServiceable |
|
| Fields inherited from interface org.keel.services.persist.PersistentFactory |
ROLE |
| Constructor Summary | |
AbstractPersistentFactory() |
|
| Method Summary | |
void |
addInputs(ModelResponse res, Persistent p)Convenience method to add an Input ResponseElement to the specified ModelResponse for every field in the supplied Persistent. |
void |
addOutputs(ModelResponse res, Persistent p)Convenience method to add an Output ResponseElement to the specified ModelResponse for every field in the supplied Persistent. |
protected void |
addPersistentToOutput(java.lang.String[] fields, Persistent p, Output o, ModelResponse response)Adds the requested values of the Persistent to the given Output. |
void |
addQuery(ModelResponse res, Persistent p, java.lang.String outputName)Add an entire set of Persistents to a model reponse as Outputs, not just one. |
void |
addQuery(ModelResponse res, Persistent p, java.lang.String outputName, java.lang.String[] fieldNames)Convenience method to add a List of nested Output ResponseElements to the specified ModelRepsonse. |
abstract Transaction |
begin()Begin a new transaction and pass the transaction back to the caller. |
void |
configure(Configuration configuration)Pass the Configuration to the Configurable class. |
abstract Persistent |
create(java.lang.String name)Create a new persistent object with the specified name |
Persistent |
create(java.lang.String name, Transaction trx)Create a new Persistent which participates in a transaction |
abstract void |
createIndices() |
abstract void |
createIndices(java.lang.String schema) |
protected void |
createRecords(Configuration config, java.lang.String persistentName, PersistentMetaData pmd) |
abstract void |
createTables()Initialize all schemas defined in this persistent factory, creating all tables as required. |
abstract void |
createTables(java.lang.String schema)Initialize the specified schema, creating all tables as required. |
void |
dispose()The dispose operation is called at the end of a components lifecycle. |
abstract void |
dropIndices() |
abstract void |
dropIndices(java.lang.String schema) |
void |
enableLogging(Logger newLog)Provide component with a logger. |
protected AuthorizationManager |
getByPassAuthManager() |
protected Configuration |
getConfiguration() |
PersistentFactory |
getFactory(java.lang.String newName)A convenience method which gets another factory (other than the current one). |
java.lang.String |
getInstanceIdentifier() |
Context |
getKeelContext() |
protected PersistentMetaData |
getMetaData(java.lang.String persistentName) |
java.lang.String |
getName()A different factory is used to talk to each different database that the application requires. |
java.util.Set |
getPersistents(java.lang.String schemaName)Return a set of names, one for each persistent in the given schema |
Configuration |
getSchemaConfiguration(java.lang.String schemaName)Get the Configuration object for the specified schema, if this schema is defined in this PersistentFactory |
java.lang.String |
getSchemaDescription(java.lang.String schemaName)Get the human-readable description of the specified schema |
java.util.Set |
getSchemas()Return a set of Schema names this factory knows about. |
java.lang.String |
getSecurity()Return the name of an another persistent factory where we find the definitions of the Keel security persistent objects. |
void |
initialize()Initialize the component. |
protected boolean |
isConfigured() |
private java.lang.String |
processedAttribValue(java.lang.String attribValue) |
void |
recycle()The only thing that changes when we recycle an instance of a PersistentFactory is the context, specifying the user who's actually using this instance of the factory. |
void |
setKeelContext(Context keelContext) |
protected void |
setName(java.lang.String newName) |
private void |
setSecurity(java.lang.String newSec) |
| Methods inherited from class org.keel.core.container.AbstractKeelServiceable |
getService, getService, getService, getService, getServiceManager, getServiceSelector, releaseService, releaseServices, service |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static Logger log
protected Context keelContext
protected java.lang.String dataSourceName
private java.lang.String dbTypeName
protected DataSourceComponent dataSource
protected DatabaseType databaseType
protected java.lang.String myName
protected java.util.Map schemas
protected java.util.Map schemaDescrips
protected java.util.Map metas
private boolean configured
private boolean initialized
private AuthorizationManager byPassAuthManager
private Configuration myConfig
private java.lang.String security
| Constructor Detail |
public AbstractPersistentFactory()
| Method Detail |
protected AuthorizationManager getByPassAuthManager()
protected Configuration getConfiguration()
public void recycle()
recycle in interface Recyclablepublic void dispose()
Disposabledispose in interface Disposablepublic final java.util.Set getSchemas()
PersistentFactorygetSchemas in interface PersistentFactorypublic final java.lang.String getSchemaDescription(java.lang.String schemaName)
PersistentFactorygetSchemaDescription in interface PersistentFactoryschemaName - The name of the schema
public abstract Persistent create(java.lang.String name)
throws PersistenceException
create in interface PersistentFactoryPersistenceExceptionpublic Configuration getSchemaConfiguration(java.lang.String schemaName)
PersistentFactorygetSchemaConfiguration in interface PersistentFactoryschemaName - The name of the schema to retrieve configuration for
public final java.util.Set getPersistents(java.lang.String schemaName)
throws PersistenceException
getPersistents in interface PersistentFactoryPersistenceException
protected final PersistentMetaData getMetaData(java.lang.String persistentName)
throws PersistenceException,
ConfigurationException,
ServiceException
PersistenceExceptionConfigurationExceptionServiceException
public final Persistent create(java.lang.String name,
Transaction trx)
throws PersistenceException
create in interface PersistentFactoryPersistenceException
public final void configure(Configuration configuration)
throws ConfigurationException
ConfigurableConfiguration to the Configurable class.
configure in interface Configurableconfiguration - the class configurations. Must not be null.ConfigurationException - if an error occurs
public final PersistentFactory getFactory(java.lang.String newName)
throws PersistenceException
PersistentFactorygetFactory in interface PersistentFactorynewName - The name of the factory being requestedPersistenceException - If the factory cannot be initialized, or there is no such factory configured
public void initialize()
throws PersistenceException
Initializableinitialize in interface InitializablePersistenceException
public abstract Transaction begin()
throws PersistenceException
begin in interface PersistentFactoryPersistenceExceptionprotected final void setName(java.lang.String newName)
public final java.lang.String getName()
PersistentFactorygetName in interface PersistentFactorypublic final void enableLogging(Logger newLog)
LogEnabledenableLogging in interface LogEnablednewLog - the logger. Must not be null.
public abstract void createTables(java.lang.String schema)
throws PersistenceException
PersistentFactorycreateTables in interface PersistentFactoryPersistenceException
protected final void createRecords(Configuration config,
java.lang.String persistentName,
PersistentMetaData pmd)
throws ConfigurationException
ConfigurationException
private java.lang.String processedAttribValue(java.lang.String attribValue)
throws PersistenceException
attribValue -PersistenceException
public abstract void createTables()
throws PersistenceException
PersistentFactorycreateTables in interface PersistentFactoryPersistenceException
public final void addInputs(ModelResponse res,
Persistent p)
throws PersistenceException,
ModelException
PersistentFactoryaddInputs in interface PersistentFactoryres - A ModelResponse objectp - A persistent to be used to create InputsModelException - If a problem occurs creating the InputsPersistenceException - If a problem occurs retrieving the fields
public final void addOutputs(ModelResponse res,
Persistent p)
throws PersistenceException,
ModelException
PersistentFactoryaddOutputs in interface PersistentFactoryres - A ModelResponse objectp - A persistent to be used to create OutputsModelException - If an exception occurs creating the outputs.PersistenceException - If an exception occurs retrieving the fields
public final void addQuery(ModelResponse res,
Persistent p,
java.lang.String outputName)
throws PersistenceException,
ModelException
addQuery in interface PersistentFactoryres - The current model response being prepared for the UIp - A persistent that has been used in a "query" (the method, not to be confused with the query service, which is something else)outputName - The name of the top-level output inside which all the other outputs will be nested.PersistenceExceptionModelException#addOutputs(ModelReponse, Persistent)
public final void addQuery(ModelResponse res,
Persistent p,
java.lang.String outputName,
java.lang.String[] fieldNames)
throws PersistenceException,
ModelException
addQuery in interface PersistentFactoryres - A ModelResponse objectp - A persistent to be used to create OutputsoutputName - Name of Output ResponseElement to add the List to.fieldNames - The fields to be added to the Output. Fields will be added in the same order as in the list. As an added bonus, the records will be sorted on the order of the fields in the list.PersistenceException - If an exception occurs retrieving the fieldsModelException - If an exception occurs creating the outputs.#addOutputs(ModelReponse, Persistent)
protected final void addPersistentToOutput(java.lang.String[] fields,
Persistent p,
Output o,
ModelResponse response)
throws ModelException,
PersistenceException
fields - The names of the Database fields being addedp - The Peristent with the values being reado - The Output to add the values toresponse - The ModelResponse being used to generate the OutputsModelExceptionPersistenceExceptionprivate void setSecurity(java.lang.String newSec)
public final java.lang.String getSecurity()
PersistentFactorygetSecurity in interface PersistentFactorypublic final java.lang.String getInstanceIdentifier()
public abstract void createIndices()
throws PersistenceException
PersistenceException
public abstract void createIndices(java.lang.String schema)
throws PersistenceException
PersistenceException
public abstract void dropIndices()
throws PersistenceException
PersistenceException
public abstract void dropIndices(java.lang.String schema)
throws PersistenceException
PersistenceException
public final void setKeelContext(Context keelContext)
throws ContextException
setKeelContext in interface KeelContextualizableContextExceptionKeelContextualizable.setKeelContext(org.apache.avalon.framework.context.Context)public final Context getKeelContext()
getKeelContext in interface KeelContextualizableKeelContextualizable.getKeelContext()protected boolean isConfigured()
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||