Schnittstelle StreamClient<C extends StreamClientConfiguration>
- Typparameter:
C- The type of the service's configuration.
- Alle bekannten Implementierungsklassen:
AbstractStreamClient,JettyStreamClientImpl
An implementation has to be thread-safe.
Its constructor may throw InitializationException.
- Autor:
- Christian Bauer
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungsendRequest(StreamRequestMessage message) Sends the given request via TCP (HTTP) and returns the response.voidstop()Stops the service, closes any connection pools etc.
-
Methodendetails
-
sendRequest
Sends the given request via TCP (HTTP) and returns the response.This method must implement expiration of timed out requests using the
StreamClientConfigurationsettings. When a request expires, anullresponse will be returned.This method will always try to complete execution without throwing an exception. It will return
nullif an error occurs, and optionally log any exception messages.The rules for logging are:
- If the caller interrupts the calling thread, log at
TRACE. - If the request expires because the timeout has been reached, log at
INFOlevel. - If another error occurs, log at
WARNINGlevel
This method is required to add a
HostHTTP header to the outgoing HTTP request, even if the givenStreamRequestMessagedoes not contain such a header.This method will add the
User-AgentHTTP header to the outgoing HTTP request if the given message did not already contain such a header. You can set this default value in yourStreamClientConfiguration.- Parameter:
message- The message to send.- Gibt zurück:
- The response or
nullif no response has been received or an error occurred. - Löst aus:
InterruptedException- if you interrupt the calling thread.
- If the caller interrupts the calling thread, log at
-
stop
void stop()Stops the service, closes any connection pools etc. -
getConfiguration
C getConfiguration()- Gibt zurück:
- This service's configuration.
-