|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.domian.repository.AbstractRepository<T> net.sourceforge.domian.repository.AbstractDomianCoreRepository<T> net.sourceforge.domian.repository.PartitionRepositoryInvocationHandler<T>
public class PartitionRepositoryInvocationHandler<T extends Entity>
InvocationHandler
implementation for partition repositories.
All repositories either consisting of, or belonging to a PartitionRepository
may use this repository wrapper.
Nested Class Summary | |
---|---|
private class |
PartitionRepositoryInvocationHandler.FindAllEntitiesSpecifiedBy<V extends T>
|
private class |
PartitionRepositoryInvocationHandler.IterateAllEntitiesSpecifiedBy<V extends T>
|
private static class |
PartitionRepositoryInvocationHandler.IteratorRegistry
Class for keeping track of all repository iterators. |
(package private) class |
PartitionRepositoryInvocationHandler.PartitionAwareSpecification<V extends T>
|
private static class |
PartitionRepositoryInvocationHandler.PartitionRepositoryIterator<T extends Entity,V extends T>
Inner iterator class for PartitionRepository . |
private class |
PartitionRepositoryInvocationHandler.Put<V extends T>
|
private class |
PartitionRepositoryInvocationHandler.Remove<V extends T>
|
private class |
PartitionRepositoryInvocationHandler.RemoveAllEntitiesSpecifiedBy<V extends T>
|
Field Summary | |
---|---|
protected boolean |
executeOperationsExclusivelyOnly
|
protected PartitionRepositoryInvocationHandler.IteratorRegistry |
iteratorRegistry
A internal registry keeping track of all active iterators. |
protected Specification<T> |
partitionSpecification
|
protected Repository<T> |
repositoryDelegate
|
protected boolean |
repositoryDelegateIsAlreadyPartitioned
|
protected java.util.Map<Specification<? extends T>,PartitionRepository> |
subPartitions
All sub-partition repositories, indexed by a unique specification. |
protected PartitionRepository<? super T> |
superPartitionRepository
|
protected Specification<? super T> |
superPartitionSpecification
|
protected Synchronizer |
synchronizer
A synchronizer used to control concurrent and exclusive access to repository methods. |
Fields inherited from class net.sourceforge.domian.repository.AbstractDomianCoreRepository |
---|
DEFAULT_DOMIAN_ROOT_DIR_NAME, DEFAULT_DOMIAN_ROOT_PATH, log |
Fields inherited from class net.sourceforge.domian.repository.AbstractRepository |
---|
supportsRecursiveIndexing, usesNativePartitioningSupport |
Constructor Summary | |
---|---|
PartitionRepositoryInvocationHandler(Repository<T> repositoryDelegate,
Synchronizer synchronizer,
java.lang.Boolean executeOperationsExclusivelyOnly)
|
Method Summary | ||
---|---|---|
protected
|
addPartition(Specification<V> partitionSpecification,
PartitionRepository<? extends V> partitionRepository)
|
|
|
addPartitionFor(Specification<V> partitionSpecification)
|
|
|
addPartitionFor(Specification<V> partitionSpecification,
Repository<? super V> partitionRepository)
|
|
|
addPartitionFor(Specification<V> partitionSpecification,
java.lang.String repositoryId)
|
|
void |
close()
|
|
void |
collectAllPartitions(java.util.Map<Specification<? extends T>,PartitionRepository> partitionMap)
|
|
|
collectAllPartitionsWithRepositorySatisfying(Specification<R> specification,
java.util.Map<Specification<? extends T>,PartitionRepository> partitionMap)
|
|
protected
|
conditionalSynchronizedExecutionOf(java.util.concurrent.Callable<V> operation)
|
|
protected
|
countAllEntitiesWithoutSpecificationSharpening(Specification<V> specification)
Special count method without sharpening original specifications to fit partition specifications. |
|
protected java.lang.Boolean |
entityExists_PossiblyInWrongPartition(T entity)
|
|
|
findAllEntitiesSpecifiedBy(Specification<V> specification)
|
|
protected
|
findAllEntitiesSpecifiedBy(Specification<V> specification,
java.lang.Boolean sharpenOriginalSpecificationsToFitPartitionSpecification)
|
|
|
findPartitionFor(Specification<V> partitionSpecification)
|
|
|
findSingleEntitySpecifiedBy(Specification<V> specification)
|
|
java.util.Map<Specification<? extends T>,PartitionRepository> |
getAllPartitions()
|
|
protected PartitionRepository |
getCorrectPartitionRepository(PartitionRepository originalPartitionRepository,
PartitionRepository toBeReusedPartitionRepository)
|
|
java.lang.String |
getFormat()
This method applies to this partition only! |
|
EntityPersistenceMetaData |
getMetaDataFor(T entity)
|
|
java.util.Set<T> |
getPartitionOnlyEntities()
|
|
java.util.Map<Specification<? extends T>,PartitionRepository> |
getPartitions()
|
|
Specification<T> |
getPartitionSpecification()
|
|
PersistenceDefinition |
getPersistenceDefinition()
This method applies to this partition only! |
|
java.io.File |
getRepositoryDirectory()
This method applies to this partition only! |
|
java.lang.String |
getRepositoryId()
This method applies to this partition only! |
|
PartitionRepository<? super T> |
getRootRepository()
|
|
PartitionRepository<? super T> |
getSuperPartitionRepository()
|
|
Specification<? super T> |
getSuperPartitionSpecification()
|
|
Repository<T> |
getTargetRepository()
|
|
java.lang.Class<T> |
getType()
|
|
protected void |
handlePartitionRepositoryException(java.lang.Exception e,
java.lang.String errorMessage)
|
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
|
java.lang.Boolean |
isIndexingEntitiesRecursively()
|
|
java.lang.Boolean |
isLeafPartition()
|
|
java.lang.Boolean |
isPartitioningNatively()
|
|
java.lang.Boolean |
isRootPartition()
|
|
|
iterateAllEntitiesSpecifiedBy(Specification<V> specification)
|
|
void |
load()
|
|
void |
persist()
|
|
|
put(V entity)
|
|
|
remove(V entity)
|
|
|
removeAllEntitiesSpecifiedBy(Specification<V> specification)
|
|
protected
|
removePartitionOnlyEntity(V entity)
|
|
void |
repartition()
|
|
|
repartition(V entity)
|
|
protected boolean |
repositoryExemptFromSyncronization()
|
|
protected boolean |
repositoryOperationsNeedToBeExecutedExclusively()
|
|
void |
setPartitionSpecification(Specification<T> partitionSpecification)
|
|
void |
setSuperPartitionRepository(PartitionRepository<? super T> partitionRepository)
|
|
void |
setSuperPartitionSpecification(Specification<? super T> specification)
|
|
|
update(V entity)
|
|
protected PartitionRepository |
wireUpPartition(Specification superPartitionSpecification,
PartitionRepository superPartitionRepository,
Specification partitionSpecification,
PartitionRepository partitionRepository)
|
Methods inherited from class net.sourceforge.domian.repository.AbstractDomianCoreRepository |
---|
createUniqueSpecificationFor, getSynchronizer, makePartition, onMakePartition, setSynchronizer |
Methods inherited from class net.sourceforge.domian.repository.AbstractRepository |
---|
contains, count, countAll, countAllEntitiesSpecifiedBy, find, findAll, findSingle, 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 |
---|
count, countAll, countAllEntitiesSpecifiedBy, find, findAll, findSingle, iterate, iterateAll, makePartition, putAll, remove, removeAll, update |
Field Detail |
---|
protected final Synchronizer synchronizer
protected final PartitionRepositoryInvocationHandler.IteratorRegistry iteratorRegistry
protected boolean executeOperationsExclusivelyOnly
protected boolean repositoryDelegateIsAlreadyPartitioned
protected Specification<? super T extends Entity> superPartitionSpecification
protected PartitionRepository<? super T extends Entity> superPartitionRepository
protected Specification<T extends Entity> partitionSpecification
protected Repository<T extends Entity> repositoryDelegate
protected final java.util.Map<Specification<? extends T extends Entity>,PartitionRepository> subPartitions
Constructor Detail |
---|
PartitionRepositoryInvocationHandler(Repository<T> repositoryDelegate, Synchronizer synchronizer, java.lang.Boolean executeOperationsExclusivelyOnly)
Method Detail |
---|
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable
public java.lang.Class<T> getType()
getType
in interface PartitionRepository<T extends Entity>
public PartitionRepository<? super T> getRootRepository()
getRootRepository
in interface PartitionRepository<T extends Entity>
public Specification<? super T> getSuperPartitionSpecification()
public void setSuperPartitionSpecification(Specification<? super T> specification)
setSuperPartitionSpecification
in interface PartitionRepository<T extends Entity>
public PartitionRepository<? super T> getSuperPartitionRepository()
getSuperPartitionRepository
in interface PartitionRepository<T extends Entity>
public void setSuperPartitionRepository(PartitionRepository<? super T> partitionRepository)
setSuperPartitionRepository
in interface PartitionRepository<T extends Entity>
public Specification<T> getPartitionSpecification()
getPartitionSpecification
in interface PartitionRepository<T extends Entity>
public void setPartitionSpecification(Specification<T> partitionSpecification)
setPartitionSpecification
in interface PartitionRepository<T extends Entity>
public Repository<T> getTargetRepository()
getTargetRepository
in interface PartitionRepository<T extends Entity>
public java.lang.Boolean isRootPartition()
isRootPartition
in interface PartitionRepository<T extends Entity>
public java.lang.Boolean isLeafPartition()
isLeafPartition
in interface PartitionRepository<T extends Entity>
protected boolean repositoryOperationsNeedToBeExecutedExclusively()
protected boolean repositoryExemptFromSyncronization()
protected PartitionRepository wireUpPartition(Specification superPartitionSpecification, PartitionRepository superPartitionRepository, Specification partitionSpecification, PartitionRepository partitionRepository)
protected <V> V conditionalSynchronizedExecutionOf(java.util.concurrent.Callable<V> operation) throws java.lang.Exception
java.lang.Exception
protected void handlePartitionRepositoryException(java.lang.Exception e, java.lang.String errorMessage)
public <V extends T> java.util.Iterator<V> iterateAllEntitiesSpecifiedBy(Specification<V> specification)
iterateAllEntitiesSpecifiedBy
in interface Repository<T extends Entity>
protected <V extends T> java.lang.Long countAllEntitiesWithoutSpecificationSharpening(Specification<V> specification)
public <V extends T> V findSingleEntitySpecifiedBy(Specification<V> specification)
findSingleEntitySpecifiedBy
in interface Repository<T extends Entity>
findSingleEntitySpecifiedBy
in class AbstractRepository<T extends Entity>
public <V extends T> java.util.Collection<V> findAllEntitiesSpecifiedBy(Specification<V> specification)
findAllEntitiesSpecifiedBy
in interface Repository<T extends Entity>
protected <V extends T> java.util.Collection<V> findAllEntitiesSpecifiedBy(Specification<V> specification, java.lang.Boolean sharpenOriginalSpecificationsToFitPartitionSpecification)
public <V extends T> void put(V entity)
put
in interface Repository<T extends Entity>
public <V extends T> void update(V entity)
update
in interface Repository<T extends Entity>
public <V extends T> java.lang.Long removeAllEntitiesSpecifiedBy(Specification<V> specification)
removeAllEntitiesSpecifiedBy
in interface Repository<T extends Entity>
public <V extends T> java.lang.Boolean remove(V entity)
remove
in interface Repository<T extends Entity>
public java.lang.Boolean isPartitioningNatively()
isPartitioningNatively
in interface Repository<T extends Entity>
isPartitioningNatively
in class AbstractRepository<T extends Entity>
public java.lang.Boolean isIndexingEntitiesRecursively()
isIndexingEntitiesRecursively
in interface Repository<T extends Entity>
isIndexingEntitiesRecursively
in class AbstractRepository<T extends Entity>
public java.io.File getRepositoryDirectory()
getRepositoryDirectory
in interface PersistentRepository<T extends Entity>
public java.lang.String getRepositoryId()
getRepositoryId
in interface PersistentRepository<T extends Entity>
public PersistenceDefinition getPersistenceDefinition()
getPersistenceDefinition
in interface PersistentRepository<T extends Entity>
public java.lang.String getFormat()
getFormat
in interface PersistentRepository<T extends Entity>
public void load()
load
in interface PersistentRepository<T extends Entity>
public void persist()
persist
in interface PersistentRepository<T extends Entity>
public EntityPersistenceMetaData getMetaDataFor(T entity)
getMetaDataFor
in interface PersistentRepository<T extends Entity>
public void close()
close
in interface PersistentRepository<T extends Entity>
protected PartitionRepository getCorrectPartitionRepository(PartitionRepository originalPartitionRepository, PartitionRepository toBeReusedPartitionRepository)
protected <V extends T> PartitionRepository<V> addPartition(Specification<V> partitionSpecification, PartitionRepository<? extends V> partitionRepository)
public <V extends T> PartitionRepository<V> addPartitionFor(Specification<V> partitionSpecification)
addPartitionFor
in interface PartitionRepository<T extends Entity>
public <V extends T> PartitionRepository<V> addPartitionFor(Specification<V> partitionSpecification, java.lang.String repositoryId)
addPartitionFor
in interface PartitionRepository<T extends Entity>
public <V extends T> PartitionRepository<V> addPartitionFor(Specification<V> partitionSpecification, Repository<? super V> partitionRepository)
addPartitionFor
in interface PartitionRepository<T extends Entity>
public <V extends T> java.lang.Boolean repartition(V entity)
repartition
in interface PartitionRepository<T extends Entity>
public void repartition()
repartition
in interface PartitionRepository<T extends Entity>
protected java.lang.Boolean entityExists_PossiblyInWrongPartition(T entity)
public java.util.Map<Specification<? extends T>,PartitionRepository> getPartitions()
getPartitions
in interface PartitionRepository<T extends Entity>
public java.util.Map<Specification<? extends T>,PartitionRepository> getAllPartitions()
getAllPartitions
in interface PartitionRepository<T extends Entity>
public void collectAllPartitions(java.util.Map<Specification<? extends T>,PartitionRepository> partitionMap)
collectAllPartitions
in interface PartitionRepository<T extends Entity>
public <R extends Repository> void collectAllPartitionsWithRepositorySatisfying(Specification<R> specification, java.util.Map<Specification<? extends T>,PartitionRepository> partitionMap)
collectAllPartitionsWithRepositorySatisfying
in interface PartitionRepository<T extends Entity>
public <V extends T> PartitionRepository findPartitionFor(Specification<V> partitionSpecification)
findPartitionFor
in interface PartitionRepository<T extends Entity>
public java.util.Set<T> getPartitionOnlyEntities()
getPartitionOnlyEntities
in interface PartitionRepository<T extends Entity>
protected <V extends T> void removePartitionOnlyEntity(V entity)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |