Return-Path: Delivered-To: apmail-avalon-cvs-archive@www.apache.org Received: (qmail 50586 invoked from network); 2 Apr 2004 02:51:57 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 2 Apr 2004 02:51:57 -0000 Received: (qmail 50823 invoked by uid 500); 2 Apr 2004 02:51:39 -0000 Delivered-To: apmail-avalon-cvs-archive@avalon.apache.org Received: (qmail 50758 invoked by uid 500); 2 Apr 2004 02:51:38 -0000 Mailing-List: contact cvs-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list cvs@avalon.apache.org Received: (qmail 50745 invoked from network); 2 Apr 2004 02:51:38 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 2 Apr 2004 02:51:38 -0000 Received: (qmail 50516 invoked by uid 1438); 2 Apr 2004 02:51:55 -0000 Date: 2 Apr 2004 02:51:55 -0000 Message-ID: <20040402025155.50515.qmail@minotaur.apache.org> From: mcconnell@apache.org To: avalon-cvs@apache.org Subject: cvs commit: avalon/merlin/platform/xdocs/reference index.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mcconnell 2004/04/01 18:51:55 Modified: merlin/platform/xdocs/reference/component/lifecycle index.xml navigation.xml merlin/platform/xdocs/reference index.xml Added: merlin/platform/xdocs/reference/component/lifecycle etherialization.xml incarnation.xml runtime.xml Log: breakout different lifecycle phases Revision Changes Path 1.4 +6 -319 avalon/merlin/platform/xdocs/reference/component/lifecycle/index.xml Index: index.xml =================================================================== RCS file: /home/cvs/avalon/merlin/platform/xdocs/reference/component/lifecycle/index.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- index.xml 31 Mar 2004 12:57:23 -0000 1.3 +++ index.xml 2 Apr 2004 02:51:55 -0000 1.4 @@ -31,342 +31,29 @@ Lifecycle management concerns the process of incarnation, runtime management, and etherialization. Incarnation is the sequence involving instantiation and possible application of a series of lifecycle stage processes (such as configuration, contextualization, etc.). Runtime management deals with the suspension, resumption of a component. Etherialization represents the process of component end-of-life processing possibly involving the application of multiple lifecycle phases (e.g. disposal).

- + -

-Just as objects are instantiated, the equivalent process from a component is "incarnation". Incarnation involves instantiation, a series of optional artifact delivery stages, and an optional execution phase. Component incarnation is managed exclusively by a container. Occurances of component icarnation are controlled by as associated component implementation lifestyle characteristic. -

- -
- - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - -

instantiation

Incarnation -

-A component may declare either a null constructor, or, a single constructor with any lifecycle artifact as a parameter argument where arguments may be in any combination or order. Recognized lifecycle artificats include -Logger, -Context, -Parameters, -ServiceManager, and/or -Configuration. In addition, the Context object may be substituted with a custom context interface and implementation. -

-

-NOTE: A component implementation may not duplicate constructor injection of lifecycle artifacts with the equivalent lifecycle stage. -

-

Example:

- - /** - * Creation of a new widget. - * - * @param logger a logging channel - * @avalon.dependency type="tutorial.Gizmo" key="gizmo" - */ - public DefaultWidget( Logger logger, ServiceManager manager ) - throws ServiceException - { - m_logger = logger; - m_logger.info( "hello" ); - m_gizmo = (Gizmo) manager.lookup( "gizmo" ); - } - -

logging

-

Optional Logger delivery strategy. A component implementation may implement the LogEnabled interface. The container will supply the component root logger via the enableLogging operation.

-

Example:

- - /** - * Supply of a logging channel by the container to this - * component. - * - * @param logger the logging channel - */ - public void enableLogging( Logger logger ) - { - m_logger = logger; - } - -

contextualization

-

Optional context delivery strategy. A component implementation may implement the Contextualizable interface. The container will supply a component context via the contextualize operation. The context instance will be pre-populated by the container will all requested entries.

-

Example:

- - /** - * Supply of a context object to the component. - * - * @param context the component context - * @avalon.entry key="urn:avalon:home" type="java.io.File" - * @exception ContextException if an error occurs during - * context entry resolution - */ - public void contextualize( Context context ) - throws ContextException - { - m_home = (File) context.get( "urn:avalon:home" ); - } - -

service

-

Optional service manager delivery strategy. A component implementation may implement the Serviceable interface. The container will supply a service manager supporting all declared service dependencies.

-

Example:

