org.apache.camel.Handler.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(161)

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

Handler.<init>介绍

暂无

代码示例

代码示例来源:origin: forcelate/forcelate-temple-java

@Handler
  public String appendYoda(String msg) {
    return msg + " © Yoda";
  }
}

代码示例来源:origin: forcelate/forcelate-temple-java

@Handler
  public String appendYoda(String msg) {
    return msg + " © Yoda";
  }
}

代码示例来源:origin: org.gytheio/gytheio-messaging-camel

@Override
@Handler
public void onReceive(Object message)
{
  if (!(message instanceof Heartbeat))
  {
    logger.warn("Heartbeat message expected but received: " + message.toString());
    return;
  }
  heartbeatDao.record((Heartbeat) message);
}

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

@Handler
  public Map getProcessVariables(@Body String body,
                  @Header(Exchange.FILE_NAME) String filename,
                  @Simple("${date:now:yyyy-MM-dd kk:mm:ss}") String timestamp) {
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("message", body);
    variables.put("orderid", filename);
    variables.put("timestamp", timestamp);
    return variables;
  }
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

@Handler
  public void removeCallParams(@Header(CALL_ID_HEADER) String callId) {
    Assert.hasText(callId, "the callId must not be empty");

    callRegistry.removeParams(callId);
  }
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

@Handler
public boolean checkParentMessage(@Header(MSG_HEADER) Message msg) {
  Assert.notNull(msg, "the msg must not be null");
  return msg.isParentMessage();
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

@Handler
public void setMsgPriority(@Body Message msg) {
  // new messages will be processed earlier then PARTLY_FAILED or POSTPONED messages
  msg.setProcessingPriority(NEW_MSG_PRIORITY);
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

/**
   * Splits specified message into smaller messages.
   *
   * @param parentMsg the parent message
   * @param body the body
   */
  @Handler
  void splitMessage(@Header(AsynchConstants.MSG_HEADER) Message parentMsg, @Body Object body);
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

/**
 * Set log context parameters.
 *
 * @param message the message
 * @param requestId the request ID
 * @see LogContextHelper#setLogContextParams(Message, String)
 */
@Handler
public void setLogContextParams(@Body Message message,
    @Header(LogContextFilter.CTX_REQUEST_ID) @Nullable String requestId) {
  LogContextHelper.setLogContextParams(message, requestId);
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

@Handler
public void postponeMessage(Exchange exchange, @Body Message msg) {
  // set Message to header because of event notification
  exchange.getIn().setHeader(AsynchConstants.MSG_HEADER, msg);
  // change state
  getBean(MessageService.class).setStatePostponed(msg);
  // generates event
  AsynchEventHelper.notifyMsgPostponed(exchange);
}

代码示例来源:origin: io.syndesis.integration/integration-runtime

@Handler
  public String apply(@Body String body) {
    return "Hello " + body;
  }
}

代码示例来源:origin: io.syndesis.integration/integration-runtime

@Handler
  public void handle(@Body String body) {
    // NO-OP
  }
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

/**
 * Gets URI of the next route.
 * The URI is in the following format: "direct:SERVICE_operationName{@link AbstractBasicRoute#OUT_ROUTE_SUFFIX}"
 *
 * @param msg the message
 * @return URI of next route
 */
@Handler
public String nextRoute(@Header(MSG_HEADER) Message msg) {
  Assert.notNull(msg, "the msg must not be null");
  return "direct:" + msg.getService().getServiceName() + "_" + msg.getOperationName() + OUT_ROUTE_SUFFIX;
}

代码示例来源:origin: io.syndesis.integration/integration-runtime

@Handler
  public String[] apply(@Body String body) {
    return new String[]{ "Hiram", "World" };
  }
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

@Handler
  public SyncHelloResponse composeGreeting(@Body SyncHelloRequest req) {
    Assert.notNull(req, "req must not be null");

    String greeting = "Hello " + req.getName();

    SyncHelloResponse res = new SyncHelloResponse();
    res.setGreeting(greeting);
    return res;
  }
}

代码示例来源:origin: io.syndesis.integration/integration-runtime

@Handler
  public int apply(@Body String body) {
    return body.hashCode();
  }
}

代码示例来源:origin: org.ow2.orchestra/orchestra-cxf-war

@Handler
 public java.lang.String approve(final Object[] params) {
  return this.approve((String) params[0], (String) params[1], (BigInteger) params[2]);
 }
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

/**
   * Checks if actual node handles existing message.
   *
   * @throws StoppingException if node not handles existing message
   */
  @Handler
  public void isAbleToHandleExistingMessage() throws StoppingException {
    NodeService nodeService = getApplicationContext().getBean(NodeService.class);

    if (!nodeService.getActualNode().isAbleToHandleExistingMessages()) {
      throw new StoppingException("ESB has been stopped...");
    }
  }
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

/**
 * Gets URI for calling external system.
 *
 * @param callId Call ID for getting call parameters from {@link DirectCallRegistry}
 * @return WS URI
 */
@Handler
public String getWsUri(@Header(CALL_ID_HEADER) String callId) {
  Assert.hasText(callId, "the callId must not be empty");
  DirectCallParams params = callRegistry.getParams(callId);
  return getOutWsUri(params.getUri(), params.getSenderRef(), params.getSoapAction());
}

代码示例来源:origin: io.syndesis.integration-runtime/runtime

@Handler
  public String configure(@Body String body, @Header("ExtensionHeader") String header) {
    return String.join("-", body, header, message);
  }
}

相关文章

微信公众号

最新文章

更多

Handler类方法