I think what's missing in the tutorial on this is the content dealing
with post kernel creation - i.e. stuff like adding a containter,
initiating container commissioning, etc.

Steve.


-----Original Message-----
From: Niclas Hedhman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 21, 2004 3:35 AM
To: Avalon framework users
Subject: Re: Embedding - howto

On Tuesday 20 July 2004 21:46, David Leangen wrote:
> First, I'd like to thank everyone who has been so helpful in the last
few
> days... especially Steve!

I hope you manage to interpret Steve's very formal explanations. They
can be 
trying at times for newbies to understand, and that's where I normally
come 
in. Explain it in simpler terms.


> 30        <initial.setHosts( new String[0] );
> What's this for? Why would we set this to an empty array? Simply for
> initialization? This seems rather strange to me.

Perhaps it is not clear, but the entire bootstrapping process is unaware
of 
Merlin itself. (We are considering moving the bootstrapper and
repository 
handling to other projects since many products could benefit from this 
without running Merlin)

So, the Repository system needs to know where it can download missing
Jars 
(and presumably other resources) from. As Steve mentioned, the example 
doesn't use this feature, as it currently creates some problems if you
are 
offline.

> 45        <String spec = "@MERLIN-IMPL-SPEC@";
> 46        <Artifact artifact = Artifact.createArtifact( spec );
> 47        <Builder builder = context.newBuilder( artifact );
>
>
> I'm not getting this spec thing... I want to create my own component
as an
> artifact. Isn't this where I would do it? How would I name it? I'm
fine
> with "name" and "version", but where does "group" come from?

@MERLIN-IMPL_SPEC@ is replaced during the build of the tutorials, and
should 
be something else, but I read like you have figured that out. This is
telling 
the bootstrapper what artifact (i.e. Jar file) should be loaded and
started. 
Steve already told you that this is the Merlin kernel/runtime system.

Up to this point, no Merlin code is really being executed.

> 59        >Factory factory = builder.getFactory();
> 60        >Map criteria = factory.createDefaultCriteria();
> 61        >factory.create( criteria );
> 62
> 63        <Factory factory = builder.getFactory();
> 64        <Map criteria = factory.createDefaultCriteria();
> 65        <criteria.put( "merlin.server", "false" );
> 66        <criteria.put( "merlin.repository", cache );
> 67        <Object kernel = factory.create( criteria );
> 68        <
> 69        <System.out.println( "Kernel established." );
> 70        <
> 71        <Method shutdown = kernel.getClass().getMethod( "shutdown",
new
> Class[0] );
> 72        <shutdown.invoke( kernel, new Object[0] );
> 73        <
> 74        <System.out.println( "Shutdown complete." );
>
>
> I kinda got lost at this point. I can see that the concrete
implementations
> are determined at runtime, but I don't see what's getting built here
and
> how to use the parameters to build whatever it is we're building.

This section basically instructs the Kernel to set itself up and get
going. 
Steve mentioned that you could add the 
    criteria.put( "merlin.deployment", " your-container-defintion.block
" );

but technically speaking, you could bootstrap components directly in the

component model of the runtime as well, without using block.xml files.
There 
are many ways to get components into the component model.
And that's why the above line is 'missing' in the example you are
looking at.


Cheers
Niclas
-- 
   +------//-------------------+
  / http://www.bali.ac        /
 / http://niclas.hedhman.org / 
+------//-------------------+


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

Reply via email to