Eike Stepper wrote:
"Niclas Hedhman" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED]
[...]

Containment model = (ContainmentModel) context.get(
   "urn:composition:containment.model" );

To get hold of the model.

And then there are many things that you could possibly do, such as bring
components into one of the containers, create configurations on-the-fly, load
a complete container from a URL and other things.

Take a look at the 'dynamics' tutorial for further details;

https://svn.apache.org/repos/asf/avalon/trunk/planet/tutorials/dynamics


hi niclas,

if i understand you (and stephen) right, the proper way is to somehow
specify the service which i need and leave it to merlin to choose and
commision an appropriate component. that leads me to some further questions:

1. what exactly is commisioning, what happens during that phase and what is
    the difference to incarnation?

Commissioning of a model involves the following:

   1. check that all of the model's dependencies are resolved
      (and resolve them if there is anything unresolved)

   2. if the mode is a containment model then commission all of
      the children (components and sub-containers)

Incarnation is an process invoked by a lifecycle handler. It involves the instantiation of a component class and lifecycle processing of the resulting instance.



2. how can i influence merlin when deciding which component to use for such a service request?

You can declare a <source> in XML.

http://avalon.apache.org/merlin/starting/tutorial/dependencies/manual.html

Programatically you can do the same thing by manipulating the component model. Assuming "model" is a component model you can invoke model.getDependencyModel() and then you can set an explicit dependency solution using DependencyModel.setProvider( anotherModel ).

Steve.


/eike





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--

|---------------------------------------|
| Magic by Merlin                       |
| Production by Avalon                  |
|                                       |
| http://avalon.apache.org              |
|---------------------------------------|

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to