com.spring.boxes.gateway.refresh.GatewayRoutesRefresher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boxes-gateway-starter Show documentation
Show all versions of spring-boxes-gateway-starter Show documentation
spring-cookie-boxes-boot-starter
The newest version!
package com.spring.boxes.gateway.refresh;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.event.RefreshRoutesEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
@Slf4j
@NoArgsConstructor
public class GatewayRoutesRefresher implements ApplicationEventPublisherAware {
private ApplicationEventPublisher applicationEventPublisher;
public GatewayRoutesRefresher(ApplicationEventPublisher applicationEventPublisher) {
this.applicationEventPublisher = applicationEventPublisher;
this.setApplicationEventPublisher(applicationEventPublisher);
}
@Override
public void setApplicationEventPublisher(@NonNull ApplicationEventPublisher applicationEventPublisher) {
this.applicationEventPublisher = applicationEventPublisher;
}
public void refreshRoutes() {
applicationEventPublisher.publishEvent(new RefreshRoutesEvent(this));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy