commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "richard head" <dut...@hotmail.com>
Subject Chain of Responsibility Catalog, Adding Command Element Attributes
Date Mon, 16 Jul 2007 21:57:39 GMT
Hi,

I’ve been playing around with the Commons Chain of Responsibility 
implementation and have a question or two. Maybe a chain is not the right 
approach, I’d appreciate any suggestions.

	I’d 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 file’s URL, XSLT 
transformation’s output path, SMTP server etc…

I understand that the preferred method of retaining state is to use the 
Chain’s 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 link’s 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 ConfigParser’s Digester?

i.e. 
config.getDigester().addSetProperties(“/catalog/chain/command”,”smtpServer”,”smtpServer”)

I would prefer to do this via the Emailer’s constructor, but it appears that 
it’s 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: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message