当前位置: 首页>>代码示例>>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;未经允许,请勿转载。