com.atlassian.connect.spring.internal.AsynchronousApplicationEventPublisher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of atlassian-connect-spring-boot-core Show documentation
Show all versions of atlassian-connect-spring-boot-core Show documentation
Provides the core of Atlassian Connect for Spring Boot
package com.atlassian.connect.spring.internal;
import jakarta.annotation.Nonnull;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
@Component
public class AsynchronousApplicationEventPublisher implements ApplicationEventPublisherAware {
private ApplicationEventPublisher eventPublisher;
@Override
public void setApplicationEventPublisher(@Nonnull ApplicationEventPublisher eventPublisher) {
this.eventPublisher = eventPublisher;
}
@Async
public void publishEventAsynchronously(ApplicationEvent event) {
eventPublisher.publishEvent(event);
}
}