uCosminexus Application Server, Web Service Development Guide
Description
This method acquires a changeable property map.
Syntax
public abstract 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();
// Generate an HTTP request
ClientRequest cRequest = ClientRequest.create().build(new URI("http://test.com/"), "GET");
// Set the property read time out value
cRequest.getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, 10000);
try{
// Receive an HTTP response as the ClientResponse object
ClientResponse cResponse = client.handle(cRequest);
} catch(ClientHandlerException e){
// Execute the appropriate processing
}
|
In this example, after the ClientRequest object is generated, the changeable property map is acquired with the getProperties method of the ClientRequest object and the property read timeout is set to 10,000 milliseconds. Then, the handle method of the Client class is invoked by specifying the ClientRequest object. The properties of the ClientRequest object are copied to the Client object. When an HTTP response is received as a 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.