private static Object createHttpHeaders(Message m, Class<?> ctxClass) {
if (MessageUtils.isRequestor(m)) {
m = m.getExchange() != null ? m.getExchange().getOutMessage() : m;
}
return HttpHeaders.class.isAssignableFrom(ctxClass) ? new HttpHeadersImpl(m)
: new ProtocolHeadersImpl(m);
}