當前位置: 首頁>>代碼示例>>Java>>正文


Java RefreshScopeRefreshedEvent類代碼示例

本文整理匯總了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);
		}
	}
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-netflix,代碼行數:14,代碼來源:ZuulServerAutoConfiguration.java

示例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();
	}
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-netflix,代碼行數:14,代碼來源:EurekaDiscoveryClientConfiguration.java

示例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();
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-netflix,代碼行數:12,代碼來源:ConfigRefreshTests.java

示例4: onApplicationEvent

import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent; //導入依賴的package包/類
@Override
public void onApplicationEvent(RefreshScopeRefreshedEvent event) {
    System.out.println("reload!!!!!");
}
 
開發者ID:IBYoung,項目名稱:vert.3x-gateway,代碼行數:5,代碼來源:ZkRefreshListener.java

示例5: refreshed

import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent; //導入依賴的package包/類
@EventListener(RefreshScopeRefreshedEvent.class)
public void refreshed(RefreshScopeRefreshedEvent event) {
	this.events.add(event);
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-commons,代碼行數:5,代碼來源:RefreshEndpointTests.java


注:本文中的org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。