org.apache.cxf.message.Message.containsKey()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(242)

本文整理了Java中org.apache.cxf.message.Message.containsKey()方法的一些代码示例,展示了Message.containsKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.containsKey()方法的具体详情如下:
包路径:org.apache.cxf.message.Message
类名称:Message
方法名:containsKey

Message.containsKey介绍

暂无

代码示例

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

  1. protected void updateWebServiceContext(Exchange exchange, MessageContext ctx) {
  2. // Guard against wrong type associated with header list.
  3. // Need to copy header only if the message is going out.
  4. if (ctx.containsKey(Header.HEADER_LIST)
  5. && ctx.get(Header.HEADER_LIST) instanceof List<?>) {
  6. List<?> list = (List<?>) ctx.get(Header.HEADER_LIST);
  7. if (list != null && !list.isEmpty()) {
  8. SoapMessage sm = (SoapMessage) createResponseMessage(exchange);
  9. if (sm != null) {
  10. Iterator<?> iter = list.iterator();
  11. while (iter.hasNext()) {
  12. sm.getHeaders().add((Header) iter.next());
  13. }
  14. }
  15. }
  16. }
  17. if (exchange.getOutMessage() != null) {
  18. Message out = exchange.getOutMessage();
  19. if (out.containsKey(Message.PROTOCOL_HEADERS)) {
  20. Map<String, List<String>> heads = CastUtils
  21. .cast((Map<?, ?>)exchange.getOutMessage().get(Message.PROTOCOL_HEADERS));
  22. if (heads.containsKey("Content-Type")) {
  23. List<String> ct = heads.get("Content-Type");
  24. exchange.getOutMessage().put(Message.CONTENT_TYPE, ct.get(0));
  25. heads.remove("Content-Type");
  26. }
  27. }
  28. }
  29. }

代码示例来源:origin: org.apache.cxf/cxf-core

  1. public boolean containsKey(Object key) {
  2. return message.containsKey(key);
  3. }

代码示例来源:origin: apache/cxf

  1. public boolean containsKey(Object key) {
  2. return message.containsKey(key);
  3. }

代码示例来源:origin: apache/cxf

  1. public static boolean isRequestor(Message message) {
  2. return Boolean.TRUE.equals(message.containsKey(Message.REQUESTOR_ROLE));
  3. }

代码示例来源:origin: org.apache.cxf/cxf-core

  1. protected boolean isRequestor(Message message) {
  2. return Boolean.TRUE.equals(message.containsKey(Message.REQUESTOR_ROLE));
  3. }

代码示例来源:origin: apache/cxf

  1. protected boolean isRequestor(Message message) {
  2. return Boolean.TRUE.equals(message.containsKey(Message.REQUESTOR_ROLE));
  3. }

代码示例来源:origin: org.apache.servicemix/servicemix-cxf-se

  1. protected boolean isRequestor(org.apache.cxf.message.Message message) {
  2. return Boolean.TRUE.equals(message.containsKey(
  3. org.apache.cxf.message.Message.REQUESTOR_ROLE));
  4. }

代码示例来源:origin: org.apache.cxf/cxf-rt-features-logging

  1. private static String safeGet(Message message, String key) {
  2. if (message == null || !message.containsKey(key)) {
  3. return null;
  4. }
  5. Object value = message.get(key);
  6. return (value instanceof String) ? value.toString() : null;
  7. }

代码示例来源:origin: apache/cxf

  1. private static String safeGet(Message message, String key) {
  2. if (!message.containsKey(key)) {
  3. return null;
  4. }
  5. Object value = message.get(key);
  6. return (value instanceof String) ? value.toString() : null;
  7. }

代码示例来源:origin: apache/cxf

  1. String safeGet(String key) {
  2. if (!message.containsKey(key)) {
  3. return null;
  4. }
  5. Object value = message.get(key);
  6. return (value instanceof String) ? value.toString() : null;
  7. }

代码示例来源:origin: apache/cxf

  1. private static String safeGet(Message message, String key) {
  2. if (message == null || !message.containsKey(key)) {
  3. return null;
  4. }
  5. Object value = message.get(key);
  6. return (value instanceof String) ? value.toString() : null;
  7. }

