net.sourceforge.domian.repository
Class AbstractDomianCoreRepository<T extends Entity>

java.lang.Object
  extended by net.sourceforge.domian.repository.AbstractRepository<T>
      extended by net.sourceforge.domian.repository.AbstractDomianCoreRepository<T>
All Implemented Interfaces:
Repository<T>
Direct Known Subclasses:
HashSetRepository, HibernateRepository, InMemoryAndXStreamXmlFileRepository, InMemoryRepository, NotImplementedRepository, NullRepository, PartitionRepositoryInvocationHandler, UnsupportedRepository, XStreamXmlFilePerEntityRepository

public abstract class AbstractDomianCoreRepository<T extends Entity>
extends AbstractRepository<T>

All Domian Core-based Repository classes should extend this abstract class. It adds partitioning capabilities through the PartitionRepositoryInvocationHandler class.

A SLF4J logger instance is provided in this class.

Since:
0.5
Author:
Eirik Torske

Field Summary
static java.lang.String DEFAULT_DOMIAN_ROOT_DIR_NAME
           
static java.lang.String DEFAULT_DOMIAN_ROOT_PATH
           
protected  org.slf4j.Logger log
           
protected  Synchronizer synchronizer
          A synchronizer used to control concurrent and exclusive access to repository methods.
 
Fields inherited from class net.sourceforge.domian.repository.AbstractRepository
supportsRecursiveIndexing, usesNativePartitioningSupport
 
Constructor Summary
AbstractDomianCoreRepository()
           
 
Method Summary
protected  Specification<T> createUniqueSpecificationFor(T entity)
          Template method for creating unique specification for given entity
protected  Synchronizer getSynchronizer()
           
 PartitionRepository<T> makePartition()
          Promotes this repository to a PartitionRepository.
protected  void onMakePartition()
          Template method for partitioning callbacks.
 void setSynchronizer(Synchronizer synchronizer)
           
 
Methods inherited from class net.sourceforge.domian.repository.AbstractRepository
contains, count, countAll, countAllEntitiesSpecifiedBy, find, findAll, findSingle, findSingleEntitySpecifiedBy, isIndexingEntitiesRecursively, isPartitioningNatively, iterate, iterateAll, putAll, remove, removeAll, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.domian.repository.Repository
findAllEntitiesSpecifiedBy, iterateAllEntitiesSpecifiedBy, put, remove, removeAllEntitiesSpecifiedBy, update
 

Field Detail

DEFAULT_DOMIAN_ROOT_DIR_NAME

public static final java.lang.String DEFAULT_DOMIAN_ROOT_DIR_NAME
See Also:
Constant Field Values

DEFAULT_DOMIAN_ROOT_PATH

public static final java.lang.String DEFAULT_DOMIAN_ROOT_PATH

log

protected final org.slf4j.Logger log

synchronizer

protected Synchronizer synchronizer
A synchronizer used to control concurrent and exclusive access to repository methods. E.g. all methods dealing with partitioning are run in an exclusive manner.

Constructor Detail

AbstractDomianCoreRepository

public AbstractDomianCoreRepository()
Method Detail

getSynchronizer

protected Synchronizer getSynchronizer()

setSynchronizer

public void setSynchronizer(Synchronizer synchronizer)

createUniqueSpecificationFor

protected Specification<T> createUniqueSpecificationFor(T entity)
Description copied from class: AbstractRepository
Template method for creating unique specification for given entity

Specified by:
createUniqueSpecificationFor in class AbstractRepository<T extends Entity>
Returns:
Guaranteed unique specification for given entity

makePartition

public PartitionRepository<T> makePartition()
Description copied from interface: Repository
Promotes this repository to a PartitionRepository.

Returns:
a partitioned version of this repository

onMakePartition

protected void onMakePartition()
Description copied from class: AbstractRepository
Template method for partitioning callbacks.

Specified by:
onMakePartition in class AbstractRepository<T extends Entity>


Copyright © 2006-2010. All Rights Reserved.