GNDMS 0.6.0
RESTful verison of GNDMS
|
Public Member Functions | |
M | get (K key) throws NoSuchElementException |
Used to retrive an model object form the dao. | |
void | setLimit (int newLimit) |
Sets a new queue element limit. | |
int | getLimit () |
Protected Member Functions | |
abstract M | provideGet (K key) |
This should return new models or delegate calls to underlying daos. | |
void | offer (K key) |
Inserts key into the queue. | |
void | remove () |
Private Attributes | |
int | limit |
Queue< K > | queue |
Date: 05.01.2011, Time: 17:46:12
This isn't a real dao yet but offers the functionality to maintain domain objects in a queue.
M de.zib.gndms.model.common.repository.QueuedDao< K, M, D >.get | ( | K | key | ) | throws NoSuchElementException |
Used to retrive an model object form the dao.
key | The key of the object. |
Implements de.zib.gndms.model.common.repository.Dao< K, M, D >.
{ if( queue.size() == limit ) queue.remove(); offer( key ); return provideGet( key ); }
abstract M de.zib.gndms.model.common.repository.QueuedDao< K, M, D >.provideGet | ( | K | key | ) | [protected, pure virtual] |
This should return new models or delegate calls to underlying daos.
key | Model key if required for construction. |
Note: when this method is called the model is allready inserted into the queue.
Implemented in de.zib.gndms.model.common.repository.QueuedTransientDao< K, M, D >.
void de.zib.gndms.model.common.repository.QueuedDao< K, M, D >.setLimit | ( | int | newLimit | ) |
Sets a new queue element limit.
newLimit | The new limit. |
Note: if newLimit < limit, Items will be removed from the queue until the queue size is equal to the limit.
{ while( newLimit < queue.size() ) remove( ); this.limit = newLimit; }