Within the Metro system there is a distinct separation between the model of a component, the component runtime machinery, and the component implementation. The component model is a remotely accessible object through which the runtime machinery can access configuration information about a component. The runtime machinery basically handles concerns such as assembly, deployment, decommissioning and so forth.
A component model is created using the standard controller.
Controller controller = Controller.STANDARD; URI uri = new URI( "artifact:part:acme/acme-widget#1.1" ); Model model = controller.createModel( uri ); Component component = controller.createComponent( model );
Note that the model returned from the controller is remotable and as such the system handling model configuration may be executing in a different virtual machine to the component runtime. Equally, a component deployment system can register a model with a central management system (as is the case with the Station manager).
The Metro system defines a number of extended model interfaces that allow control of aspects of the component and context model. These interfaces are described below - however, please note that these interfaces are specific to the Metro platform and will not be recognized by generic systems based strictly on the Part API.
The net.dpml.metro.ComponentModel interface exposes information about a component configuration. The net.dpml.metro.MutableComponentModel interface includes additional operations dealing with model changes.
Attributes exposed by the ComponentModel interface:
- the component name
- the component implementation classname
- activation policy
- lifestyle policy
- garbage collection policy
- classloader chain definition
- keys to internal parts
- access to the component models of internal parts
- logging category priority assignments
- assigned configuration and/or parameterization data
- the context model
The net.dpml.metro.ContextModel interface exposes information about a context settings - specifically the binding of context keys to context value directives. The net.dpml.metroMutableContextModel provides support for context entry modification.
Interfaces described here are subject to change. In particular listener addition and removal operations are required, together with operations dealing with constructor parameter factory configuration.