代码示例来源:origin: org.apache.cxf/cxf-integration-tracing-brave

  1. String safeGet(String key) {
  2. if (!message.containsKey(key)) {
  3. return null;
  4. }
  5. Object value = message.get(key);
  6. return (value instanceof String) ? value.toString() : null;
  7. }

代码示例来源:origin: org.apache.servicemix/servicemix-cxf-se

  1. public Message createMessage(Message m) {
  2. if (!m.containsKey(Message.CONTENT_TYPE)) {
  3. m.put(Message.CONTENT_TYPE, "text/xml");
  4. }
  5. return new JBIMessage(m);
  6. }

代码示例来源:origin: org.apache.servicemix.cxf/org.apache.servicemix.cxf.binding.nmr

  1. public Message createMessage(Message m) {
  2. if (!m.containsKey(Message.CONTENT_TYPE)) {
  3. m.put(Message.CONTENT_TYPE, "text/xml");
  4. }
  5. return new NMRMessage(m);
  6. }

代码示例来源:origin: apache/cxf

  1. public static PropertyHolder getPropertyHolder(Message m) {
  2. return m.containsKey("HTTP.REQUEST") ? new ServletRequestPropertyHolder(m) : new MessagePropertyHolder(m);
  3. }

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http-jetty

  1. protected void setupContinuation(Message inMessage,
  2. final HttpServletRequest req,
  3. final HttpServletResponse resp) {
  4. if (engine != null && engine.getContinuationsEnabled()) {
  5. super.setupContinuation(inMessage, req, resp);
  6. if (!inMessage.containsKey(ContinuationProvider.class.getName())) {
  7. inMessage.put(ContinuationProvider.class.getName(),
  8. new JettyContinuationProvider(req, resp, inMessage));
  9. }
  10. }
  11. }

代码示例来源:origin: apache/cxf

  1. protected void setupContinuation(Message inMessage,
  2. final HttpServletRequest req,
  3. final HttpServletResponse resp) {
  4. if (engine != null && engine.getContinuationsEnabled()) {
  5. super.setupContinuation(inMessage, req, resp);
  6. if (!inMessage.containsKey(ContinuationProvider.class.getName())) {
  7. inMessage.put(ContinuationProvider.class.getName(),
  8. new JettyContinuationProvider(req, resp, inMessage));
  9. }
  10. }
  11. }

代码示例来源:origin: apache/cxf

  1. public org.apache.cxf.message.Message createMessage(org.apache.cxf.message.Message m) {
  2. if (!m.containsKey(org.apache.cxf.message.Message.CONTENT_TYPE)) {
  3. String ct = null;
  4. // Should this be done in ServiceInvokerInterceptor to support a case where the
  5. // response content type is detected early on the inbound chain for all the bindings ?
  6. Exchange exchange = m.getExchange();
  7. if (exchange != null) {
  8. ct = (String)exchange.get(org.apache.cxf.message.Message.CONTENT_TYPE);
  9. }
  10. m.put(org.apache.cxf.message.Message.CONTENT_TYPE, ct);
  11. }
  12. return m;
  13. }
  14. }

代码示例来源:origin: apache/cxf

  1. @Override
  2. public ThrottleResponse getThrottleResponse(String phase, Message m) {
  3. if (m.containsKey(THROTTLED_KEY)) {
  4. return null;
  5. }
  6. m.getExchange().put(ThrottlingCounter.class, counter);
  7. if (counter.incrementAndGet() >= threshold) {
  8. m.put(THROTTLED_KEY, true);
  9. return this;
  10. }
  11. return null;
  12. }

代码示例来源:origin: org.apache.cxf/cxf-rt-features-throttling

  1. @Override
  2. public ThrottleResponse getThrottleResponse(String phase, Message m) {
  3. if (m.containsKey(THROTTLED_KEY)) {
  4. return null;
  5. }
  6. m.getExchange().put(ThrottlingCounter.class, counter);
  7. if (counter.incrementAndGet() >= threshold) {
  8. m.put(THROTTLED_KEY, true);
  9. return this;
  10. }
  11. return null;
  12. }

相关文章