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 aContainerBuilder
, and that builder must beactivated
.If a ServerProvider is to expire due to
Application
reconfiguration, it is necessary to close() that ServerProvider before deactivating the owningContainer
. 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 newRequest
s.- Author:
- Simon Thoresen Hult
-
-
Field Summary
-
Fields inherited from interface com.yahoo.jdisc.SharedResource
DEBUG, SYSTEM_PROPERTY_NAME_DEBUG
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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 toCurrentContainer.newReference(URI)
.void
start()
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, release
-
-
-
-
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 theApplication
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 dispatchedRequest
s are processed as before.The
Container
does not call this method, instead it is a required step in theApplication
shutdown code.
-
-