All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atlassian.connect.spring.internal.AsynchronousApplicationEventPublisher Maven / Gradle / Ivy

There is a newer version: 5.1.4
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy