2011-10-12 55 views
2

我可以给ejb-jar.xml中的activation-config-property-value的正则表达式模式吗?Reg ex for activation-config-property-value

而不是像这样的东西。

<activation-config-property> 
<activation-config-property-name>messageSelector</activation-config-property-name> 
<activation-config-property-value>header='90S' or header='90MS' or header='92S' or header='97S' or header='89S' or header='96CDS'</activation-config-property-value> 
</activation-config-property> 

我需要这样的东西,

<activation-config-property> 
<activation-config-property-name>messageSelector</activation-config-property-name> 
<activation-config-property-value>header='%S%'</activation-config-property-value> 
</activation-config-property> 

请建议。

谢谢,

回答

2

简短的回答是:没有。不要在JMS消息选择由JMS API

你可以得到一个正则表达式的最接近的描述是“LIKE”构造,就像在SQL:

header LIKE 9%S // matches 9.*S 
header LIKE 9_S // matches 9.S 

它可以让你简化你的选择,但它仍然远离正则表达式的灵活性。