Niclas Hedhman wrote:
On Sunday 30 May 2004 04:19, Eike Stepper wrote:

Do you mean getting it to run once it has been loaded?

hmm, i've come to another question: the block seems to start running automatically. that could be ok, but how can i access it from the plugin?

i'd like to call the start() method on a component for example...


By not populating the model (in composition) from the beginning.

I.e. Load the 'bootstrap' set of components initially, then grab the ContainmentModel from the Kernel and manipulate whenever later...

    ContainmentModel model = kernel.getModel();
    model.addModel( compModel );

However, I am NOT sure how to effectively build the compModel ( a DeploymentModel instance, which is either a component or a container ) in an effective/quick way, and hope that Stephen can help you with that.

Steve!!!!

Yo!

After adding the model via something like the model.addContainmentModel( url ) operation or as your describing above - what you have is a new sub-model within the container - however, the sub-model isn't wired-up yet. Once you have added all of the models you want you need to commission the model. Commissioning the model results in the automatic assembly (wiring) of consumer components with provider components and so on. Once commissioned you can safely proceed with component instantiation.

For example for a container:

    ContainmentModel model = kernel.getModel();
    ContainmentModel test = model.addContainmentModel( myBlockUrl );
    test.commission();

Commissioning of a container results in the automatic deployment of any components that have startup policy set to true, or any components implied by the consequence of assembly.

With a commissioned container you can go ahead and access actual component models from the container, create new component instances, etc. The dynamics tutorial contains details on how to do this, including dynamic re-configuration of component models and so on.

Cheer, Stephen.


Cheers
Niclas




--

|---------------------------------------|
| 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