A few comments: 1) Files should include the Apache standard header 2) resources are loaded with xbean in BAMEndpoint.process they override any definition specified directly with the rules, actions properties IMHO, they should be loaded when activate is called (or at initialization time, by implementing the spring interface InitializingBean) and only if the properties are not set 3) I don't see any use of the BAMGlobalConfig / Params classes 4) Rules are not extensible. People will need to use to be able to check for properties, attachments, not only xpath on the content. So it should be an interface with Object evaluate(MessageExchange exchange) or Object evaluate(NormalizedMessage message) or anything like that. 5) When using xpath, you need a way to configure the namesapces in use in the xpath expression, else you can not use it on xml requests with namespaces. Take a look at the XPathPredicate in servicemix-eip 6) The configuration could leverage much more of spring/xbean features and use a clean POJO model which will be easily translated into a clean xml schema using xbean. They don't need to use id references and class names, as spring will do that easily. And instead of using BAMActionParameters, these parameters could be easily configured on the action / adaptor itself.
So instead of having <bam:bAMRule description="Email rule1" resultType="Boolean" ruleName="emailRule1" xpath="/[EMAIL PROTECTED]'555-3482']"> <bam:actionDetails> <bam:bAMActionDetail executeOn="true" actionID="printer" active="true"/> </bam:actionDetails> </bam:bAMRule> <bam:bAMAction actionName="printer" adaptorClass=" org.apache.servicemix.bam.sample.PrintAdaptor" description="For emailing"> <bam:params> <bam:bAMActionParameter name="mobileNumber" value="405-3785" type="String"/> <bam:bAMActionParameter name="address" value="680, morse ave CA" type="String"/> </bam:params> </bam:bAMAction> You could simply have <bam:endpoint ...> <bam:rule> <bam:evaluator> <bam:xpath xpath="/test:sample/@id" nsContext="#nsContext" /> </bam:evaluator> <bam:actions> <bam:action executeOn="554-345" adaptor="#printAdaptor" /> </bam:actions> </bam:endpoint> <bam:print id="printAdaptor" output="stderr" mobileNumber="405-3785" address="680, morse ave CA" /> <bam:namespaceContext id="nsContext"> <bam:namespace prefix="test">http://test</bam:namespace> </bam:namespaceContext> This is only an example to show how to use references, without having to define IDs and classNames. This lead to a much cleaner POJO model. On 8/10/06, Soumadeep Sen (JIRA) <[EMAIL PROTECTED]> wrote:
Business Activity Monitoring Component -------------------------------------- Key: SM-534 URL: https://issues.apache.org/activemq/browse/SM-534 Project: ServiceMix Issue Type: New Feature Components: servicemix-common Reporter: Soumadeep Sen Attachments: servicemix-bam.zip This Business Activity Monitoring component which works off an xpath expression. The xpath expression acts as a Key performance indicator. Based on the xpath evaluation, actions can be triggered. These actions can be implemented by users by extending the BAMAdaptor interface's execute method which takes an array of BAMActionParameter. For providing details in terms of Rules,Actions and global parameters, the actions.xml, rules.xml and globalConfig.xml need to be populated. Sample files can be found in the src/test/resources directory and usage details for the BAMComponent can be found in the spring.xml file which is in the same directory. The relationship between actions and rules is established by id reference where in the rules have actions IDs (no or more). Please refer the respective xml files. All implemented adaptor classes could be put in the option lib directory of smx so that they can be referenced by the BAM processor. (A sample Adaptor called PrintAdaptor has been provided in the src...samples dir for reference) Will be putting a wiki page shortly which will have more details. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
-- Cheers, Guillaume Nodet