richard head
Mon, 16 Jul 2007 14:58:04 -0700
Hi,Ive been playing around with the Commons Chain of Responsibility implementation and have a question or two. Maybe a chain is not the right approach, Id appreciate any suggestions.
Id like to make a Chain that retrieves an XML document, transforms it, and emails the results. 3 Commands as I see it. Each of these Commands requires information that is independent of the others. XML files URL, XSLT transformations output path, SMTP server etc
I understand that the preferred method of retaining state is to use the Chains Context. Yet in this situation is seems inflexible, as the class instantiating the chain will be tightly bound to it because it would have to anticipate each link and what each links Context requirements are.
What I would like to do is use a catalog.xml file to store the chain, and add the appropriate attributes to the given command element.
i.e. <command name="EmailUser" className="com.bs.email.Emailer" smtpServer=xyz.abc.com .../>
In order to achieve such functionality, what would I have to do, set the appropriate rules in the ConfigParsers Digester?
i.e. config.getDigester().addSetProperties(/catalog/chain/command,smtpServer,smtpServer)
I would prefer to do this via the Emailers constructor, but it appears that its not possible and one must use getters and setters.
Thank You. _________________________________________________________________ http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]