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
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.yahoo.jdisc.SharedResource

    SharedResource.Debug
  • Field Summary

    Fields inherited from interface com.yahoo.jdisc.SharedResource

    DEBUG, SYSTEM_PROPERTY_NAME_DEBUG
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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).
    default boolean
    Whether multiple instances of this can coexist, by means of a multiplexer on top of any exclusive resource.
    void
    This is a synchronous method to configure this ServerProvider and bind the listen port (or equivalent).

    Methods inherited from interface com.yahoo.jdisc.SharedResource

    refer, refer, release
  • Method Details

    • 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.

    • isMultiplexed

      default boolean isMultiplexed()
      Whether multiple instances of this can coexist, by means of a multiplexer on top of any exclusive resource. If this is true, new instances to replace old ones, during a graph generation switch, will be started before the obsolete ones are stopped; otherwise, the old will be stopped, and then the new ones started.