|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.storage.StorageManagerFactory
org.mmbase.storage.implementation.database.DatabaseStorageManagerFactory
A storage manager factory for database storages. This factory sets up a datasource for connecting to the database. If you specify the datasource URI in the 'datasource' property in mmbaseroot.xml configuration file, the factory attempts to obtain the datasource from the application server. If this fails, or no datasource URI is given, it attempts to use the connectivity offered by the JDBC Module, which is then wrapped in a datasource. Note that if you provide a datasource you should make the JDBC Module inactive to prevent the module from interfering with the storage layer.
| Field Summary | |
protected String |
catalog
The catalog used by this storage. |
protected DataSource |
dataSource
The datasource in use by this factory. |
protected boolean |
supportsTransactions
Whether transactions and rollback are supported by this database |
protected int |
transactionIsolation
The transaction isolation level available for this storage. |
| Fields inherited from class org.mmbase.storage.StorageManagerFactory |
attributes, changeManager, disallowedFields, getSurrogator, mmbase, queryHandler, queryHandlerClasses, setSurrogator, storageManagerClass, typeMappings |
| Constructor Summary | |
DatabaseStorageManagerFactory()
|
|
| Method Summary | |
static boolean |
checkBinaryFileBasePath(String basePath)
Tries to ensure that basePath existis and is writable. |
protected DataSource |
createDataSource(String binaryFileBasePath)
|
String |
getBinaryFileBasePath()
As getBinaryFileBasePath(boolean) with true |
String |
getBinaryFileBasePath(boolean check)
Returns the base path for 'binary file' |
String |
getCatalog()
Returns the name of the catalog used by this storage ( null if no catalog is used). |
String |
getDatabaseName()
Doing some best effort to get a 'database name'. |
DataSource |
getDataSource()
Returns the DataSource associated with this factory. |
StorageReader |
getDocumentReader()
Locates and opens the storage configuration document, if available. The configuration document to open can be set in mmbasereoot (using the storage property). The property should point to a resource which is to be present in the MMBase classpath. Overriding factories may provide ways to auto-detect the location of a configuration file. MMBase determine it using information gained from the datasource, and the lookup.xml file in the database configuration directory Storage configuration files should become resource files, and configurable using a storageresource property. |
double |
getVersion()
Returns the version of this factory implementation. |
protected Object |
instantiateBasicHandler(Class handlerClass)
Instantiate a basic handler object using the specified class. |
protected Object |
instantiateChainedHandler(Class handlerClass,
Object handler)
Instantiate a chained handler object using the specified class. |
protected SearchQueryHandler |
instantiateQueryHandler(Object data)
Instantiate a SearchQueryHandler object using the specified object. |
protected void |
load()
Opens and reads the storage configuration document. |
static void |
main(String[] args)
|
boolean |
supportsTransactions()
Returns whether transactions, and specifically rollback, is supported in the storage layer. |
| Methods inherited from class org.mmbase.storage.StorageManagerFactory |
getAttribute, getAttributes, getChangeManager, getDisallowedFields, getGetSurrogator, getMMBase, getScheme, getScheme, getSearchQueryHandler, getSetSurrogator, getStorageIdentifier, getStorageIdentifier, getStorageManager, getTimeZoneOffset, getTypeMappings, hasOption, init, newInstance, newInstance, setAttribute, setAttributes, setDisallowedFields, setOption, setScheme |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected String catalog
protected DataSource dataSource
protected int transactionIsolation
protected boolean supportsTransactions
| Constructor Detail |
public DatabaseStorageManagerFactory()
| Method Detail |
public double getVersion()
StorageManagerFactory
getVersion in class StorageManagerFactorypublic boolean supportsTransactions()
StorageManagerFactory
supportsTransactions in class StorageManagerFactorytrue if trasnactions are supportedpublic String getCatalog()
StorageManagerFactorynull if no catalog is used).
getCatalog in class StorageManagerFactorypublic String getDatabaseName()
public DataSource getDataSource()
protected DataSource createDataSource(String binaryFileBasePath)
protected void load()
throws StorageException
load in class StorageManagerFactoryStorageException - if the storage could not be accessed or necessary configuration data is missing or invalid
public StorageReader getDocumentReader()
throws StorageException
getDocumentReader in class StorageManagerFactoryStorageException - if the storage could not be accessed while determining the database typepublic String getBinaryFileBasePath()
getBinaryFileBasePath(boolean) with true
public String getBinaryFileBasePath(boolean check)
public static boolean checkBinaryFileBasePath(String basePath)
basePath - a Directory nameprotected Object instantiateBasicHandler(Class handlerClass)
StorageManagerFactory
instantiateBasicHandler in class StorageManagerFactoryhandlerClass - the class to instantuate teh object with
protected Object instantiateChainedHandler(Class handlerClass,
Object handler)
StorageManagerFactory
instantiateChainedHandler in class StorageManagerFactoryhandlerClass - the class to instantuate teh object withhandler - a handler thatw a sinstantiated previously.
this handler should be passed to the new handler class during or
after constrcution, so the ne whandler can 'chain' any events it cannot
handle to this class.
protected SearchQueryHandler instantiateQueryHandler(Object data)
StorageManagerFactory
instantiateQueryHandler in class StorageManagerFactorydata - the object to instantuate a SearchQueryHandler object withpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||