net.sourceforge.domian.repository
Class InMemoryAndXStreamXmlFileRepository<T extends Entity>
java.lang.Object
net.sourceforge.domian.repository.AbstractRepository<T>
net.sourceforge.domian.repository.AbstractDomianCoreRepository<T>
net.sourceforge.domian.repository.AbstractXStreamXmlFileRepository<T>
net.sourceforge.domian.repository.AbstractXStreamSingleXmlFileRepository<T>
net.sourceforge.domian.repository.InMemoryAndXStreamXmlFileRepository<T>
- All Implemented Interfaces:
- HumanReadableFormatRepository<T>, PersistentRepository<T>, Repository<T>, TextualFormatRepository<T>
public class InMemoryAndXStreamXmlFileRepository<T extends Entity>
- extends AbstractXStreamSingleXmlFileRepository<T>
- implements HumanReadableFormatRepository<T>
An in-memory repository with persistence capabilities.
The persistence part is backed by XStream functionality.
The only persistence definition supported by this repository is PersistenceDefinition.INMEMORY_AND_FILE
.
All entities in this repository are persisted into one single file.
The typical disc footprint is 1KB per entity.
The persistence format is human readable XStream XML.
The file encoding is UTF-8.
File-based stores counts as persistent storage media,
although the nature of the synchronous writings to disc obviously depends on the file system implementations involved.
- Since:
- 0.4
- Author:
- Eirik Torske
- See Also:
- XStream,
PersistenceDefinition.INMEMORY_AND_FILE
Methods inherited from class net.sourceforge.domian.repository.AbstractXStreamXmlFileRepository |
call, callConcurrently, callConcurrentlyInNewThread, callConcurrentlyWithRetry, callExclusively, callExclusivelyInNewThread, callExclusivelyWithRetry, getEncoding, getMaxNumberOfRetries, getRepositoryDirectory, getRepositoryId, getRepositoryPath, getRepositoryPathString, getRepositoryRootPath, getRetryTimeoutInMilliseconds, run, runAsynchronously, runConcurrently, setMaxNumberOfRetries, setRetryTimeoutInMilliseconds |
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 |
count, countAll, countAllEntitiesSpecifiedBy, find, findAll, findSingle, findSingleEntitySpecifiedBy, isIndexingEntitiesRecursively, isPartitioningNatively, iterate, iterateAll, makePartition, putAll, remove, removeAll, update |
DEFAULT_REPOSITORY_ROOT_FILE_NAME
protected static final java.lang.String DEFAULT_REPOSITORY_ROOT_FILE_NAME
- See Also:
- Constant Field Values
DEFAULT_REPOSITORY_ROOT_DIR_NAME
protected static final java.lang.String DEFAULT_REPOSITORY_ROOT_DIR_NAME
- See Also:
- Constant Field Values
DEFAULT_REPOSITORY_ROOT_PATH
protected static final java.lang.String DEFAULT_REPOSITORY_ROOT_PATH
inMemoryRepositoryDelegate
protected InMemoryRepository<T extends Entity> inMemoryRepositoryDelegate
- The repository delegate dealing with the in-memory stuff.
InMemoryAndXStreamXmlFileRepository
public InMemoryAndXStreamXmlFileRepository(java.lang.String repositoryId)
InMemoryAndXStreamXmlFileRepository
public InMemoryAndXStreamXmlFileRepository(java.lang.String repositoryRootPath,
java.lang.String repositoryId)
InMemoryAndXStreamXmlFileRepository
public InMemoryAndXStreamXmlFileRepository(java.lang.String repositoryId,
Synchronizer synchronizer)
InMemoryAndXStreamXmlFileRepository
public InMemoryAndXStreamXmlFileRepository(java.lang.String repositoryRootPath,
java.lang.String repositoryId,
Synchronizer synchronizer)
getRepositoryTypeName
protected java.lang.String getRepositoryTypeName()
- Specified by:
getRepositoryTypeName
in class AbstractXStreamSingleXmlFileRepository<T extends Entity>
- Returns:
- the repository type name; the name of the repository implementation (e.g. Unix-name-variant of the class simple name)
iterateAllEntitiesSpecifiedBy
public <V extends T> java.util.Iterator<V> iterateAllEntitiesSpecifiedBy(Specification<V> specification)
- Specified by:
iterateAllEntitiesSpecifiedBy
in interface Repository<T extends Entity>
findAllEntitiesSpecifiedBy
public <V extends T> java.util.Collection<V> findAllEntitiesSpecifiedBy(Specification<V> specification)
- Specified by:
findAllEntitiesSpecifiedBy
in interface Repository<T extends Entity>
put
public <V extends T> void put(V entity)
- Specified by:
put
in interface Repository<T extends Entity>
update
public <V extends T> void update(V entity)
- Specified by:
update
in interface Repository<T extends Entity>
removeAllEntitiesSpecifiedBy
public <V extends T> java.lang.Long removeAllEntitiesSpecifiedBy(Specification<V> specification)
- Specified by:
removeAllEntitiesSpecifiedBy
in interface Repository<T extends Entity>
remove
public <V extends T> java.lang.Boolean remove(V entity)
- Specified by:
remove
in interface Repository<T extends Entity>
getPersistenceDefinition
public PersistenceDefinition getPersistenceDefinition()
- Specified by:
getPersistenceDefinition
in interface PersistentRepository<T extends Entity>
getFormat
public java.lang.String getFormat()
- Specified by:
getFormat
in interface PersistentRepository<T extends Entity>
load
public void load()
- Specified by:
load
in interface PersistentRepository<T extends Entity>
persist
public void persist()
- Specified by:
persist
in interface PersistentRepository<T extends Entity>
close
public void close()
- Specified by:
close
in interface PersistentRepository<T extends Entity>
Copyright © 2008-2010. All Rights Reserved.