2014-06-20 29 views
0

我可以檢查騾子流量是否可以停止。我如何檢查騾子流是否沒有執行。檢查騾子流量是否正在執行

Flow flow = muleEventContext.getMuleContext().getRegistry().lookupObject(flowName); 

//Before stopping the flow need to check if flow is not executing 

//Stop the flow 

flow.stop(); 

回答

0

您可以訪問每個流的統計:

FlowConstruct flow = muleContext.getRegistry().lookupFlowConstruct(flowName); 
FlowConstructStatistics fs = flow.getStatistics(); 

http://grepcode.com/file/repo1.maven.org/maven2/org.mule/mule-core/3.4.0/org/mule/management/stats/FlowConstructStatistics.java#FlowConstructStatistics

在這裏你可以得到處理的事件數量,得到平均隊列長度等。這些信息可以幫助你。

+0

Ryan我看着FlowConstructStatistics的javadoc我沒有看到一個方法來檢查流是否已經完成執行。可以告訴我如何檢查這個。 – user2714010