Interface ServerProvider

  • All Superinterfaces:
    SharedResource
    All Known Implementing Classes:
    AbstractServerProvider, NonWorkingServerProvider

    public interface ServerProvider
    extends SharedResource

    This interface defines a component that is capable of acting as a server for an external client. To activate a ServerProvider it must be installed in a ContainerBuilder, and that builder must be activated.

    If a ServerProvider is to expire due to Application reconfiguration, it is necessary to close() that ServerProvider before deactivating the owning Container. Typically:

     myExpiredServers.close();
     reconfiguredContainerBuilder.servers().install(myRetainedServers);
     containerActivator.activateContainer(reconfiguredContainerBuilder);
     

    All implementations of this interface will need to have a CurrentContainer injected into its constructor so that it is able to create and dispatch new Requests.

    Author:
    Simon Thoresen Hult
    • Method Detail

      • start

        void start()

        This is a synchronous method to configure this ServerProvider and bind the listen port (or equivalent). The Container does not call this method, instead it is a required step in the Application initialization code.

      • close

        void close()

        This is a synchronous method to close the listen port (or equivalent) of this ServerProvider and flush any input buffers that will cause calls to CurrentContainer.newReference(URI). This method must not return until the implementation can guarantee that there will be no further calls to CurrentContainer. All previously dispatched Requests are processed as before.

        The Container does not call this method, instead it is a required step in the Application shutdown code.