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 Request
s.
DEBUG, SYSTEM_PROPERTY_NAME_DEBUG
Modifier and Type | Method and 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 to
CurrentContainer.newReference(URI) . |
void |
start()
This is a synchronous method to configure this ServerProvider and bind the listen port (or equivalent).
|
refer, release
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.
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 Request
s are processed as before.
The Container
does not call this method, instead it is a required step in the Application
shutdown code.
Copyright © 2018. All rights reserved.