日期:2014-05-20 浏览次数:20795 次
<flow name="File1"> <file:inbound-endpoint connector-ref="input" path="C:\file"> <file:filename-wildcard-filter pattern="*.*" /> </file:inbound-endpoint> <log-component /> <component> <singleton-object class="com.tt.MessageEngineFileClient" /> </component> </flow>
private static MuleContext muleContext; private static ApplicationContext context; /** * 停止mule上下文服务 * * @throws MuleException */ private static void stopMuleContext() throws MuleException { if (muleContext != null) { muleContext.stop(); muleContext = null; } } /** * 启动mule上下文服务 * * @throws MuleException */ private static void startMuleContext() throws MuleException { SpringXmlConfigurationBuilder builder = new SpringXmlConfigurationBuilder( "mule-config.xml"); builder.setParentContext(context); muleContext = new DefaultMuleContextFactory() .createMuleContext(builder); muleContext.start(); } /** * 重新启动mule服务 * * @param sendDir */ public static void restartMuleService(String sendDir) { try { MuleLoader.stopMuleContext(); logger.info("ESB关闭成功"); } catch (MuleException e) { e.printStackTrace(); logger.error("ESB关闭失败"); } try { JdomForXml.modifyMuleConfigXml(sendDir); } catch (Exception e1) { e1.printStackTrace(); logger.error("'mule-config.xml'配置文件中File构件的path路径更改异常"); } try { MuleLoader.startMuleContext(); logger.info("ESB重启成功"); } catch (MuleException e) { e.printStackTrace(); logger.error("ESB重启失败"); } }
------解决方案--------------------
大伙啊,给点热情。我也遇到同样的问题了