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
criteria
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 kernelTo 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.
artifact:avalon-activation/avalon-activation-impl?version=2.0-SNAPSHOT artifact:avalon-activation/avalon-activation-csi?version=2.0-SNAPSHOT
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
policiesFor 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 handlerIn 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:
util meta repository logging merlin
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 location:
http://dpml.net/merlin/distributions/3.3/snapshots/20040212/
Cheers, Stephen.
--
|------------------------------------------------| | 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]
