org.milyn.scribe.register
Interface DaoRegister<T>

Type Parameters:
T - the DAO type
All Known Implementing Classes:
AbstractDaoAdapterRegister, AbstractDaoRegister, MapDaoRegister, MultiDaoRegister, SingleDaoRegister

public interface DaoRegister<T>

The DAO Register

Makes it possible to retrieve a default unnamed DAO or one or more named DAO's.

DAO's retrieved from a DaoRegister should always be returned to the DaoRegister by calling the returnDao(Object) method.

Author:
maurice.zeijen@smies.com

Method Summary
 T getDao(String name)
          Returns the DAO with the specified name.
 T getDefaultDao()
          Returns the default DAO .
 void returnDao(T dao)
          Returns the DAO to the register.
 

Method Detail

getDefaultDao

T getDefaultDao()
Returns the default DAO .

Returns:
the default DAO
Throws:
UnsupportedOperationException - if the getDao() operation is not supported by this DaoRegister.

getDao

T getDao(String name)
Returns the DAO with the specified name.

Parameters:
name - the name of the DAO
Returns:
the DAO with the specified name
Throws:
UnsupportedOperationException - if the getDao(String) operation is not supported by this DaoRegister.

returnDao

void returnDao(T dao)
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.

Parameters:
dao - the DAO to return


Copyright © 2018. All rights reserved.