本文整理汇总了Java中org.springframework.cloud.context.restart.RestartEndpoint类的典型用法代码示例。如果您正苦于以下问题:Java RestartEndpoint类的具体用法?Java RestartEndpoint怎么用?Java RestartEndpoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RestartEndpoint类属于org.springframework.cloud.context.restart包,在下文中一共展示了RestartEndpoint类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configurationUpdateStrategy
import org.springframework.cloud.context.restart.RestartEndpoint; //导入依赖的package包/类
/**
* Provides the action to execute when the configuration changes.
*/
@Bean
@ConditionalOnMissingBean
public ConfigurationUpdateStrategy configurationUpdateStrategy(ConfigReloadProperties properties, ConfigurableApplicationContext ctx, RestartEndpoint restarter, ContextRefresher refresher) {
switch (properties.getStrategy()) {
case RESTART_CONTEXT:
return new ConfigurationUpdateStrategy(properties.getStrategy().name(), restarter::restart);
case REFRESH:
return new ConfigurationUpdateStrategy(properties.getStrategy().name(), refresher::refresh);
case SHUTDOWN:
return new ConfigurationUpdateStrategy(properties.getStrategy().name(), ctx::close);
}
throw new IllegalStateException("Unsupported configuration update strategy: " + properties.getStrategy());
}
示例2: restartEndpoint
import org.springframework.cloud.context.restart.RestartEndpoint; //导入依赖的package包/类
@Bean
@ConditionalOnEnabledEndpoint
@ConditionalOnMissingBean
public RestartEndpoint restartEndpoint() {
RestartEndpoint endpoint = new RestartEndpoint();
if (this.exporter != null) {
endpoint.setIntegrationMBeanExporter(this.exporter);
}
return endpoint;
}
示例3: pauseEndpoint
import org.springframework.cloud.context.restart.RestartEndpoint; //导入依赖的package包/类
@Bean
@ConditionalOnBean(RestartEndpoint.class)
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public RestartEndpoint.PauseEndpoint pauseEndpoint(RestartEndpoint restartEndpoint) {
return restartEndpoint.getPauseEndpoint();
}
示例4: resumeEndpoint
import org.springframework.cloud.context.restart.RestartEndpoint; //导入依赖的package包/类
@Bean
@ConditionalOnBean(RestartEndpoint.class)
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public RestartEndpoint.ResumeEndpoint resumeEndpoint(
RestartEndpoint restartEndpoint) {
return restartEndpoint.getResumeEndpoint();
}
示例5: pauseEndpointEnabled
import org.springframework.cloud.context.restart.RestartEndpoint; //导入依赖的package包/类
@Test
public void pauseEndpointEnabled() {
beanCreatedAndEndpointEnabled("pauseEndpoint", RestartEndpoint.PauseEndpoint.class,
RestartEndpoint.PauseEndpoint::pause,
"management.endpoint.restart.enabled=true",
"management.endpoint.pause.enabled=true");
}
示例6: resumeEndpointEnabled
import org.springframework.cloud.context.restart.RestartEndpoint; //导入依赖的package包/类
@Test
public void resumeEndpointEnabled() {
beanCreatedAndEndpointEnabled("resumeEndpoint", RestartEndpoint.ResumeEndpoint.class,
RestartEndpoint.ResumeEndpoint::resume,
"management.endpoint.restart.enabled=true",
"management.endpoint.resume.enabled=true");
}
示例7: restartEndpointWithoutIntegration
import org.springframework.cloud.context.restart.RestartEndpoint; //导入依赖的package包/类
@Bean
@ConditionalOnEnabledEndpoint
@ConditionalOnMissingBean
public RestartEndpoint restartEndpointWithoutIntegration() {
return new RestartEndpoint();
}
示例8: restartEndpointEnabled
import org.springframework.cloud.context.restart.RestartEndpoint; //导入依赖的package包/类
@Test
public void restartEndpointEnabled() {
beanCreatedAndEndpointEnabled("restartEndpoint", RestartEndpoint.class,
RestartEndpoint::restart,
"management.endpoint.restart.enabled=true");
}