Package org.faktorips.runtime.internal
Class AbstractClassLoadingRuntimeRepository
java.lang.Object
org.faktorips.runtime.internal.AbstractRuntimeRepository
org.faktorips.runtime.internal.AbstractCachingRuntimeRepository
org.faktorips.runtime.internal.AbstractTocBasedRuntimeRepository
org.faktorips.runtime.internal.AbstractClassLoadingRuntimeRepository
- All Implemented Interfaces:
IRuntimeRepository
- Direct Known Subclasses:
ClassloaderRuntimeRepository,DetachedContentRuntimeRepository
public abstract class AbstractClassLoadingRuntimeRepository
extends AbstractTocBasedRuntimeRepository
An abstract repository that handles the common stuff between the
AbstractTocBasedRuntimeRepository and the concrete runtime repositories. This abstract
layer is responsible for loading the classes and instantiates the objects. The content of the
objects - the concrete data - is provided by the concrete implementation.- Author:
- dirmeier
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractClassLoadingRuntimeRepository(String name, ICacheFactory cacheFactory, ClassLoader cl) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> TcreateCustomObject(CustomTocEntryObject<T> tocEntry) protected <T> List<T>createEnumValues(EnumContentTocEntry tocEntry, Class<T> enumClass) protected IProductComponentcreateProductCmpt(ProductCmptTocEntry tocEntry) protected IProductComponentGenerationprotected ProductComponentGenerationcreateProductComponentGenerationInstance(GenerationTocEntry tocEntry, ProductComponent productCmpt) protected ProductComponentcreateProductComponentInstance(String implementationClassName, String ipsObjectId, String kindId, String versionId) protected ITable<?>createTable(TableContentTocEntry tocEntry) Creates the table object for the given toc entry.protected IpsTestCaseBasecreateTestCase(TestCaseTocEntry tocEntry, IRuntimeRepository runtimeRepository) Creates the test case object for the given toc entry.protected <T extends IProductComponent>
voidgetAllProductComponentsInternal(Class<T> productCmptClass, List<T> result) Override the default implementation for better performance.Returns the class loader that is used to load Java classes by this repository.protected abstract <T> ElementgetDocumentElement(CustomTocEntryObject<T> tocEntry) This method returns the xml element of the product component identified by the tocEntryprotected abstract ElementgetDocumentElement(GenerationTocEntry tocEntry) This method returns the xml element of the product component generation identified by the tocEntryprotected abstract ElementgetDocumentElement(ProductCmptTocEntry tocEntry) This method returns the xml element of the product component identified by the tocEntryprotected abstract ElementgetDocumentElement(TestCaseTocEntry tocEntry) This method returns the xml element of the test case identified by the tocEntryprotected abstract StringThis method returns the name of the product component generation implementation class identified by the tocEntry.protected ProductVariantRuntimeHelperprotected abstract InputStreamgetXmlAsStream(EnumContentTocEntry tocEntry) Returns the XML data for the specified tocEntry asInputStreamprotected abstract InputStreamgetXmlAsStream(TableContentTocEntry tocEntry) Returns the XML data for the specified tocEntry asInputStreamprotected <T> voidinitClRepositoryObject(CustomTocEntryObject<T> tocEntry, IClRepositoryObject runtimeObject) Methods inherited from class org.faktorips.runtime.internal.AbstractTocBasedRuntimeRepository
createEnumXmlAdapter, getAllEnumClasses, getAllIpsTestCases, getAllModelTypeImplementationClasses, getAllProductComponentIds, getAllProductComponents, getAllProductComponents, getAllTables, getClass, getIpsTestCaseInternal, getIpsTestCasesStartingWith, getLatestProductComponentGenerationInternal, getNextProductComponentGenerationInternal, getNotCachedCustomObject, getNotCachedEnumValues, getNotCachedEnumXmlAdapter, getNotCachedProductComponent, getNotCachedProductComponentGeneration, getNotCachedTable, getNumberOfProductComponentGenerationsInternal, getPreviousProductComponentGenerationInternal, getProductComponentGenerationInternal, getProductComponentGenerations, getProductComponentInternal, getTableInternal, getTableOfContents, initialize, loadTableOfContentsMethods 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, getAllReferencedRepositories, getAllTables, 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
-
AbstractClassLoadingRuntimeRepository
public AbstractClassLoadingRuntimeRepository(String name, ICacheFactory cacheFactory, ClassLoader cl) - Parameters:
name- The name of the runtime repositorycacheFactory- the cache factory used by this runtime repositorycl- theClassLoaderused to load the classes
-
-
Method Details
-
createProductCmpt
- Specified by:
createProductCmptin classAbstractTocBasedRuntimeRepository
-
createProductComponentInstance
protected ProductComponent createProductComponentInstance(String implementationClassName, String ipsObjectId, String kindId, String versionId) -
createEnumValues
- Specified by:
createEnumValuesin classAbstractTocBasedRuntimeRepository
-
createProductCmptGeneration
- Specified by:
createProductCmptGenerationin classAbstractTocBasedRuntimeRepository
-
getProductVariantHelper
-
createProductComponentGenerationInstance
protected ProductComponentGeneration createProductComponentGenerationInstance(GenerationTocEntry tocEntry, ProductComponent productCmpt) -
getAllProductComponentsInternal
protected <T extends IProductComponent> void getAllProductComponentsInternal(Class<T> productCmptClass, List<T> result) Override the default implementation for better performance. The default implementation instantiates all product component before using the class filter. In this implementation we use the information in the toc to filter the list of product components before instantiation.- Overrides:
getAllProductComponentsInternalin classAbstractRuntimeRepository- Parameters:
productCmptClass- The class you want to search product components forresult- adding the found product components to result list
-
createTable
Description copied from class:AbstractTocBasedRuntimeRepositoryCreates the table object for the given toc entry.- Specified by:
createTablein classAbstractTocBasedRuntimeRepository
-
createTestCase
protected IpsTestCaseBase createTestCase(TestCaseTocEntry tocEntry, IRuntimeRepository runtimeRepository) Description copied from class:AbstractTocBasedRuntimeRepositoryCreates the test case object for the given toc entry.- Specified by:
createTestCasein classAbstractTocBasedRuntimeRepository
-
getClassLoader
Description copied from class:AbstractRuntimeRepositoryReturns the class loader that is used to load Java classes by this repository.This default implementation returns the class loader with which this repository class has been loaded.
- Specified by:
getClassLoaderin interfaceIRuntimeRepository- Overrides:
getClassLoaderin classAbstractRuntimeRepository
-
getDocumentElement
This method returns the xml element of the product component identified by the tocEntry -
getDocumentElement
This method returns the xml element of the product component generation identified by the tocEntry -
getDocumentElement
This method returns the xml element of the test case identified by the tocEntry -
getProductComponentGenerationImplClass
This method returns the name of the product component generation implementation class identified by the tocEntry. This could either be an implementation class using the formula evaluation or an implementation class containing the compiled formulas. -
getXmlAsStream
Returns the XML data for the specified tocEntry asInputStream- Parameters:
tocEntry- Specifying the requested EnumContent- Returns:
- An InputStream containing the XML data - should not return null!
- Throws:
RuntimeException- in case of any exception do not return null but an accurateRuntimeException
-
getXmlAsStream
Returns the XML data for the specified tocEntry asInputStream- Parameters:
tocEntry- Specifying the requested TableContent- Returns:
- An InputStream containing the XML data - should not return null!
- Throws:
RuntimeException- in case of any exception do not return null but an accurateRuntimeException
-
createCustomObject
- Specified by:
createCustomObjectin classAbstractTocBasedRuntimeRepository
-
initClRepositoryObject
protected <T> void initClRepositoryObject(CustomTocEntryObject<T> tocEntry, IClRepositoryObject runtimeObject) -
getDocumentElement
This method returns the xml element of the product component identified by the tocEntry
-