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