- - /** - * Supply of the service manager to the component from which - * dependent services may be accessed relative to a service key. - * - * @param manager the supplied service manager - * @avalon.dependency type="tutorial.Gizmo" key="gizmo" - * @avalon.dependency type="tutorial.Widget" key="widget" - * @exception ServiceException if an error occurs during - * service resolution - */ - public void service( ServiceManager manager ) - throws ServiceException - { - m_gizmo = (Gizmo) manager.lookup( "gizmo" ); - m_widget = (Widget) manager.lookup( "widget" ); - } - -

Note: the usage of the key attribute on a service dependency tag is optional. If not supplied, an implementation my request the service using the type argument (i.e. the service classname). The recommended practice is to declare a local key.

-

configuration

-

Optional configuration delivery strategy. A component implementation may implement the Configurable interface. The container will supply a component configuration via the configure operation.

-

Example:

- - /** - * Supply of the component configuration by the container. - * - * @param config the component configuration - * @exception ConfigurationException if an error occurs during - * configuration handling - */ - public void configure( Configuration config ) - throws ConfigurationException - { - Configuration location = config.getChild( "location" ); - m_address = location.getAttribute( "address" ); - } - -

parameterization

-

Optional parameters delivery strategy. A component may implement the Parameterizable interface. The container will supply a parameters instance via the parameterize operation.

-

Example:

- - /** - * Supply of parameters to the component by the container - * - * @param params the component parameters - * @exception ParameterException if an error occurs during - * parameter handling - */ - public void parameterize( Parameters params ) - throws ParameterException - { - m_secure = params.getParameterAsBoolean( "secure" ); - m_count = params.getParameterAsInteger( "count" ); - } - -

custom stage

-

Optional custom lifecycle stage. A component may implement zero or more custom lifecycle stages. Stages will be applied to the component in the order of avalon.stage declarations.

-

Example:

- -/** - * Component declaring a custom stage dependency. - * - * @avalon.component name="demo" lifestyle="singleton" version="1.0" - * @avalon.stage id="urn:demo:demonstratable" - */ -public class HelloComponent extends AbstractLogEnabled - implements Demonstratable -{ - /** - * A custom lifecycle stage implementation. - * - * @param message a message from the custom lifecycle - * stage handler - */ - public void demo( String message ) - { - getLogger().info( "extension said: " + message ); - } -} - -

initialization

-

Optional initialization stage. A component may implement the Initializable interface. The container will invoke initialization following completion of the delivery of lifecycle artifacts and any custom lifecycle stages.

-

Example:

- - /** - * Initialization of the component by the container. - * - * @exception Exception if an error occurs during - * the initialization phase - */ - public void initialize() throws Exception - { - ... - } - +Just as objects are instantiated, the equivalent process from a component is "incarnation". Incarnation involves instantiation, a series of optional artifact delivery stages, and an optional execution phase. Component incarnation is managed exclusively by a container. Occurances of component icarnation are controlled by as associated component implementation lifestyle characteristic.

execution

Runtime Management -

Optional execution stage. A component may implement either the Startable or Executable interfaces. If the component implements Executable the execute method will be invoked before the component instance is exposed to any other component. If the component implements the Startable interface the container will invoke the start operation. An implementation is responsible for establishing a working thread and returned from the start operation promptly.

-

Executable Example:

- - /** - * Execute implementation. - */ - public void execute() - { - ... - } - - -

Startable Example:

- - - /** - * Start the component. - */ - public void start() throws Exception - { - ... - } - - -
- -
- - - -

Runtime management deals with interaction with a component between the incarnation and etherialization stages. The Avalon framework defines the notion of a suspendable component. The framework also defines a number of delivery interfaces dealing with reintroduction of lifecycle artificats. None of the framework reintroduction interfaces are supported - instead, runtime management is approached as a management concern wherein any existing artifact delivery interface may be reused by a container while a component is under a suspended state. The action of resumption is equivalent to the notion of re-initialization. -

- -
- - - - - - - - + - -

suspension

-

-A component implementing the the Suspendable lifecycle may be suspended by a container management system. Following suspension a container may re-apply lifecycle artifact delivery stages (logging, contextualization, service, parameterization). -

-

Suspendable Example:

- - /** - * Suspend the component. - */ - public void suspend() - { - ... - } -

suspension

Etherialization -

-A component implementing the the Suspendable lifecycle may be placed back into operation following suspension by a container management system. -

-

Suspendable Example:

- - /** - * Resume execution. - */ - public void resume() - { - ... - } - -
-
- - - -

