⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 validatemessagesource.java

📁 提供ESB 应用mule源代码 提供ESB 应用mule源代码
💻 JAVA
字号:
/* * $Id: ValidateMessageSource.java 10489 2008-01-23 17:53:38Z dfeist $ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */package org.mule.transport.bpm.jbpm.actions;import org.mule.transport.bpm.ProcessConnector;import org.jbpm.JbpmException;import org.jbpm.graph.exe.ExecutionContext;/** * Throws an exception if the message's source is not as expected. *  *  <action class="org.mule.transport.bpm.jbpm.actions.ValidateSource"> *     <expectedSource>ERPGateway</expectedSource>  *  </action>  *  <action class="org.mule.transport.bpm.jbpm.actions.ValidateSource"> *     <expectedSource>http://localhost:8080/incoming</expectedSource> *  </action> *              * @param expectedSource can be the expected endpoint's "name" or "address" * @throws JbpmException  */public class ValidateMessageSource extends LoggingActionHandler{    private static final long serialVersionUID = 1L;    protected String expectedSource;    public void execute(ExecutionContext executionContext) throws Exception    {        super.execute(executionContext);        String messageSource = (String)executionContext            .getVariable(ProcessConnector.PROCESS_VARIABLE_INCOMING_SOURCE);        logger.debug("Validating message source = " + messageSource + ", expected = " + expectedSource);        if (!expectedSource.equalsIgnoreCase(messageSource))        {            throw new JbpmException("Incoming message source is " + messageSource + ", expected source is "                            + expectedSource);        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -