Class RestartEndpoint
java.lang.Object
org.springframework.cloud.context.restart.RestartEndpoint
- All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationListener<ContextRefreshedWithApplicationEvent>
@Endpoint(id="restart",
defaultAccess=NONE)
public class RestartEndpoint
extends Object
implements org.springframework.context.ApplicationListener<ContextRefreshedWithApplicationEvent>
An endpoint that restarts the application context. Install as a bean and also register
a
RestartListener with the SpringApplication that starts the context.
Those two components communicate via an ApplicationEvent and set up the state
needed to doRestart the context.- Author:
- Dave Syer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassPause endpoint configuration.classResume endpoint configuration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoPause()org.springframework.context.ConfigurableApplicationContextvoiddoResume()longbooleanvoidrestart()voidsetIntegrationMBeanExporter(Object exporter) voidsetTimeout(long timeout) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
RestartEndpoint
public RestartEndpoint()
-
-
Method Details
-
getTimeout
public long getTimeout() -
setTimeout
public void setTimeout(long timeout) -
setIntegrationMBeanExporter
-
onApplicationEvent
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<ContextRefreshedWithApplicationEvent>
-
restart
-
getPauseEndpoint
-
getResumeEndpoint
-
doRestart
public org.springframework.context.ConfigurableApplicationContext doRestart() -
isRunning
public boolean isRunning() -
doPause
public void doPause() -
doResume
public void doResume()
-