Package org.faktorips.runtime.internal
Class AbstractTocBasedRuntimeRepository
java.lang.Object
org.faktorips.runtime.internal.AbstractRuntimeRepository
org.faktorips.runtime.internal.AbstractCachingRuntimeRepository
org.faktorips.runtime.internal.AbstractTocBasedRuntimeRepository
- All Implemented Interfaces:
IRuntimeRepository
- Direct Known Subclasses:
AbstractClassLoadingRuntimeRepository
Abstract base implementation of runtime repository that uses a table of contents to lazily load
the product data. This implementation also manages the caches.
- Author:
- Jan Ortmann
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractTocBasedRuntimeRepository(String name, ICacheFactory cacheFactory, ClassLoader cl) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract <T> TcreateCustomObject(CustomTocEntryObject<T> tocEntry) protected abstract <T> List<T>createEnumValues(EnumContentTocEntry tocEntry, Class<T> clazz) protected javax.xml.bind.annotation.adapters.XmlAdapter<String,?> createEnumXmlAdapter(String className, IRuntimeRepository repository) Creates and returns anXmlAdapterinstance for the provided class name.protected abstract IProductComponentcreateProductCmpt(ProductCmptTocEntry tocEntry) protected abstract IProductComponentGenerationcreateProductCmptGeneration(GenerationTocEntry generationTocEntry) protected abstract ITable<?>createTable(TableContentTocEntry tocEntry) Creates the table object for the given toc entry.protected abstract IpsTestCaseBasecreateTestCase(TestCaseTocEntry tocEntry, IRuntimeRepository runtimeRepository) Creates the test case object for the given toc entry.voidgetAllEnumClasses(LinkedHashSet<Class<?>> result) Same asAbstractRuntimeRepository.getAllEnumClasses()but searches only in this repository and not the ones this repository depends on.protected voidgetAllIpsTestCases(List<IpsTest2> result, IRuntimeRepository runtimeRepository) Same asAbstractRuntimeRepository.getAllIpsTestCases(IRuntimeRepository)but searches only in this repository and not the ones this repository depends on.protected voidSame asAbstractRuntimeRepository.getAllModelTypeImplementationClasses()but searches only in this repository and not the ones this repository depends on.voidgetAllProductComponentIds(List<String> result) Same asAbstractRuntimeRepository.getAllProductComponentIds()but searches only in this repository and not the ones this repository depends on.voidgetAllProductComponents(String kindId, List<IProductComponent> result) Same as getAllProductComponent(String kindId) but searches only in this repository and not the ones this repository depends on.voidgetAllProductComponents(List<IProductComponent> result) Same as getAllProductComponents() but searches only in this repository and not the ones this repository depends on.voidgetAllTables(List<ITable<?>> result) Same asAbstractRuntimeRepository.getAllTables()but searches only in this repository and not the ones this repository depends on.protected Class<?>getClass(String className, ClassLoader cl) Returns the class for the given qualified class name.protected IpsTestCaseBasegetIpsTestCaseInternal(String qName, IRuntimeRepository runtimeRepository) IpsTestCases are created new every time and should not be cached because the test data could change for every test creation.protected voidgetIpsTestCasesStartingWith(String qNamePrefix, List<IpsTest2> result, IRuntimeRepository runtimeRepository) Gets all ips test cases starting with the given qualified name prefix.protected IProductComponentGenerationprotected IProductComponentGenerationprotected <T> TgetNotCachedCustomObject(Class<T> type, String id) protected <T> List<T>getNotCachedEnumValues(Class<T> clazz) protected List<javax.xml.bind.annotation.adapters.XmlAdapter<?,?>> getNotCachedEnumXmlAdapter(IRuntimeRepository repository) protected IProductComponentprotected IProductComponentGenerationgetNotCachedProductComponentGeneration(GenerationId generationId) protected ITable<?>getNotCachedTable(String qualifiedTableName) protected intprotected IProductComponentGenerationprotected IProductComponentGenerationgetProductComponentGenerationInternal(String id, Calendar effectiveDate) Same as getProductComponentGeneration(String id, Calendar effectiveDate) but searches only in this repository and not the ones this repository depends on.voidgetProductComponentGenerations(IProductComponent productCmpt, List<IProductComponentGeneration> result) Same as getProductComponentGenerations() but searches only in this repository and not the ones this repository depends on.protected final IProductComponentgetProductComponentInternal(String kindId, String versionId) Same as getProductComponent(String kindId, String versionId) but searches only in this repository and not the ones this repository depends on.protected <T extends ITable<?>>
TgetTableInternal(Class<T> tableClass) Same asAbstractRuntimeRepository.getTable(Class)but searches only in this repository and not the ones this repository depends on.protected IReadonlyTableOfContentsprotected voidInitializes the runtime repository by loading the table of contents.protected abstract IReadonlyTableOfContentsMethods inherited from class org.faktorips.runtime.internal.AbstractCachingRuntimeRepository
getAllInternalEnumXmlAdapters, getCustomRuntimeObjectInternal, getEnumValuesInternal, getProductComponentGenerationInternal, getProductComponentInternal, getTableInternal, initCachesMethods inherited from class org.faktorips.runtime.internal.AbstractRuntimeRepository
addDirectlyReferencedRepository, addEnumValueLookupService, getAllEnumClasses, getAllIpsTestCases, getAllModelTypeImplementationClasses, getAllProductComponentIds, getAllProductComponents, getAllProductComponents, getAllProductComponents, getAllProductComponentsInternal, getAllReferencedRepositories, getAllTables, getClassLoader, getCustomRuntimeObject, getDirectlyReferencedRepositories, getEnumValue, getEnumValue, getEnumValueLookupService, getEnumValues, getEnumValuesDefinedInType, getExistingEnumValue, getExistingProductComponent, getExistingProductComponentGeneration, getFormulaEvaluatorFactory, getIpsTest, getIpsTest, getIpsTestCase, getIpsTestCase, getIpsTestCasesStartingWith, getIpsTestSuite, getIpsTestSuite, getLatestProductComponentGeneration, getModelType, getModelType, getModelType, getName, getNextProductComponentGeneration, getNumberOfProductComponentGenerations, getPreviousProductComponentGeneration, getProductComponent, getProductComponent, getProductComponentGeneration, getProductComponentGenerations, getRuntimeRepositoryLookup, getTable, getTable, newJAXBContext, newJAXBContext, removeEnumValueLookupService, setFormulaEvaluatorFactory, setRuntimeRepositoryLookup, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.faktorips.runtime.IRuntimeRepository
isModifiable
-
Constructor Details
-
AbstractTocBasedRuntimeRepository
-
-
Method Details
-
loadTableOfContents
-
getTableOfContents
-
createEnumValues
-
getProductComponentInternal
Description copied from class:AbstractRuntimeRepositorySame as getProductComponent(String kindId, String versionId) but searches only in this repository and not the ones this repository depends on.- Specified by:
getProductComponentInternalin classAbstractRuntimeRepository
-
getAllProductComponents
Description copied from class:AbstractRuntimeRepositorySame as getAllProductComponent(String kindId) but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.- Specified by:
getAllProductComponentsin classAbstractRuntimeRepository
-
getAllProductComponents
Description copied from class:AbstractRuntimeRepositorySame as getAllProductComponents() but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.- Specified by:
getAllProductComponentsin classAbstractRuntimeRepository
-
getAllEnumClasses
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllEnumClasses()but searches only in this repository and not the ones this repository depends on. Adds the classes found to the given result set.- Specified by:
getAllEnumClassesin classAbstractRuntimeRepository
-
getAllProductComponentIds
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllProductComponentIds()but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.- Specified by:
getAllProductComponentIdsin classAbstractRuntimeRepository
-
createProductCmpt
-
getProductComponentGenerationInternal
protected IProductComponentGeneration getProductComponentGenerationInternal(String id, Calendar effectiveDate) Description copied from class:AbstractRuntimeRepositorySame as getProductComponentGeneration(String id, Calendar effectiveDate) but searches only in this repository and not the ones this repository depends on.- Specified by:
getProductComponentGenerationInternalin classAbstractRuntimeRepository
-
getNextProductComponentGenerationInternal
protected IProductComponentGeneration getNextProductComponentGenerationInternal(IProductComponentGeneration generation) - Specified by:
getNextProductComponentGenerationInternalin classAbstractRuntimeRepository
-
getPreviousProductComponentGenerationInternal
protected IProductComponentGeneration getPreviousProductComponentGenerationInternal(IProductComponentGeneration generation) - Specified by:
getPreviousProductComponentGenerationInternalin classAbstractRuntimeRepository
-
getLatestProductComponentGenerationInternal
protected IProductComponentGeneration getLatestProductComponentGenerationInternal(IProductComponent productCmpt) - Specified by:
getLatestProductComponentGenerationInternalin classAbstractRuntimeRepository
-
getProductComponentGenerations
public void getProductComponentGenerations(IProductComponent productCmpt, List<IProductComponentGeneration> result) Description copied from class:AbstractRuntimeRepositorySame as getProductComponentGenerations() but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.- Specified by:
getProductComponentGenerationsin classAbstractRuntimeRepository
-
getNumberOfProductComponentGenerationsInternal
- Specified by:
getNumberOfProductComponentGenerationsInternalin classAbstractRuntimeRepository
-
getNotCachedProductComponentGeneration
protected IProductComponentGeneration getNotCachedProductComponentGeneration(GenerationId generationId) - Specified by:
getNotCachedProductComponentGenerationin classAbstractCachingRuntimeRepository
-
createProductCmptGeneration
protected abstract IProductComponentGeneration createProductCmptGeneration(GenerationTocEntry generationTocEntry) -
getAllTables
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllTables()but searches only in this repository and not the ones this repository depends on. Adds the tables found to the given result list.- Specified by:
getAllTablesin classAbstractRuntimeRepository
-
getTableInternal
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getTable(Class)but searches only in this repository and not the ones this repository depends on.- Specified by:
getTableInternalin classAbstractRuntimeRepository
-
getNotCachedTable
- Specified by:
getNotCachedTablein classAbstractCachingRuntimeRepository
-
createTable
Creates the table object for the given toc entry. -
getAllIpsTestCases
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllIpsTestCases(IRuntimeRepository)but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.- Specified by:
getAllIpsTestCasesin classAbstractRuntimeRepository
-
getIpsTestCasesStartingWith
protected void getIpsTestCasesStartingWith(String qNamePrefix, List<IpsTest2> result, IRuntimeRepository runtimeRepository) Description copied from class:AbstractRuntimeRepositoryGets all ips test cases starting with the given qualified name prefix.- Specified by:
getIpsTestCasesStartingWithin classAbstractRuntimeRepository
-
createTestCase
protected abstract IpsTestCaseBase createTestCase(TestCaseTocEntry tocEntry, IRuntimeRepository runtimeRepository) Creates the test case object for the given toc entry. -
initialize
protected void initialize()Initializes the runtime repository by loading the table of contents. This method have to be called from the constructor after all necessary data is set. -
getClass
Returns the class for the given qualified class name.- Parameters:
className- The qualified class namecl- The classLoader used to load the load.- Throws:
RuntimeException- if the class can't be found.
-
getAllModelTypeImplementationClasses
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllModelTypeImplementationClasses()but searches only in this repository and not the ones this repository depends on. Adds the types found to the given result list.- Specified by:
getAllModelTypeImplementationClassesin classAbstractRuntimeRepository
-
createEnumXmlAdapter
protected javax.xml.bind.annotation.adapters.XmlAdapter<String,?> createEnumXmlAdapter(String className, IRuntimeRepository repository) throws Exception Creates and returns anXmlAdapterinstance for the provided class name.- Throws:
Exception- can occur while localizing the xml adapter class and creating the instance
-
getNotCachedProductComponent
- Specified by:
getNotCachedProductComponentin classAbstractCachingRuntimeRepository
-
getNotCachedEnumValues
- Specified by:
getNotCachedEnumValuesin classAbstractCachingRuntimeRepository
-
getNotCachedEnumXmlAdapter
protected List<javax.xml.bind.annotation.adapters.XmlAdapter<?,?>> getNotCachedEnumXmlAdapter(IRuntimeRepository repository) - Specified by:
getNotCachedEnumXmlAdapterin classAbstractCachingRuntimeRepository
-
getIpsTestCaseInternal
protected IpsTestCaseBase getIpsTestCaseInternal(String qName, IRuntimeRepository runtimeRepository) IpsTestCases are created new every time and should not be cached because the test data could change for every test creation.- Specified by:
getIpsTestCaseInternalin classAbstractRuntimeRepository
-
getNotCachedCustomObject
- Specified by:
getNotCachedCustomObjectin classAbstractCachingRuntimeRepository
-
createCustomObject
-