org.springframework.boot.context.embedded

Class EmbeddedServletContainerInitializedEvent

  • All Implemented Interfaces:
    Serializable


    public class EmbeddedServletContainerInitializedEvent
    extends org.springframework.context.ApplicationEvent
    Event to be published after the context is refreshed and the EmbeddedServletContainer is ready. Useful for obtaining the local port of a running server. Normally it will have been started, but listeners are free to inspect the server and stop and start it if they want to.
    Author:
    Dave Syer
    See Also:
    Serialized Form
    • Constructor Detail

      • EmbeddedServletContainerInitializedEvent

        public EmbeddedServletContainerInitializedEvent(org.springframework.context.ApplicationContext applicationContext,
                                                EmbeddedServletContainer source)
    • Method Detail

      • getApplicationContext

        public org.springframework.context.ApplicationContext getApplicationContext()
        Access the application context that the container was created in. Sometimes it is prudent to check that this matches expectations (like being equal to the current context) before acting on the server container itself.
        Returns:
        the applicationContext that the container was created from

Copyright © 2014 Pivotal Software, Inc.. All rights reserved.