WebServer implementation may call
createTransportArtifact(Class, String, ServerConfiguration)
during startup, and then never again, passing non-
arguments. Only one call per combination of
artifactName is permitted.
It is not expected or required that implementations of this interface be safe for concurrent use by multiple threads.
Transportimplementation is available for use by the given
Implementations of this method must be idempotent and deterministic.
WebServerimplementations normally call this method, supplying themselves, and interpret its return value before performing any invocation of
createTransportArtifact(Class, String, ServerConfiguration).
If a given
falsefrom its implementation of this method, then a given
WebServerimplementation is permitted to discard it and use another
WebServerpassed to this method is in a deliberately undefined state. Most notably, it has not yet been configured, and it is in the process of being constructed. Most
Transportimplementations should either not use this parameter at all or, for example, should only test it to see if it is an implementation of
WebServerthat they support.
createTransportArtifactCreates and returns a suitable transport artifact, if one can be created or is available, and an empty
A transport artifact is a deliberately opaque item that is defined by a particular
WebServerimplementation that is needed at startup time. A transport artifact has a
String-typed name and a
Class-typed type. A
WebServerimplementation may call this method only after having received
truefrom an invocation of
WebServerimplementation must not call this method more than once per combination of
nameor undefined behavior will result.
No further specifications of any kind are made regarding the behavior of any implementation of this method. Specifically, an implementation may create a new artifact, or return a cached one.
Implementations of this method are called while a
WebServerimplementation is in the process of being constructed and while it is in a deliberately undefined state.
- Type Parameters:
T- the type of the transport artifact
Classthat can help to identify the kind of artifact to be returned
WebServer-implementation-specific name of a specific transport artifact of the given type that should be returned
config- the finalized
ServerConfigurationin effect during construction of the
Optional, possibly empty, representing the desired transport artifact