本文整理匯總了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);
}