Interface IRuntimeRepositoryLookup
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
IRuntimeRepositoryLookup.RuntimeRepositoryLookupByToC
IRuntimeRepositoryLookup is an interface for a class that is able to provide a runtime
repository. It is used to serialize and deserialize policy components especially the
ProductConfiguration and enumeration contents.
An implementation needs to be serializable hence this interface already implements the
Serializable interface. After serializing and deserializing an object of this type the
method getRuntimeRepository() must return an IRuntimeRepository with the same
content as before - when deserialized on the same machine, it must be the same instance, usually
a singleton.
For a ClassloaderRuntimeRepository, its withLookup() method can be used to register it in a static lookup table that returns the same
instance, identified by the path to the repository's table-of-contents file.
Alternatively, a ClassloaderRuntimeRepository can be created and registered all in one
call to the byToC(String) factory method.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classAnIRuntimeRepositoryLookupthat serializes only the path to theClassloaderRuntimeRepository's table-of-contents file. -
Method Summary
Modifier and TypeMethodDescriptionstatic IRuntimeRepositoryLookupCreates a newClassloaderRuntimeRepositoryfor the given table-of-contents file path and returns anIRuntimeRepositoryLookupthat will always return that repository on this machine and recreate it if necessary when deserialized on other machines.Returns an instance ofIRuntimeRepositorythat can be used to load the product component and generation of a serializedProductConfigurationafter deserialization.
-
Method Details
-
getRuntimeRepository
IRuntimeRepository getRuntimeRepository()Returns an instance ofIRuntimeRepositorythat can be used to load the product component and generation of a serializedProductConfigurationafter deserialization.- Returns:
- A
IRuntimeRepositoryused to load product components and product component generations.
-
byToC
Creates a newClassloaderRuntimeRepositoryfor the given table-of-contents file path and returns anIRuntimeRepositoryLookupthat will always return that repository on this machine and recreate it if necessary when deserialized on other machines.Be aware that referenced repositories must be set on the repository returned from
getRuntimeRepository(), and each repository must have anIRuntimeRepositoryLookup. For deserialization to work with referenced repositories, the lookups need to be initialized prior to deserializing the first instance, as that would create a new repository without referenced repositories.- Parameters:
tocPath- Path to the resource containing the ToC file. E.g. "org/faktorips/sample/internal/faktorips-repository-toc.xml"- Returns:
- an
IRuntimeRepositoryLookupthat will always return the sameClassloaderRuntimeRepositorycreated from the given ToC path - Since:
- 25.7
-