The etherialization stage is the component equivalent of an object finalization. Etherialization covers the stopping of a running component and subsequent disposal. Initiation of the etherialization phase on a component instance is exclusively controlled by it's container. -

- -
- - - - - - - - - - -

execution

-

-A component implementing the the Startable lifecycle interface will be shutdown by the container. -

-

Startable Example:

- - - /** - * Stop the component. - */ - public void stop() throws Exception - { - ... - } - -

disposal

-

-A component may participate in end-of-life processing by implementing the -Disposable lifecycle interface. An implementation will typically released references during this stage. -

-

Example:

- - - /** - * Disposal of the component. - */ - public void dispose() - { - ... - } -
+
1.6 +3 -3 avalon/merlin/platform/xdocs/reference/component/lifecycle/navigation.xml Index: navigation.xml =================================================================== RCS file: /home/cvs/avalon/merlin/platform/xdocs/reference/component/lifecycle/navigation.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- navigation.xml 1 Apr 2004 23:49:09 -0000 1.5 +++ navigation.xml 2 Apr 2004 02:51:55 -0000 1.6 @@ -47,11 +47,11 @@ + href="/reference/component/lifecycle/incarnation.html"/> + href="/reference/component/lifecycle/runtime.html"/> + href="/reference/component/lifecycle/etherialization.html"/> 1.1 avalon/merlin/platform/xdocs/reference/component/lifecycle/etherialization.xml Index: etherialization.xml =================================================================== Stephen McConnell Lifestyle Specification

The etherialization stage is the component equivalent of an object finalization. Etherialization covers the stopping of a running component and subsequent disposal. Initiation of the etherialization phase on a component instance is exclusively controlled by it's container.

execution

A component implementing the the Startable lifecycle interface will be shutdown by the container.

Startable Example:

/** * Stop the component. */ public void stop() throws Exception { ... }

disposal

A component may participate in end-of-life processing by implementing the Disposable lifecycle interface. An implementation will typically released references during this stage.

Example:

/** * Disposal of the component. */ public void dispose() { ... }
1.1 avalon/merlin/platform/xdocs/reference/component/lifecycle/incarnation.xml Index: incarnation.xml =================================================================== Stephen McConnell Lifestyle Specification

Just as objects are instantiated, the equivalent process from a component is "incarnation". Incarnation involves instantiation, a series of optional artifact delivery stages, and an optional execution phase. Component incarnation is managed exclusively by a container. Occurances of component icarnation are controlled by as associated component implementation lifestyle characteristic.

instantiation

A component may declare either a null constructor, or, a single constructor with any lifecycle artifact as a parameter argument where arguments may be in any combination or order. Recognized lifecycle artificats include Logger, Context, Parameters, ServiceManager, and/or Configuration. In addition, the Context object may be substituted with a custom context interface and implementation.

NOTE: A component implementation may not duplicate constructor injection of lifecycle artifacts with the equivalent lifecycle stage.

Example:

/** * Creation of a new widget. * * @param logger a logging channel * @avalon.dependency type="tutorial.Gizmo" key="gizmo" */ public DefaultWidget( Logger logger, ServiceManager manager ) throws ServiceException { m_logger = logger; m_logger.info( "hello" ); m_gizmo = (Gizmo) manager.lookup( "gizmo" ); }

logging

Optional Logger delivery strategy. A component implementation may implement the LogEnabled interface. The container will supply the component root logger via the enableLogging operation.

Example:

/** * Supply of a logging channel by the container to this * component. * * @param logger the logging channel */ public void enableLogging( Logger logger ) { m_logger = logger; }

contextualization

Optional context delivery strategy. A component implementation may implement the Contextualizable interface. The container will supply a component context via the contextualize operation. The context instance will be pre-populated by the container will all requested entries.

Example:

/** * Supply of a context object to the component. * * @param context the component context * @avalon.entry key="urn:avalon:home" type="java.io.File" * @exception ContextException if an error occurs during * context entry resolution */ public void contextualize( Context context ) throws ContextException { m_home = (File) context.get( "urn:avalon:home" ); }

service

Optional service manager delivery strategy. A component implementation may implement the Serviceable interface. The container will supply a service manager supporting all declared service dependencies.

Example:

/** * Supply of the service manager to the component from which * dependent services may be accessed relative to a service key. * * @param manager the supplied service manager * @avalon.dependency type="tutorial.Gizmo" key="gizmo" * @avalon.dependency type="tutorial.Widget" key="widget" * @exception ServiceException if an error occurs during * service resolution */ public void service( ServiceManager manager ) throws ServiceException { m_gizmo = (Gizmo) manager.lookup( "gizmo" ); m_widget = (Widget) manager.lookup( "widget" ); }

