Class AuditingBeanDefinitionRegistrarSupport
java.lang.Object
org.springframework.data.auditing.config.AuditingBeanDefinitionRegistrarSupport
- All Implemented Interfaces:
ImportBeanDefinitionRegistrar
public abstract class AuditingBeanDefinitionRegistrarSupport
extends Object
implements ImportBeanDefinitionRegistrar
A
ImportBeanDefinitionRegistrar
that serves as a base class for store specific implementations for
configuring audit support. Registers a AuditingHandler
based on the provided configuration(
AuditingConfiguration
).- Author:
- Ranie Jade Ramiso, Thomas Darimont, Oliver Gierke, Francisco Soler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected BeanDefinitionBuilder
configureDefaultAuditHandlerAttributes
(AuditingConfiguration configuration, BeanDefinitionBuilder builder) Configures the givenBeanDefinitionBuilder
with the default attributes from the givenAuditingConfiguration
.protected abstract Class<? extends Annotation>
Return the annotation type to lookup configuration values from.protected BeanDefinitionBuilder
getAuditHandlerBeanDefinitionBuilder
(AuditingConfiguration configuration) Creates aBeanDefinitionBuilder
to ease the definition of store specificAuditingHandler
implementations.protected abstract String
Return the name to be used to register theAuditingHandler
under.protected AuditingConfiguration
getConfiguration
(AnnotationMetadata annotationMetadata) Retrieve auditing configuration from the givenAnnotationMetadata
.protected void
postProcess
(BeanDefinitionBuilder builder, AuditingConfiguration configuration, BeanDefinitionRegistry registry) Customization hook to post-process the AuditHandler BeanDefinition.protected AbstractBeanDefinition
registerAuditHandlerBeanDefinition
(AuditingConfiguration configuration, BeanDefinitionRegistry registry) Registers an appropriate BeanDefinition for anAuditingHandler
.protected abstract void
registerAuditListenerBeanDefinition
(BeanDefinition auditingHandlerDefinition, BeanDefinitionRegistry registry) Register the listener to eventually trigger theAuditingHandler
.void
registerBeanDefinitions
(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) protected void
registerInfrastructureBeanWithId
(AbstractBeanDefinition definition, String id, BeanDefinitionRegistry registry) Registers the givenAbstractBeanDefinition
as infrastructure bean under the given id.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.annotation.ImportBeanDefinitionRegistrar
registerBeanDefinitions
-
Constructor Details
-
AuditingBeanDefinitionRegistrarSupport
public AuditingBeanDefinitionRegistrarSupport()
-
-
Method Details
-
registerBeanDefinitions
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) - Specified by:
registerBeanDefinitions
in interfaceImportBeanDefinitionRegistrar
-
registerAuditHandlerBeanDefinition
protected AbstractBeanDefinition registerAuditHandlerBeanDefinition(AuditingConfiguration configuration, BeanDefinitionRegistry registry) Registers an appropriate BeanDefinition for anAuditingHandler
.- Parameters:
configuration
- must not be null.registry
- must not be null.- Returns:
-
postProcess
protected void postProcess(BeanDefinitionBuilder builder, AuditingConfiguration configuration, BeanDefinitionRegistry registry) Customization hook to post-process the AuditHandler BeanDefinition.- Parameters:
builder
- must not be null.registry
- must not be null.configuration
- must not be null.- Since:
- 3.0
-
getAuditHandlerBeanDefinitionBuilder
protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) Creates aBeanDefinitionBuilder
to ease the definition of store specificAuditingHandler
implementations.- Parameters:
configuration
- must not be null.- Returns:
-
configureDefaultAuditHandlerAttributes
protected BeanDefinitionBuilder configureDefaultAuditHandlerAttributes(AuditingConfiguration configuration, BeanDefinitionBuilder builder) Configures the givenBeanDefinitionBuilder
with the default attributes from the givenAuditingConfiguration
.- Parameters:
configuration
- must not be null.builder
- must not be null.- Returns:
- the builder with the audit attributes configured.
-
getConfiguration
Retrieve auditing configuration from the givenAnnotationMetadata
.- Parameters:
annotationMetadata
- will never be null.- Returns:
-
getAnnotation
Return the annotation type to lookup configuration values from.- Returns:
- must not be null.
-
registerAuditListenerBeanDefinition
protected abstract void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition, BeanDefinitionRegistry registry) Register the listener to eventually trigger theAuditingHandler
.- Parameters:
auditingHandlerDefinition
- will never be null.registry
- will never be null.
-
getAuditingHandlerBeanName
Return the name to be used to register theAuditingHandler
under.- Returns:
-
registerInfrastructureBeanWithId
protected void registerInfrastructureBeanWithId(AbstractBeanDefinition definition, String id, BeanDefinitionRegistry registry) Registers the givenAbstractBeanDefinition
as infrastructure bean under the given id.- Parameters:
definition
- must not be null.id
- must not be null or empty.registry
- must not be null.
-