Sonu Vijay wrote:

Hi,

What does the "merlin.deployment" property exactly
specify.I read abt it  yesterday somewhere on avalon
site but can't find it now.

The DefaultFactory class in the merlin/kernel/impl package is responsible for (a) establishing an initial factory criteria, and (b) creating a kernel instance using a default or modified criteria argument. When the DefaultFactory prepares the initial criteria, it builds up the default values using a combination of:


   - hard coded defaults
   - defaults derived from merlin.properties files in
        * MERLIN_HOME/merlin.properties
        * ${merlin.dir}/merlin.properties
        * ${user.home}/merlin.properties
   - system properties

Property names and the corresponding allowable values are declared in the following page:

http://avalon.apache.org/merlin/merlin/kernel/properties.html

The merlin.deployment property defines a comma separated sequence of blocks to be included in the root merlin application block on startup.

Stephen.




thanks



--- Stephen McConnell <[EMAIL PROTECTED]> wrote:


Mathews Julien wrote:


Yeah Stephen, This helps in making things more

clear.


Stephen wrote:
The


avalon-repository
  system uses artifact references as the key to

locating meta data


about embedded classloaders. The classloader

meta data is


maintained as a properties file with the .meta

extension. For


example the above artifact meta address

translates to:


The content of the meta file is automatically

generated using the


avalon-plugin avalon:artifact goal.



How does the avalon:artifact goal generate the

meta information in the


.meta info. I mean where does is get the info abt

the "implementation


dependencies" etc.


From some project.xml or some meta tags or where

?


The avalon:artifact goal scans the project PMC
(Maven's project definition) and looks at all of the dependencies
that are listed. For each dependency, the plugin looks for a declared
dependency properties and does some special processing for properties
named "avalon.classloader". For example the following is
a dependency declaration within the merlin/kernel/impl
project.xml:


<dependency>
<groupId>merlin</groupId>
<artifactId>merlin-api</artifactId>
<version>3.3-SNAPSHOT</version>
<properties>
<avalon.classloader>spi</avalon.classloader>
</properties>
</dependency>


The plugin will look for the property name
"avalon.classloader" and if the property value is "api" then the dependency will
be loaded into an api classloader. If the property is "spi" the
dependency will be loaded into a spi classloader which is created as a child
of the spi loader. If no "avalon.classloader" property is declared that
dependency will be loaded into a impl classloader which is created as a
child of the spi loader.


The avalon-repository bootstrapping system will
attempt to construct a classloader chain that looks like the following:


    |----------------------|
    |   api classloader    |
    |----------------------|
              ^
              |
    |----------------------|
    |   spi classloader    |
    |----------------------|
              ^
              |
    |----------------------|
    |   imp classloader    |
    |----------------------|



Could you pls explain a little bit.

The avalon:artifact source file is a jelly script in


avalon/util/plugin/plugin.jelly.

Cheers, Stephen.



Thanks
Mathews




From: Stephen McConnell <[EMAIL PROTECTED]>
Reply-To: "Avalon framework users"

<[EMAIL PROTECTED]>


To: Avalon Users <[EMAIL PROTECTED]>
Subject: [merlin] introduction to embedding
Date: Sun, 25 Jan 2004 16:17:19 +0100


This is a little introduction to embedding

Merlin. The descriptions


starts off with an overview of the Avalon

Repository bootstrapping


system - which at the end of the day is the core

embedding technology


used within the merlin platform.

Simple Embedding Example:
-------------------------

1. creating an initial context

    File cache = new File( "my-cache" );
    InitialContext context = new

DefaultInitialContext( cache );


The above code defines a cache directory for

the repository


system to use when loading resources needed in

your embedded


application - and provides the directory as an

argument when


creating a new InitialContext object. The

InitialContext is


you hook into the repository system and the

embedding machinery.


2. declare what you want to embed

String spec =

"artifact:avalon-logging/avalon-logkit?version=1.0-SNAPSHOT"

    Artifact artifact =
      Artifact.createArtifact( spec );

An artifact is a logical reference to a jar

file (or other type


of resource) that the repository can access.

The avalon-repository


system uses artifact references as the key to

locating meta data


about embedded classloaders. The classloader

meta data is


maintained as a properties file with the .meta

extension. For


example the above artifact meta address

translates to:



[host]/avalon-logging/jars/avalon-logkit-impl-1.0-SNAPSHOT.jar.meta

The content of the meta file is automatically

generated using the


avalon-plugin avalon:artifact goal. Two real

examples are attached


(the logkit factory and the merlin factory

meta).


The contents of the meta file includes:

* a ordered list of jar files that are

required to


construct a classloader for the embedded

application


* the name of a factory class to be used as

the embedded


instance creator

3. create the factory

Using the initial context and the artifact you

now have everything


you need to create you embedded instance.

Builder builder = m_context.newBuilder(

artifact );


Factory factory = builder.getFactory();

Behind the scenes the avalon-repository system

has gone off, pulled


down the meta data, downloaded and cached all

of the classloader


entries, constructed a new classloader, and

instantiated the


factory.

4. parameterizing the factory

The factory object is the central entry point

of

=== message truncated ===



__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/

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




--

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/merlin/distributions/latest    |
|------------------------------------------------|

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



Reply via email to