Package org.apache.openjpa.lib.conf
Interface ProductDerivation
- All Known Subinterfaces:
OpenJPAProductDerivation
- All Known Implementing Classes:
AbstractProductDerivation
,JDBCPersistenceProductDerivation
,JDBCProductDerivation
,PersistenceProductDerivation
,ProductDerivation
public interface ProductDerivation
Hooks for deriving products with additional functionality.
Parses configuration information from global, default or explictly-specified
resources. All implementations of this interface will have a chance to mutate
a
Configuration
both before and after the user-specified
configuration data is loaded. The order in which the product derivations are
evaluated is determined by the specificity of the derivation type.- Since:
- 0.4.1
- Author:
- Abe White, Pinaki Poddar
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Called after the specification has been set.void
Called before the given Configuration is closed.boolean
Provides the instance with a callback to mutate the initial properties of theConfigurationProvider
.boolean
Provides the instance with the opportunity to mutateconf
before the user configuration is applied.getAnchorsInFile
(File file) Return a Listof all the anchors defined in file
.getAnchorsInResource
(String resource) Return a Listof all the anchors defined in resource
.Return the configuration prefix for properties of this product.Return a string identifying the default resource location for this product derivation, if one exists.Return set of Query hint keys recognized by this receiver.int
getType()
Return the type of derivation.Load given file, or return null if it is not a file this receiver understands.load
(String resource, String anchor, ClassLoader loader) Load the given given resource into the returned ConfigurationProvider, or return null if it is not a resource this receiver understands.loadDefaults
(ClassLoader loader) Load defaults into the returned ConfigurationProvider, or return null if no defaults are found.loadGlobals
(ClassLoader loader) Load globals into the returned ConfigurationProvider, or return null if no globals are found.void
validate()
Ensure that this derivation is valid.
-
Field Details
-
TYPE_PRODUCT
static final int TYPE_PRODUCT- See Also:
-
TYPE_FEATURE
static final int TYPE_FEATURE- See Also:
-
-
Method Details
-
getType
int getType()Return the type of derivation. -
getConfigurationPrefix
String getConfigurationPrefix()Return the configuration prefix for properties of this product. -
validate
Ensure that this derivation is valid. This action might consist of loading classes for the product this derivation represents to be sure they exist. Throw any throwable to indicate an invalid derivation. Invalid derivations will not be used.- Throws:
Exception
-
loadGlobals
Load globals into the returned ConfigurationProvider, or return null if no globals are found.- Throws:
Exception
-
loadDefaults
Load defaults into the returned ConfigurationProvider, or return null if no defaults are found.- Throws:
Exception
-
load
Load the given given resource into the returned ConfigurationProvider, or return null if it is not a resource this receiver understands. The given class loader may be null.- Parameters:
anchor
- optional named anchor within a multiple-configuration resource- Throws:
Exception
-
load
Load given file, or return null if it is not a file this receiver understands.- Parameters:
anchor
- optional named anchor within a multiple-configuration file- Throws:
Exception
-
getDefaultResourceLocation
String getDefaultResourceLocation()Return a string identifying the default resource location for this product derivation, if one exists. If there is no default location, returnsnull
.- Since:
- 1.1.0
-
getAnchorsInFile
Return a Listof all the anchors defined in file
. The returned names are not fully-qualified, so must be used in conjunction withfile
in calls toload(java.io.File, String)
. Returnsnull
or an empty list if no anchors could be found.- Throws:
IOException
Exception
- Since:
- 1.1.0
-
getAnchorsInResource
Return a Listof all the anchors defined in resource
. The returned names are not fully-qualified, so must be used in conjunction withresource
in calls toload(java.io.File, String)
. Returnsnull
or an empty list if no anchors could be found.- Throws:
Exception
- Since:
- 1.1.0
-
beforeConfigurationConstruct
Provides the instance with a callback to mutate the initial properties of theConfigurationProvider
. This is primarily to alter or add properties that determine what type of configuration is constructed, and therefore is typically used at runtime only.- Returns:
- true if given ConfigurationProvider has been mutated.
-
beforeConfigurationLoad
Provides the instance with the opportunity to mutateconf
before the user configuration is applied.- Returns:
- true if given Configuration has been mutated.
-
afterSpecificationSet
Called after the specification has been set.- Returns:
- true if given Configuration has been mutated.
-
beforeConfigurationClose
Called before the given Configuration is closed.- Since:
- 0.9.7
-
getSupportedQueryHints
Return set of Query hint keys recognized by this receiver.- Since:
- 2.0.0
-