Class RestartEndpoint

  • All Implemented Interfaces:
    EventListener, org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationPreparedEvent>

    @Endpoint(id="restart",
              enableByDefault=false)
    public class RestartEndpoint
    extends Object
    implements org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationPreparedEvent>
    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
    • Constructor Detail

      • RestartEndpoint

        public RestartEndpoint()
    • Method Detail

      • getTimeout

        public long getTimeout()
      • setTimeout

        public void setTimeout​(long timeout)
      • setIntegrationMBeanExporter

        public void setIntegrationMBeanExporter​(Object exporter)
      • onApplicationEvent

        public void onApplicationEvent​(org.springframework.boot.context.event.ApplicationPreparedEvent input)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationPreparedEvent>
      • restart

        @WriteOperation
        public Object restart()
      • doRestart

        public org.springframework.context.ConfigurableApplicationContext doRestart()
      • isRunning

        public boolean isRunning()
      • doPause

        public void doPause()
      • doResume

        public void doResume()