if (!isOneWay()) {
// REVISIT: use policy logic from HTTPClientTransport
// REVISIT: handle connection closure
URL url = new URL(decoupledResponseEndpoint.getAddress().getValue());
URLConnection connection = getConnection(url);
responseStream = connection.getOutputStream();
put(HTTPServerInputStreamContext.HTTP_RESPONSE, connection);
}
} else if (responseObj instanceof URLConnection) {
// resent decoupled response
URL url = ((URLConnection)responseObj).getURL();
URLConnection connection = getConnection(url);
responseStream = connection.getOutputStream();
put(HTTPServerInputStreamContext.HTTP_RESPONSE, connection);
} else {
LOG.log(Level.WARNING, "UNEXPECTED_RESPONSE_TYPE_MSG", responseObj.getClass());
throw new IOException("UNEXPECTED_RESPONSE_TYPE_MSG" + responseObj.getClass());
}