public abstract class AbstractDaoFactory extends Object implements DaoFactory, rsbaselib.configuration.Configurable
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractDaoFactory.MyDaoListener
Listener for DAO events.
|
protected class |
AbstractDaoFactory.TransactionContext
Keeps track of transaction creation.
|
| Constructor and Description |
|---|
AbstractDaoFactory()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDaoFactoryListener(DaoFactoryListener listener)
Adds a factory listener.
|
void |
afterConfiguration() |
void |
beforeConfiguration() |
void |
begin()
Begins a transaction.
|
void |
commit()
Commits a transaction.
|
void |
configure(org.apache.commons.configuration.Configuration cfg) |
protected GeneralDAO<?,?> |
createDAO(org.apache.commons.configuration.Configuration mainCfg,
String key)
Creates an DAO from the configuration
|
protected TransactionManager |
createTransactionManager()
Creates a new transaction manager.
|
protected void |
fireDaoFactoryEvent(DaoFactoryEvent event)
Fires a factory event.
|
DaoMaster |
getDaoMaster(String id)
Returns the DAO master with given ID.
|
protected org.slf4j.Logger |
getLog()
Returns the logger object.
|
String |
getParameter(String name)
Returns the factory parameter.
|
Iterator<String> |
getParameterKeys()
Returns an iterator of all property keys.
|
URL |
getParameterUrl(String name)
Returns the factory parameter as a URL.
|
Object |
getProperty(String name)
Returns the factory property.
|
Transaction |
getTransaction()
Returns the current active transaction.
|
TransactionManager |
getTransactionManager()
Returns the TX manager used.
|
URLTransformer |
getUrlTransformer()
Returns the urlTransformer.
|
DaoMaster |
loadDaoMaster(org.apache.commons.configuration.SubnodeConfiguration config)
Loads an object from a configuration.
|
void |
modelChanged()
Registers the current context that the model changed underneath.
|
void |
removeDaoFactoryListener(DaoFactoryListener listener)
Removes a factory listener.
|
void |
rollback()
Rolls back a transaction.
|
void |
setDaoMaster(String id,
DaoMaster daoMaster)
Sets the DAO master.
|
void |
setProperty(String name,
Object value)
Sets the property.
|
void |
setTransactionManager(TransactionManager txManager)
Sets the given TX manager to be used.
|
void |
setUrlTransformer(URLTransformer urlTransformer)
Sets the urlTransformer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDaoFor, getDaoForprotected org.slf4j.Logger getLog()
public void configure(org.apache.commons.configuration.Configuration cfg)
throws org.apache.commons.configuration.ConfigurationException
configure in interface rsbaselib.configuration.Configurableorg.apache.commons.configuration.ConfigurationExceptionpublic void beforeConfiguration()
beforeConfiguration in interface rsbaselib.configuration.Configurablepublic void afterConfiguration()
afterConfiguration in interface rsbaselib.configuration.Configurablepublic DaoMaster loadDaoMaster(org.apache.commons.configuration.SubnodeConfiguration config)
Configurable.config - configurationpublic void setDaoMaster(String id, DaoMaster daoMaster)
id - id of masterdaoMaster - master to bet setpublic DaoMaster getDaoMaster(String id)
getDaoMaster in interface DaoFactoryid - ID of masterprotected GeneralDAO<?,?> createDAO(org.apache.commons.configuration.Configuration mainCfg, String key) throws Exception
mainCfg - main config objectkey - key to processExceptionpublic Object getProperty(String name)
getProperty in interface DaoFactoryname - name of propertypublic void setProperty(String name, Object value)
setProperty in interface DaoFactoryname - name of propertyvalue - value of propertypublic String getParameter(String name)
getParameter in interface DaoFactoryname - name of parameterpublic Iterator<String> getParameterKeys()
getParameterKeys in interface DaoFactorypublic URL getParameterUrl(String name) throws MalformedURLException
getParameterUrl in interface DaoFactoryname - name of parameterMalformedURLExceptionpublic URLTransformer getUrlTransformer()
getUrlTransformer in interface DaoFactorypublic void setUrlTransformer(URLTransformer urlTransformer)
setUrlTransformer in interface DaoFactoryurlTransformer - the urlTransformer to setpublic TransactionManager getTransactionManager()
getTransactionManager in interface DaoFactoryprotected TransactionManager createTransactionManager()
public void setTransactionManager(TransactionManager txManager)
setTransactionManager in interface DaoFactorytxManager - the TX manager.public void begin()
begin in interface DaoFactorypublic void commit()
DaoFactory.begin() did not start a new TX then
this method does nothing.commit in interface DaoFactorypublic void rollback()
DaoFactory.begin() did not start a new TX then
this method does nothing.rollback in interface DaoFactorypublic Transaction getTransaction() throws SystemException
getTransaction in interface DaoFactorySystemException - if there is a problempublic void addDaoFactoryListener(DaoFactoryListener listener)
addDaoFactoryListener in interface DaoFactorylistener - listenerpublic void removeDaoFactoryListener(DaoFactoryListener listener)
removeDaoFactoryListener in interface DaoFactorylistener - listenerprotected void fireDaoFactoryEvent(DaoFactoryEvent event)
event - event to be firedpublic void modelChanged()
Copyright © 2013. All Rights Reserved.