> -----Original Message----- > From: Harvinder Singh [mailto:[EMAIL PROTECTED] > Sent: 27 August 2004 01:36 > To: Avalon framework users > Subject: Passing parameters dynamically to the Merlin component > > All, > > How can I pass dynamically the parameters to a Merlin component. > Suppose my stand alone client instantiates the Merlin component > and now calls a method which takes in parameters. > As of now, I saw the Parameterization tutorial and there the parameters > are specified and even their values are hard coded in the block.xml file. > How can I get the values of the parameters dynamically and not specify > them > in the block.xml?
A block is an XML representation of a component deployment profile. For example, the <component> tag is managed internally within merlin as an immutable instance of the ComponentProfile class. http://avalon.apache.org/avalon/runtime/3.3.0/spi/org/apache/avalon/comp osition/data/ComponentProfile.html A component profile is used to construct a model of a deployment scenario. ComponentModels can be modified - for example, you programmatically set parameters, modify configuration data, control dependency assignments, set content values, etc. All of this is exposed under the ComponentModel http://avalon.apache.org/avalon/runtime/3.3.0/spi/org/apache/avalon/comp osition/model/ComponentModel.html Component models are held within a ContainmentModel (you add and remove component and containment models dynamically). Actual parameterization of a component instance is handled automatically by the model when you invoke the resolve operation. In effect the model takes the assigned parameters, and applies these (and any other lifecycle prerequisites) before returning a new component instance. An example of modification of the component model is included in the dynamics tutorial. http://svn.apache.org/repos/asf/avalon/trunk/planet/tutorials/dynamics/s rc/main/tutorial/HelloFacility.java Cheers, Steve. > > Regards, > Harvinder > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]