Here are the examples of the java api @org.springframework.context.annotation.EnableAspectJAutoProxy taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
148 Examples
18
View Source File : AopConfiguration.java
License : MIT License
Project Creator : zalando-nakadi
License : MIT License
Project Creator : zalando-nakadi
@Configuration
@EnableAspectJAutoProxy
public clreplaced AopConfiguration {
}
18
View Source File : DistributedApplicationBootstrap.java
License : Apache License 2.0
Project Creator : yin5980280
License : Apache License 2.0
Project Creator : yin5980280
/**
* @author : 潘多拉
* @version : 1.0
* @date : 2020/10/20 10:22 上午
* @link : cn.org.easysite.spring.boot.distributed.lock.test.DistributedApplicationBootstrap
*/
@SpringBootApplication
@EnableAspectJAutoProxy
public clreplaced DistributedApplicationBootstrap {
public static void main(String[] args) {
SpringApplication.run(DistributedApplicationBootstrap.clreplaced, args);
}
}
18
View Source File : DistributedApplicationBootstrap.java
License : Apache License 2.0
Project Creator : yin5980280
License : Apache License 2.0
Project Creator : yin5980280
/**
* @author : 潘多拉
* @version : 1.0
* @date : 2020/10/20 10:22 上午
* @link : cn.org.easysite.spring.boot.distributed.lock.test.DistributedApplicationBootstrap
*/
@SpringBootApplication
@EnableAspectJAutoProxy
public clreplaced DistributedApplicationBootstrap {
}
18
View Source File : SecurityAspectConfiguration.java
License : Apache License 2.0
Project Creator : xm-online
License : Apache License 2.0
Project Creator : xm-online
@Configuration
@EnableAspectJAutoProxy
public clreplaced SecurityAspectConfiguration {
@Bean
public SecurityAspect securityAspect() {
return new SecurityAspect();
}
}
18
View Source File : RestLoggingAspectConfiguration.java
License : Apache License 2.0
Project Creator : xm-online
License : Apache License 2.0
Project Creator : xm-online
@Configuration
@EnableAspectJAutoProxy
public clreplaced RestLoggingAspectConfiguration {
@Bean
public RestLoggingAspect restLoggingAspect(LoggingConfigService loggingConfigService) {
return new RestLoggingAspect(loggingConfigService);
}
@Bean
@ConditionalOnProperty("aspects.rest-call-logging")
public RestCallLoggingAspect restCallLoggingAspect() {
return new RestCallLoggingAspect();
}
}
18
View Source File : AspectLoggingTestConfig.java
License : Apache License 2.0
Project Creator : xm-online
License : Apache License 2.0
Project Creator : xm-online
/**
* Test config.
*/
@Configuration
@EnableAspectJAutoProxy
public clreplaced AspectLoggingTestConfig {
@Bean
public TestLoggingAspect testLoggingAspect() {
return new TestLoggingAspect();
}
@Bean
public TestServiceForLogging testServiceForLogging() {
return new TestServiceForLogging.TestServiceForLoggingImpl();
}
}
18
View Source File : ServiceLoggingAspectConfiguration.java
License : Apache License 2.0
Project Creator : xm-online
License : Apache License 2.0
Project Creator : xm-online
@Configuration
@EnableAspectJAutoProxy
public clreplaced ServiceLoggingAspectConfiguration {
@Bean
public ServiceLoggingAspect serviceLoggingAspect(LoggingConfigService loggingConfigService) {
return new ServiceLoggingAspect(loggingConfigService);
}
@ConditionalOnMissingBean(LoggingConfigService.clreplaced)
@Bean
public LoggingConfigService loggingConfigService() {
return new LoggingConfigServiceStub();
}
}
18
View Source File : TestController.java
License : Apache License 2.0
Project Creator : xiuhuai
License : Apache License 2.0
Project Creator : xiuhuai
/**
* Copyright (C), 2019-2019, XXX有限公司
* FileName: TestController
* Author: longzhonghua
* Date: 5/19/2019 8:50 PM
* Description:
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
@RestController
@EnableAspectJAutoProxy
public clreplaced TestController {
@RequestMapping("/")
@MyTestAnnotation("测试Annotation")
public void testAnnotation() {
System.err.println("测试自定义注解");
}
}
18
View Source File : AutoConfiguration.java
License : Apache License 2.0
Project Creator : wxiaoqi
License : Apache License 2.0
Project Creator : wxiaoqi
/**
* @author ace
* @create 2017/11/17.
*/
@ComponentScan({ "com.ace.cache" })
@EnableAspectJAutoProxy
public clreplaced AutoConfiguration {
@Bean
@ConfigurationProperties(prefix = "spring.redis")
@ConditionalOnProperty(name = "spring.redis.enable", havingValue = "true")
public RedisConfig constructBootRedisConfig() {
RedisConfig redisConfig = new RedisConfig();
return redisConfig;
}
@Bean
@ConditionalOnProperty(name = "spring.redis.enable", havingValue = "true")
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
RedisTemplate<String, Object> template = new RedisTemplate<>();
// 配置连接工厂
template.setConnectionFactory(factory);
// 使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.clreplaced);
ObjectMapper om = new ObjectMapper();
// 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
// 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jacksonSeial.setObjectMapper(om);
// 值采用json序列化
template.setValueSerializer(jacksonSeial);
// 使用StringRedisSerializer来序列化和反序列化redis的key值
template.setKeySerializer(new StringRedisSerializer());
// 设置hash key 和value序列化模式
template.setHashKeySerializer(new StringRedisSerializer());
template.setHashValueSerializer(jacksonSeial);
template.afterPropertiesSet();
return template;
}
@Bean
@ConditionalOnProperty(name = "spring.redis.enable", havingValue = "true")
public BootRedisServiceImpl constructBootRedisServiceImpl() {
return new BootRedisServiceImpl();
}
/**
* *** 旧的Redis配置 ****
*/
@Bean
@ConditionalOnProperty(name = "redis.enable", havingValue = "true")
public RedisServiceImpl constructRedisServiceImpl() {
return new RedisServiceImpl();
}
@Bean
@ConfigurationProperties(prefix = "redis")
@ConditionalOnProperty(name = "redis.enable", havingValue = "true")
public RedisConfig constructRedisConfig() {
RedisConfig redisConfig = new RedisConfig();
return redisConfig;
}
@Bean
@ConditionalOnProperty(name = "redis.enable", havingValue = "true")
public JedisPoolConfig constructJedisPoolConfig(RedisConfig redisConfig) {
JedisPoolConfig config = new JedisPoolConfig();
// 控制一个pool可分配多少个jedis实例,通过pool.getResource()来获取;
// 如果赋值为-1,则表示不限制;如果pool已经分配了maxActive个jedis实例,则此时pool的状态为exhausted(耗尽)。
config.setMaxTotal(Integer.parseInt(redisConfig.getPool().getMaxActive()));
// 控制一个pool最多有多少个状态为idle(空闲的)的jedis实例。
config.setMaxIdle(Integer.parseInt(redisConfig.getPool().getMaxIdle()));
// 表示当borrow(引入)一个jedis实例时,最大的等待时间,如果超过等待时间,则直接抛出JedisConnectionException;
config.setMaxWaitMillis(Integer.parseInt(redisConfig.getPool().getMaxWait()));
config.setTestOnBorrow(true);
return config;
}
@Bean(name = "pool")
@ConditionalOnProperty(name = "redis.enable", havingValue = "true")
public JedisPool constructJedisPool(JedisPoolConfig poolConfig, RedisConfig redisConfig) {
String ip = redisConfig.getHost();
int port = Integer.parseInt(redisConfig.getPort());
String preplacedword = redisConfig.getPreplacedword();
int timeout = Integer.parseInt(redisConfig.getTimeout());
int database = Integer.parseInt(redisConfig.getDatabase());
if (StringUtils.isBlank(preplacedword)) {
return new JedisPool(poolConfig, ip, port, timeout, null, database);
} else {
return new JedisPool(poolConfig, ip, port, timeout, preplacedword, database);
}
}
@Bean
@ConditionalOnBean(RedisConfig.clreplaced)
public CacheAPI cacheRedis() {
return new CacheRedis();
}
}
18
View Source File : AopConfiguration.java
License : MIT License
Project Creator : woowacourse-teams
License : MIT License
Project Creator : woowacourse-teams
@EnableAspectJAutoProxy
@Configuration
public clreplaced AopConfiguration {
}
18
View Source File : AopConfig.java
License : MIT License
Project Creator : wells2333
License : MIT License
Project Creator : wells2333
/**
* 配置aop
*
* @author tangyi
* @date 2019-11-12 20:13
*/
@Configuration
@EnableAspectJAutoProxy
public clreplaced AopConfig {
}
18
View Source File : MetricsConfiguration.java
License : Apache License 2.0
Project Creator : rbkmoney
License : Apache License 2.0
Project Creator : rbkmoney
@Configuration
@EnableAspectJAutoProxy
public clreplaced MetricsConfiguration {
@Bean
SimpleMeasureAspect simpleMeasureAspect(StatsdMeterRegistry registry) {
return new SimpleMeasureAspect(registry);
}
}
18
View Source File : ProxyConfig.java
License : GNU General Public License v2.0
Project Creator : rackshift
License : GNU General Public License v2.0
Project Creator : rackshift
@Component
@EnableAspectJAutoProxy
public clreplaced ProxyConfig {
@PostConstruct
public void initVelocity() {
Properties ve = new Properties();
ve.setProperty("file.resource.loader.clreplaced", "org.apache.velocity.runtime.resource.loader.ClreplacedpathResourceLoader");
Velocity.init(ve);
}
}
18
View Source File : LoggingAspectConfiguration.java
License : MIT License
Project Creator : puzzle
License : MIT License
Project Creator : puzzle
@Configuration
@EnableAspectJAutoProxy
public clreplaced LoggingAspectConfiguration {
@Bean
@Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)
public LoggingAspect loggingAspect(Environment env) {
return new LoggingAspect(env);
}
}
18
View Source File : AppConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
/**
* @author Dinesh.Rajput
*/
@Configuration
@EnableAspectJAutoProxy
@ComponentScan(basePackages = { "com.packt.patterninspring.chapter6.bankapp.service" })
public clreplaced AppConfig {
@Bean
public Auditing auditing() {
return new Auditing();
}
}
18
View Source File : AppConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
@Configuration
@EnableAspectJAutoProxy
public clreplaced AppConfig {
@Bean
public TransferService transferService() {
return new TransferServiceImpl(accountRepository(), transferRepository());
}
@Bean
public AccountRepository accountRepository() {
return new JdbcAccountRepository();
}
@Bean
public TransferRepository transferRepository() {
return new JdbcTransferRepository();
}
@Bean
public LoggingAspect loggingAspect() {
return new LoggingAspect();
}
}
18
View Source File : JDKProxyAppConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
@Configuration
@EnableAspectJAutoProxy
public clreplaced JDKProxyAppConfig {
@Bean
@Scope(proxyMode = ScopedProxyMode.INTERFACES)
public TransferService transferService() {
return new TransferServiceImpl();
}
}
18
View Source File : CGLIBProxyAppConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
@EnableAspectJAutoProxy
@Configuration
public clreplaced CGLIBProxyAppConfig {
@Bean
@Scope(proxyMode = ScopedProxyMode.TARGET_CLreplaced)
public TransferService transferService() {
return new TransferServiceImpl();
}
}
18
View Source File : PerformanceInterceptorAppConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
@EnableAspectJAutoProxy
@Configuration
public clreplaced PerformanceInterceptorAppConfig {
@Bean
public TransferService transferService() {
return new TransferServiceImpl();
}
@Bean
public PerformanceMonitorInterceptor performanceMonitorInterceptor() {
return new PerformanceMonitorInterceptor(true);
}
@Bean
public TransferMonitoringAspect transferAspect() {
return new TransferMonitoringAspect();
}
@Bean
public PerformanceMonitorAdvisor performanceMonitorAdvisor() {
return new PerformanceMonitorAdvisor(performanceMonitorInterceptor());
}
}
18
View Source File : CustomPerformanceInterceptorAppConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
@EnableAspectJAutoProxy
@Configuration
public clreplaced CustomPerformanceInterceptorAppConfig {
@Bean
public TransferService transferService() {
return new TransferServiceImpl();
}
@Bean
public CustomPerformanceMonitorInterceptor customPerformanceMonitorInterceptor() {
return new CustomPerformanceMonitorInterceptor(true);
}
@Bean
public TransferMonitoringAspect transferAspect() {
return new TransferMonitoringAspect();
}
@Bean
public CustomPerformanceMonitorAdvisor customPerformanceMonitorAdvisor() {
return new CustomPerformanceMonitorAdvisor(customPerformanceMonitorInterceptor());
}
}
18
View Source File : AppConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
@Configuration
@EnableAspectJAutoProxy
public clreplaced AppConfig {
@Bean
public TransferService transferService() {
return new TransferServiceImpl();
}
@Bean
public TransferServiceAspect transferServiceAspect() {
return new TransferServiceAspect();
}
}
18
View Source File : ApplicationConfiguration.java
License : MIT License
Project Creator : nielsutrecht
License : MIT License
Project Creator : nielsutrecht
@Configuration
@EnableAspectJAutoProxy
public clreplaced ApplicationConfiguration {
}
18
View Source File : LoggingAspectConfiguration.java
License : GNU General Public License v3.0
Project Creator : michaelhoffmantech
License : GNU General Public License v3.0
Project Creator : michaelhoffmantech
/**
* Enables the logging aspect. If eventually using this for production, its
* recommended to annotate the clreplaced for the Spring Profile "dev" only so that
* the logging aspect isn't applied in production mode.
*/
@Configuration
@EnableAspectJAutoProxy
public clreplaced LoggingAspectConfiguration {
@Bean
public LoggingAspect loggingAspect(Environment env) {
return new LoggingAspect(env);
}
}
18
View Source File : EventPublicationInterceptorDemo.java
License : Apache License 2.0
Project Creator : mercyblitz
License : Apache License 2.0
Project Creator : mercyblitz
/**
* {@link EventPublicationInterceptor} 示例
*
* @author <a href="mailto:[email protected]">Mercy</a>
* @since
*/
// Configuration Clreplaced
@Configuration
@EnableAspectJAutoProxy
public clreplaced EventPublicationInterceptorDemo {
public static void main(String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.register(EventPublicationInterceptorDemo.clreplaced, Executor.clreplaced, StaticExecutor.clreplaced);
// 启动 Spring 应用上下文
context.refresh();
// 5. 执行目标方法
Executor executor = context.getBean(Executor.clreplaced);
StaticExecutor staticExecutor = context.getBean(StaticExecutor.clreplaced);
executor.execute();
staticExecutor.execute();
// 关闭 Spring 应用上下文
context.close();
}
// 1. 将 EventPublicationInterceptor 声明为 Spring Bean
@Bean
public static EventPublicationInterceptor eventPublicationInterceptor() {
EventPublicationInterceptor eventPublicationInterceptor = new EventPublicationInterceptor();
// 关联目标(自定义)事件类型 - ExecutedEvent
eventPublicationInterceptor.setApplicationEventClreplaced(ExecutedEvent.clreplaced);
return eventPublicationInterceptor;
}
// 2. 实现 Pointcut Bean
@Bean
public static Pointcut pointcut() {
return new StaticMethodMatcherPointcut() {
@Override
public boolean matches(Method method, Clreplaced<?> targetClreplaced) {
return "execute".equals(method.getName()) && Executor.clreplaced.equals(targetClreplaced);
}
};
}
// 3. 声明一个 Advisor Bean
@Bean
public static PointcutAdvisor pointcutAdvisor(Pointcut pointcut, EventPublicationInterceptor eventPublicationInterceptor) {
// EventPublicationInterceptor is MethodInterceptor is Advice
return new DefaultPointcutAdvisor(pointcut, eventPublicationInterceptor);
}
// 4. 处理事件 - ExecutedEvent
@EventListener(ExecutedEvent.clreplaced)
public void executed(ExecutedEvent event) {
System.out.println("Executed : " + event);
}
}
18
View Source File : ProviderMain.java
License : GNU Lesser General Public License v3.0
Project Creator : liuyangming
License : GNU Lesser General Public License v3.0
Project Creator : liuyangming
@EnableAspectJAutoProxy
@SpringBootApplication(scanBasePackages = { "com.bytesvc.service", "com.bytesvc.config" })
// 使用文件存储时, 不需要配置mongodb
@EnableAutoConfiguration(exclude = { MongoAutoConfiguration.clreplaced })
public clreplaced ProviderMain {
public static void main(String... args) throws Throwable {
SpringApplication application = new SpringApplication(ProviderMain.clreplaced);
application.setBannerMode(Banner.Mode.OFF);
application.run(args);
System.out.println("sample-provider started!");
}
}
18
View Source File : SsoServerApplication.java
License : MIT License
Project Creator : liuhuiAndroid
License : MIT License
Project Creator : liuhuiAndroid
/**
* 单点登录服务器
*
* @author stylefeng
* @Date 2018年2月3日15:32:21
*/
@SpringBootApplication
@EnableAspectJAutoProxy
public clreplaced SsoServerApplication {
public static void main(String[] args) {
SpringApplication.run(SsoServerApplication.clreplaced, args);
}
}
18
View Source File : CustomerServiceApplication.java
License : Apache License 2.0
Project Creator : linnykoleh
License : Apache License 2.0
Project Creator : linnykoleh
@SpringBootApplication
@EnableAspectJAutoProxy
public clreplaced CustomerServiceApplication {
public static void main(String[] args) {
SpringApplication.run(CustomerServiceApplication.clreplaced, args);
}
}
18
View Source File : LoggingAspectConfiguration.java
License : GNU General Public License v3.0
Project Creator : klask-io
License : GNU General Public License v3.0
Project Creator : klask-io
@Configuration
@EnableAspectJAutoProxy
public clreplaced LoggingAspectConfiguration {
@Bean
@Profile(Constants.SPRING_PROFILE_DEVELOPMENT)
public LoggingAspect loggingAspect() {
return new LoggingAspect();
}
}
18
View Source File : KlockTestApplication.java
License : Apache License 2.0
Project Creator : kekingcn
License : Apache License 2.0
Project Creator : kekingcn
/**
* Created by kl on 2017/12/31.
*/
@SpringBootApplication
@EnableAspectJAutoProxy
public clreplaced KlockTestApplication {
public static void main(String[] args) {
SpringApplication.run(KlockTestApplication.clreplaced, args);
}
}
18
View Source File : LogEnvironmentApplication.java
License : Apache License 2.0
Project Creator : kaituozhesh
License : Apache License 2.0
Project Creator : kaituozhesh
@EnableAspectJAutoProxy
@SpringBootApplication
public clreplaced LogEnvironmentApplication {
public static void main(String[] args) {
SpringApplication.run(LogEnvironmentApplication.clreplaced, args);
}
}
18
View Source File : QueryApplication.java
License : Apache License 2.0
Project Creator : joumenharzli
License : Apache License 2.0
Project Creator : joumenharzli
@SpringBootApplication
@EnableAspectJAutoProxy
public clreplaced QueryApplication {
public static void main(String[] args) {
SpringApplication.run(QueryApplication.clreplaced, args);
}
}
18
View Source File : AOPConfig.java
License : MIT License
Project Creator : ita-social-projects
License : MIT License
Project Creator : ita-social-projects
/**
* Configuration for AOP-related parts of the application.
*/
@Configuration
@EnableAspectJAutoProxy
public clreplaced AOPConfig {
}
18
View Source File : WicketMoreTestJpaConfig.java
License : Apache License 2.0
Project Creator : igloo-project
License : Apache License 2.0
Project Creator : igloo-project
@Configuration
@EnableAspectJAutoProxy
public clreplaced WicketMoreTestJpaConfig extends AbstractConfiguredJpaConfig {
@Override
public JpaPackageScanProvider applicationJpaPackageScanProvider() {
return new JpaPackageScanProvider(WicketMoreTestBusinessPackage.clreplaced.getPackage());
}
}
18
View Source File : RestServerTestJpaConfig.java
License : Apache License 2.0
Project Creator : igloo-project
License : Apache License 2.0
Project Creator : igloo-project
@Configuration
@EnableAspectJAutoProxy
public clreplaced RestServerTestJpaConfig extends AbstractConfiguredJpaConfig {
@Override
public JpaPackageScanProvider applicationJpaPackageScanProvider() {
return new JpaPackageScanProvider(RestTestBusinessPackage.clreplaced.getPackage());
}
}
18
View Source File : RestClientTestJpaConfig.java
License : Apache License 2.0
Project Creator : igloo-project
License : Apache License 2.0
Project Creator : igloo-project
@Configuration
@EnableAspectJAutoProxy
public clreplaced RestClientTestJpaConfig extends AbstractConfiguredJpaConfig {
@Override
public JpaPackageScanProvider applicationJpaPackageScanProvider() {
return new JpaPackageScanProvider(RestTestBusinessPackage.clreplaced.getPackage());
}
}
18
View Source File : JpaSearchJpaTestConfig.java
License : Apache License 2.0
Project Creator : igloo-project
License : Apache License 2.0
Project Creator : igloo-project
@Configuration
@EnableAspectJAutoProxy
public clreplaced JpaSearchJpaTestConfig extends AbstractConfiguredJpaConfig {
@Override
public JpaPackageScanProvider applicationJpaPackageScanProvider() {
return new JpaPackageScanProvider(JpaTestSearchPackage.clreplaced.getPackage());
}
}
18
View Source File : JpaTestJpaConfig.java
License : Apache License 2.0
Project Creator : igloo-project
License : Apache License 2.0
Project Creator : igloo-project
@Configuration
@EnableAspectJAutoProxy
public clreplaced JpaTestJpaConfig extends AbstractConfiguredJpaConfig {
@Override
public JpaPackageScanProvider applicationJpaPackageScanProvider() {
return new JpaPackageScanProvider(JpaTestBusinessPackage.clreplaced.getPackage());
}
}
18
View Source File : JpaSecurityTestJpaConfig.java
License : Apache License 2.0
Project Creator : igloo-project
License : Apache License 2.0
Project Creator : igloo-project
@Configuration
@EnableAspectJAutoProxy
public clreplaced JpaSecurityTestJpaConfig extends AbstractConfiguredJpaSecurityJpaConfig {
@Override
public JpaPackageScanProvider applicationJpaPackageScanProvider() {
return new JpaPackageScanProvider(JpaSecurityTestBusinessPackage.clreplaced.getPackage());
}
}
18
View Source File : JpaExternalLinkCheckerTestJpaConfig.java
License : Apache License 2.0
Project Creator : igloo-project
License : Apache License 2.0
Project Creator : igloo-project
@Configuration
@EnableAspectJAutoProxy
public clreplaced JpaExternalLinkCheckerTestJpaConfig extends AbstractConfiguredJpaConfig {
@Override
public JpaPackageScanProvider applicationJpaPackageScanProvider() {
return new JpaPackageScanProvider(JpaExternalLinkCheckerBusinessPackage.clreplaced.getPackage());
}
@Bean
public Interceptor interceptor() {
return new ChainedInterceptor().add(new ExternalLinkWrapperInterceptor());
}
}
18
View Source File : BasicApplicationCoreCommonJpaConfig.java
License : Apache License 2.0
Project Creator : igloo-project
License : Apache License 2.0
Project Creator : igloo-project
@Configuration
@EnableAspectJAutoProxy
public clreplaced BasicApplicationCoreCommonJpaConfig {
/**
* Déclaration des packages de scan pour l'application.
*/
@Bean
public JpaPackageScanProvider applicationJpaPackageScanProvider() {
return new JpaPackageScanProvider(BasicApplicationCoreCommonBusinessPackage.clreplaced.getPackage(), // Typedef config
HibernateConfigPackage.clreplaced.getPackage());
}
@Bean
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public <T extends ReferenceData<? super T>, S extends ISort<SortField>> IBasicReferenceDataSearchQuery<T, S> basicReferenceDataSearchQuery(Clreplaced<T> clazz) {
return new BasicReferenceDataSearchQueryImpl<>(clazz);
}
}
18
View Source File : AopConfig.java
License : MIT License
Project Creator : HouariZegai
License : MIT License
Project Creator : HouariZegai
@Configuration
@EnableAspectJAutoProxy
public clreplaced AopConfig {
}
18
View Source File : PermissionApplication.java
License : MIT License
Project Creator : goufaning
License : MIT License
Project Creator : goufaning
@EnableAspectJAutoProxy
@SpringBootApplication
public clreplaced PermissionApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(PermissionApplication.clreplaced, args);
}
// 为了打包springboot项目
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(this.getClreplaced());
}
}
18
View Source File : ProductApplication.java
License : Apache License 2.0
Project Creator : csj4032
License : Apache License 2.0
Project Creator : csj4032
@SpringBootApplication
@EnableAspectJAutoProxy
public clreplaced ProductApplication {
public static void main(String[] args) {
SpringApplication.run(ProductApplication.clreplaced, args);
}
}
18
View Source File : AspectConfig.java
License : BSD 3-Clause "New" or "Revised" License
Project Creator : Coding
License : BSD 3-Clause "New" or "Revised" License
Project Creator : Coding
/**
* Created by mingshun on 15-11-2.
*/
@Configuration
@EnableAspectJAutoProxy
public clreplaced AspectConfig {
}
18
View Source File : TimeLimiterApplication.java
License : Apache License 2.0
Project Creator : baidu
License : Apache License 2.0
Project Creator : baidu
/**
* @author Bowu Dong ([email protected])
*/
@SpringBootApplication
@EnableAspectJAutoProxy
public clreplaced TimeLimiterApplication {
public static void main(String[] args) {
SpringApplication.run(TimeLimiterApplication.clreplaced, args);
}
}
18
View Source File : MonitoringConfig.java
License : MIT License
Project Creator : apssouza22
License : MIT License
Project Creator : apssouza22
/**
* @author Maciej Szarlinski
*/
@Configuration
@EnableAspectJAutoProxy
public clreplaced MonitoringConfig {
}
18
View Source File : TransactionAspectConfig.java
License : Apache License 2.0
Project Creator : apache
License : Apache License 2.0
Project Creator : apache
@Configuration
@EnableAspectJAutoProxy
public clreplaced TransactionAspectConfig {
@Bean
MessageHandler messageHandler(SagaMessageSender sender, @Qualifier("compensationContext") CallbackContext context, OmegaContext omegaContext) {
return new CompensationMessageHandler(sender, context);
}
@Bean
SagaStartAspect sagaStartAspect(SagaMessageSender sender, OmegaContext context) {
return new SagaStartAspect(sender, context);
}
@Bean
TransactionAspect transactionAspect(SagaMessageSender sender, OmegaContext context) {
return new TransactionAspect(sender, context);
}
@Bean
CompensableAnnotationProcessor compensableAnnotationProcessor(OmegaContext omegaContext, @Qualifier("compensationContext") CallbackContext compensationContext) {
return new CompensableAnnotationProcessor(omegaContext, compensationContext);
}
@Bean
TccMessageHandler coordinateMessageHandler(TccMessageSender tccMessageSender, @Qualifier("coordinateContext") CallbackContext coordinateContext, OmegaContext omegaContext, ParametersContext parametersContext) {
return new CoordinateMessageHandler(tccMessageSender, coordinateContext, omegaContext, parametersContext);
}
@Bean
TccStartAspect tccStartAspect(TccMessageSender tccMessageSender, OmegaContext context) {
return new TccStartAspect(tccMessageSender, context);
}
@Bean
TccParticipatorAspect tccParticipatorAspect(TccMessageSender tccMessageSender, OmegaContext context, ParametersContext parametersContext) {
return new TccParticipatorAspect(tccMessageSender, context, parametersContext);
}
@Bean
ParticipateAnnotationProcessor participateAnnotationProcessor(OmegaContext omegaContext, @Qualifier("coordinateContext") CallbackContext coordinateContext) {
return new ParticipateAnnotationProcessor(omegaContext, coordinateContext);
}
}
18
View Source File : ZipkinSpanAspectConfig.java
License : Apache License 2.0
Project Creator : apache
License : Apache License 2.0
Project Creator : apache
@Configuration
@EnableAspectJAutoProxy
clreplaced ZipkinSpanAspectConfig {
@Bean
ZipkinSpanAspect zipkinSpanAspect(Tracing tracing) {
return new ZipkinSpanAspect(tracing);
}
}
18
View Source File : LoggingAspectConfiguration.java
License : Apache License 2.0
Project Creator : anitechcs
License : Apache License 2.0
Project Creator : anitechcs
/**
* AOP logging execution configuration
*
* @author Tapas
*/
@Configuration
@EnableAspectJAutoProxy
public clreplaced LoggingAspectConfiguration {
@Bean
@Profile(Constants.SPRING_PROFILE_DEVELOPMENT)
public LoggingAspect loggingAspect() {
return new LoggingAspect();
}
}
18
View Source File : MainApplication.java
License : Apache License 2.0
Project Creator : AnghelLeonard
License : Apache License 2.0
Project Creator : AnghelLeonard
@SpringBootApplication
@EnableAspectJAutoProxy
public clreplaced MainApplication {
private final BookstoreService bookstoreService;
public MainApplication(BookstoreService bookstoreService) {
this.bookstoreService = bookstoreService;
}
public static void main(String[] args) {
SpringApplication.run(MainApplication.clreplaced, args);
}
@Bean
public OptimisticConcurrencyControlAspect optimisticConcurrencyControlAspect() {
return new OptimisticConcurrencyControlAspect();
}
@Bean
public ApplicationRunner init() {
return args -> {
ExecutorService executor = Executors.newFixedThreadPool(2);
executor.execute(bookstoreService);
// Thread.sleep(2000); -> adding a sleep here will break the transactions concurrency
executor.execute(bookstoreService);
executor.shutdown();
try {
executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
};
}
}
See More Examples