public void send(Message message) throws IOException {
Response response = (Response)request.get(Response.class);
// handle response headers
updateResponseHeaders(message);
Map< String, List< String > > protocolHeaders =
(Map< String, List< String > >) message.get(Message.PROTOCOL_HEADERS);
// set headers of the HTTP response object
Iterator headers = protocolHeaders.entrySet().iterator();
while (headers.hasNext()) {
Map.Entry entry = (Map.Entry) headers.next();
String headerName = (String) entry.getKey();
String headerValue = getHeaderValue((List) entry.getValue());
response.setHeader(headerName, headerValue);
}
message.setContent(OutputStream.class, new WrappedOutputStream(message, response));
}
Send an outbound message, assumed to contain all the name-value
mappings of the corresponding input message (if any). |