@Bean
        @ConditionalOnMissingBean(name = "dataSourceEvent")
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public DataSource dataSourceEvent(
            final ConfigurableApplicationContext applicationContext,
            final CasConfigurationProperties casProperties) {
            return BeanSupplier.of(DataSource.class)
                .when(CONDITION.given(applicationContext.getEnvironment()))
                .supply(() -> JpaBeans.newDataSource(casProperties.getEvents().getJpa()))
                .otherwiseProxy()
                .get();
        }
This is {@link CasJpaEventsAutoConfiguration}, defines certain beans via configuration
while delegating some to Spring namespaces inside the context config file.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-events-jpa/src/main/java/org/apereo/cas/config/CasJpaEventsAutoConfiguration.java