Note: the usage of the key attribute on a service dependency tag is optional. If not supplied, an implementation my request the service using the type argument (i.e. the service classname). The recommended practice is to declare a local key.

configuration

Optional configuration delivery strategy. A component implementation may implement the Configurable interface. The container will supply a component configuration via the configure operation.

Example:

/** * Supply of the component configuration by the container. * * @param config the component configuration * @exception ConfigurationException if an error occurs during * configuration handling */ public void configure( Configuration config ) throws ConfigurationException { Configuration location = config.getChild( "location" ); m_address = location.getAttribute( "address" ); }

parameterization

Optional parameters delivery strategy. A component may implement the Parameterizable interface. The container will supply a parameters instance via the parameterize operation.

Example:

/** * Supply of parameters to the component by the container * * @param params the component parameters * @exception ParameterException if an error occurs during * parameter handling */ public void parameterize( Parameters params ) throws ParameterException { m_secure = params.getParameterAsBoolean( "secure" ); m_count = params.getParameterAsInteger( "count" ); }

custom stage

Optional custom lifecycle stage. A component may implement zero or more custom lifecycle stages. Stages will be applied to the component in the order of avalon.stage declarations.

Example:

/** * Component declaring a custom stage dependency. * * @avalon.component name="demo" lifestyle="singleton" version="1.0" * @avalon.stage id="urn:demo:demonstratable" */ public class HelloComponent extends AbstractLogEnabled implements Demonstratable { /** * A custom lifecycle stage implementation. * * @param message a message from the custom lifecycle * stage handler */ public void demo( String message ) { getLogger().info( "extension said: " + message ); } }

initialization

Optional initialization stage. A component may implement the Initializable interface. The container will invoke initialization following completion of the delivery of lifecycle artifacts and any custom lifecycle stages.

Example:

/** * Initialization of the component by the container. * * @exception Exception if an error occurs during * the initialization phase */ public void initialize() throws Exception { ... }

execution

Optional execution stage. A component may implement either the Startable or Executable interfaces. If the component implements Executable the execute method will be invoked before the component instance is exposed to any other component. If the component implements the Startable interface the container will invoke the start operation. An implementation is responsible for establishing a working thread and returned from the start operation promptly.

Executable Example:

/** * Execute implementation. */ public void execute() { ... }

Startable Example:

/** * Start the component. */ public void start() throws Exception { ... }
1.1 avalon/merlin/platform/xdocs/reference/component/lifecycle/runtime.xml Index: runtime.xml =================================================================== Stephen McConnell Lifestyle Specification

Runtime management deals with interaction with a component between the incarnation and etherialization stages. The Avalon framework defines the notion of a suspendable component. The framework also defines a number of delivery interfaces dealing with reintroduction of lifecycle artificats. None of the framework reintroduction interfaces are supported - instead, runtime management is approached as a management concern wherein any existing artifact delivery interface may be reused by a container while a component is under a suspended state. The action of resumption is equivalent to the notion of re-initialization.

suspension

A component implementing the the Suspendable lifecycle may be suspended by a container management system. Following suspension a container may re-apply lifecycle artifact delivery stages (logging, contextualization, service, parameterization).

Suspendable Example:

/** * Suspend the component. */ public void suspend() { ... }

suspension

A component implementing the the Suspendable lifecycle may be placed back into operation following suspension by a container management system.

Suspendable Example:

/** * Resume execution. */ public void resume() { ... }
1.3 +11 -3 avalon/merlin/platform/xdocs/reference/index.xml Index: index.xml =================================================================== RCS file: /home/cvs/avalon/merlin/platform/xdocs/reference/index.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- index.xml 31 Mar 2004 12:57:24 -0000 1.2 +++ index.xml 2 Apr 2004 02:51:55 -0000 1.3 @@ -43,18 +43,26 @@ Component Specification - Formal specification of the Avalon Component model. + Avalon Component model specification covering component type + descriptors, runtime artifacts supplied by a container to a + component, lifecycle management, and lifestyle management. Deployment Specification - Formal specification of the Avalon Deployment model. + Avalon Deployment model specification covering the complete set + of component and containment directives, including classloader + management, container composition, container includes, composite + component publication and related utility directives. System Specification - IN PREP + + Merlin system specification including kernel configuration + directives and system deployment properties. + --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org For additional commands, e-mail: cvs-help@avalon.apache.org