本文整理汇总了Java中org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent类的典型用法代码示例。如果您正苦于以下问题:Java RefreshScopeRefreshedEvent类的具体用法?Java RefreshScopeRefreshedEvent怎么用?Java RefreshScopeRefreshedEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RefreshScopeRefreshedEvent类属于org.springframework.cloud.context.scope.refresh包,在下文中一共展示了RefreshScopeRefreshedEvent类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onApplicationEvent
import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent; //导入依赖的package包/类
@Override
public void onApplicationEvent(ApplicationEvent event) {
if (event instanceof ContextRefreshedEvent
|| event instanceof RefreshScopeRefreshedEvent
|| event instanceof RoutesRefreshedEvent) {
this.zuulHandlerMapping.setDirty(true);
}
else if (event instanceof HeartbeatEvent) {
if (this.heartbeatMonitor.update(((HeartbeatEvent) event).getValue())) {
this.zuulHandlerMapping.setDirty(true);
}
}
}
示例2: onApplicationEvent
import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent; //导入依赖的package包/类
@EventListener(RefreshScopeRefreshedEvent.class)
public void onApplicationEvent(RefreshScopeRefreshedEvent event) {
//This will force the creation of the EurkaClient bean if not already created
//to make sure the client will be reregistered after a refresh event
if(eurekaClient != null) {
eurekaClient.getApplications();
}
if (autoRegistration != null) {
// register in case meta data changed
this.autoRegistration.stop();
this.autoRegistration.start();
}
}
示例3: verifyGetApplications
import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent; //导入依赖的package包/类
@Test
// This test is used to verify that getApplications is called the correct number of times
// when a refresh event is fired. The getApplications call in EurekaClientConfigurationRefresher.onApplicationEvent
// ensures that the EurekaClient bean is recreated after a refresh event and that we reregister the client with
//the server
public void verifyGetApplications() {
if(publisher != null) {
publisher.publishEvent(new RefreshScopeRefreshedEvent());
}
verify(client, times(3)).getApplications();
}
示例4: onApplicationEvent
import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent; //导入依赖的package包/类
@Override
public void onApplicationEvent(RefreshScopeRefreshedEvent event) {
System.out.println("reload!!!!!");
}
示例5: refreshed
import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent; //导入依赖的package包/类
@EventListener(RefreshScopeRefreshedEvent.class)
public void refreshed(RefreshScopeRefreshedEvent event) {
this.events.add(event);
}