avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen McConnell <mcconn...@apache.org>
Subject [merlin] overview of changes to HEAD
Date Thu, 12 Feb 2004 07:07:29 GMT

The bulk of cvs updates were completed last night and the remainder 
earlier this evening.  This email is to provide an overview of the 
changes and notes concerning building (which mainly concern notes on 
dependent builds).

Recent Changes

The recent changes reflect the move from "runtime using model" to "model
driving runtime".  The inversion is desirable for a number of reasons -
the most immediate of which is the work on code security. Under the
current implementation we have the following general flow of control:

   1. merlin factory builds a system context based on the a factory
   2. system context
        - selects runtime (based on security enabled property)
        - establishes a meta model factory
        - loads the runtime using supplied runtime artifact
   3. merlin factory create root application meta-model
   4. populates model based on ${merlin.deployment} values
   5. creates kernel

To see the above in action you can try doing the following:

   $ merlin -info http://dpml.net/merlin/tutorial/hello

and compare this with the same command using -secure

   $ merlin -info -secure http://dpml.net/merlin/tutorial/hello

The difference between the two is the runtime that is selected. In the
standard case the runtime is avalon-activation-impl and in the secure
case the runtime is avalon-activation-csi.


Once a kernel is established, kernel startup simply invokes the
commissioning of the root application model.  An important difference
here is that Appliance and Block concepts are no longer visible. The
commissioning and decommissioning operations are applies directly to the
model and its the model that drives the commission/decommissioning by
the selected runtime.

When a model is commissioning it goes through the following process:

If the model is a containment model:

   1. assembly (if not already assembled) involving
      resolution of a provider model for all dependencies
      (runtime deps and lifecycle phase deps)

   2. commissioning of all contained models in a sequence
      derived from the dependency relationships and activation

For both the container and component models, the commissioning process
concludes with the commissioning of the runtime.

   3. runtime commissioning - where the model makes a request
      to the system context for commissioning of a dedicated runtime
      which in turn forwards the request to the assigned runtime

   4. if the model is a containment model the runtime commissioning
      phase invokes the establishment of a proxy that does the
      composite component simulation (enabling a container to look
      and behave like a service) - if the model is a component model,
      the commissioning phase involves the commissioning of the
      associated lifestyle handler

In general the changes have resulted in a significant cleanup of the
activation package.  There is also a number of enhancements.  Firstly 
the proxy creation for classic components has been improved to eliminate 
the requirement for instance activation prior to the invocation of a 
method on a service.  Secondly, some experimental content has been 
included to provide support for constructor based injection of lifecycle 
artifacts (currently limited to Logger and ServiceManager).

This introduces the possibility for the following:

   public class DefaultWidget implements Widget

       private final Logger m_logger;
       private final Gizmo m_gizmo;

       * Creation of a new widget.
       * @param logger the assigned logging channel
       * @param manager the service manager
       * @avalon.dependency key="gizmo"
       *    type="org.apache.avalon.playground.Gizmo"
       public DefaultWidget(
         Logger logger, ServiceManager manager )
         throws ServiceException
           m_logger = logger;
           m_logger.info( "this is widget" );
           m_gizmo = (Gizmo) manager.lookup( "gizmo" );
           m_logger.info( "got a gizmo, ready to run" );

       // etc

Changes to the activation/composition package relationships has impacted 
the Kernel interface. In 3.2.5 and earlier the kernel exposed the root 
Block.  This has replaced by exposure of the root ContainmentModel.  In 
general, the procedure for location of a subcomponent or container model 
remains the same but the details are slightly different.  Instead of 
invoking locate of a block, an embedding application would do the following:

    ContainmentModel root = m_kernel.getModel();
    DeploymentModel person = root.getModel( "/test/fred" );
    Friend fred = (Friend) person.resolve();

Building CVS HEAD:

To build the latest version of Merlin (CVS HEAD) it is recommended to
update and rebuild the following packages in the order listed here:


Technically this is only required if your building offline because on
on-line build should pull down latest snapshots.

Snapshot builds

A snapshot from a couple of hours ago is available at the following 


Cheers, Stephen.


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

To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org

View raw message