uCosminexus Application Server, Web Service Development Guide
Description
This method acquires a changeable property map.
Syntax
public Map<String,Object> getProperties()
Parameter
None.
Return value
The method returns a property map.
Notes
An example of using the getProperties() method is as follows:
// Generate the Client object
Client client = Client.create();
// Set the property read timeout value
client.getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, 10000);
// Generate an HTTP request
ClientRequest cRequest = ClientRequest.create().build(new URI("http://test.com/"), "GET");
try{
// Receive an HTTP response as the ClientResponse object
ClientResponse cResponse = client.handle(cRequest);
} catch(ClientHandlerException e){
// Execute the appropriate processing
}
|
In this example, initially the changeable property map is acquired with the getProperties method and the property read timeout is set to 10,000 milliseconds. Then, the ClientRequest object is created and the HTTP communication is performed by using the handle method of the Client class. The HTTP response is received as the ClientResponse object. If the read timeout occurs before the HTTP response is completely read, an error (KDJJ18888-E) occurs and the ClientHandlerException exception that wraps the SocketTimeoutException exception is thrown.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.