com.netease.cloud
Modifier and Type | Field and Description |
---|---|
protected NeteaseHttpClient |
client
Low level client for sending requests to services.
|
protected ClientConfiguration |
clientConfiguration
The client configuration
|
protected URI |
endpoint
The service endpoint to which this client will send requests.
|
protected List<RequestHandler> |
requestHandlers
Optional request handlers for additional request processing.
|
Constructor and Description |
---|
WebServiceClient(ClientConfiguration clientConfiguration)
Constructs a new WebServiceClient object using the specified
configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addRequestHandler(RequestHandler requestHandler)
Appends a request handler to the list of registered handlers that are run
as part of a request's lifecycle.
|
protected ExecutionContext |
createExecutionContext() |
void |
removeRequestHandler(RequestHandler requestHandler)
Removes a request handler from the list of registered handlers that are
run as part of a request's lifecycle.
|
void |
setConfiguration(ClientConfiguration clientConfiguration) |
void |
setEndpoint(String endpoint)
Overrides the default endpoint for this client.
|
void |
shutdown()
Shuts down this client object, releasing any resources that might be held
open.
|
protected URI endpoint
protected ClientConfiguration clientConfiguration
protected NeteaseHttpClient client
protected final List<RequestHandler> requestHandlers
public WebServiceClient(ClientConfiguration clientConfiguration)
clientConfiguration
- The client configuration for this client.public void setEndpoint(String endpoint) throws IllegalArgumentException
This method is not threadsafe. Endpoints should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit.
endpoint
- The endpoint or a full URL, including the protocolIllegalArgumentException
- If any problems are detected with the specified endpoint.public void setConfiguration(ClientConfiguration clientConfiguration)
public void shutdown()
public void addRequestHandler(RequestHandler requestHandler)
requestHandler
- The new handler to add to the current list of request
handlers.public void removeRequestHandler(RequestHandler requestHandler)
requestHandler
- The handler to remove from the current list of request
handlers.protected ExecutionContext createExecutionContext()
Copyright © 2017. All Rights Reserved.