org.milyn.scribe.register
Class AbstractDaoRegister<D>

java.lang.Object
  extended by org.milyn.scribe.register.AbstractDaoRegister<D>
Type Parameters:
T - The DAO type
All Implemented Interfaces:
DaoRegister<D>
Direct Known Subclasses:
AbstractDaoAdapterRegister, MapDaoRegister, MultiDaoRegister, SingleDaoRegister

public abstract class AbstractDaoRegister<D>
extends Object
implements DaoRegister<D>

A abstract convenience implementation of the DaoRegister The getDefaultDao() and getDao(String) methods both throw a UnsupportedOperationException. The returnDao(Object) methods does nothing.

Author:
maurice.zeijen@smies.com

Constructor Summary
AbstractDaoRegister()
           
 
Method Summary
 D getDao(String name)
          Returns the DAO with the specified name.
 D getDefaultDao()
          Returns the default DAO .
 void returnDao(D dao)
          Returns the DAO to the register.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDaoRegister

public AbstractDaoRegister()
Method Detail

getDefaultDao

public D getDefaultDao()
Description copied from interface: DaoRegister
Returns the default DAO .

Specified by:
getDefaultDao in interface DaoRegister<D>
Returns:
the default DAO

getDao

public D getDao(String name)
Description copied from interface: DaoRegister
Returns the DAO with the specified name.

Specified by:
getDao in interface DaoRegister<D>
Parameters:
name - the name of the DAO
Returns:
the DAO with the specified name

returnDao

public void returnDao(D dao)
Description copied from interface: DaoRegister
Returns the DAO to the register. This is useful if the register has some locking or pooling mechanism. If it isn't necessary for DAO to be returned to the register then this method shouldn't do anything.

Specified by:
returnDao in interface DaoRegister<D>
Parameters:
dao - the DAO to return


Copyright © 2014. All Rights Reserved.