You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2003/05/21 21:25:06 UTC

cvs commit: avalon-site/site/excalibur/lifecycle/skin/images add.jpg favicon.ico note.gif nw_maj_rond.gif nw_min.gif pdfdoc.gif remove.jpg strich.gif update.jpg valid-html401.png vcss.png void.gif xmldoc.gif

bloritsch    2003/05/21 12:25:06

  Added:       site/excalibur/lifecycle extension.html fortress.html
                        index.html interfaces.html merlin.html
               site/excalibur/lifecycle/images group-logo.gif
                        project-logo.gif
               site/excalibur/lifecycle/skin mysite.css print.css site.css
                        tigris.css
               site/excalibur/lifecycle/skin/images add.jpg favicon.ico
                        note.gif nw_maj_rond.gif nw_min.gif pdfdoc.gif
                        remove.jpg strich.gif update.jpg valid-html401.png
                        vcss.png void.gif xmldoc.gif
  Log:
  add lifecycle docs
  
  Revision  Changes    Path
  1.1                  avalon-site/site/excalibur/lifecycle/extension.html
  
  Index: extension.html
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  <html>
  <head>
  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <!--*** This is a generated file.  Do not edit.  ***-->
  <link rel="stylesheet" href="skin/tigris.css" type="text/css">
  <link rel="stylesheet" href="skin/mysite.css" type="text/css">
  <link rel="stylesheet" href="skin/site.css" type="text/css">
  <link media="print" rel="stylesheet" href="skin/print.css" type="text/css">
  <title>Lifecycle Extensions</title>
  </head>
  <body bgcolor="white" class="composite">
  <!--================= start Banner ==================-->
  <div id="banner">
  <table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0">
  <tbody>
  <tr>
  <!--================= start Group Logo ==================-->
  <td align="left">
  <div class="groupLogo">
  <a href="http://www.apache.org/"><img border="0" class="logoImage" alt="Apache" src="images/group-logo.gif"></a>
  </div>
  </td>
  <!--================= end Group Logo ==================-->
  <!--================= start Project Logo ==================--><td align="right">
  <div class="projectLogo">
  <a href="http://avalon.apache.org/"><img border="0" class="logoImage" alt="Apache Avalon" src="images/project-logo.gif"></a>
  </div>
  </td>
  <!--================= end Project Logo ==================-->
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Banner ==================-->
  <!--================= start Main ==================-->
  <table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs">
  <tbody>
  <!--================= start Status ==================-->
  <tr class="status">
  <td>
  <!--================= start BreadCrumb ==================--><a href=""></a><a href=""></a><a href=""></a>
  <!--================= end BreadCrumb ==================--></td><td id="tabs">
  <!--================= start Tabs ==================-->
  <div class="tab">
  <span class="unselectedTab"><a href="http://avalon.apache.org/">Avalon Home</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/framework/">Framework</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/components/">Components</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/phoenix/">Phoenix</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/seca/">SECA</a></span>
  </div>
  <!--================= end Tabs ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  <!--================= end Status ==================-->
  <table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0">
  <tbody>
  <tr valign="top">
  <!--================= start Menu ==================-->
  <td id="leftcol">
  <div id="navcolumn">
  <div class="menuBar">
  <div class="menu">
  <span class="menuLabel">About</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/index.html">Excalibur Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/bindownload.cgi">Download</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/compatibility/api/">API Docs</a>
  </div>
  
    
  </div>
  <div class="menu">
  <span class="menuLabel">Lifecycle</span>
      
  <div class="menuItem">
  <a href="index.html">Overview</a>
  </div>
      
  <div class="menuItem">
  <span class="menuSelected">Extensions</span>
  </div>
      
  <div class="menuItem">
  <a href="interfaces.html">Interfaces</a>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Tutorial</span>
      
  <div class="menuItem">
  <a href="fortress.html">Fortress</a>
  </div>
      
  <div class="menuItem">
  <a href="merlin.html">Merlin</a>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Related Links</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/fortress/">Fortress Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/sandbox/merlin/">Merlin Home</a>
  </div>
    
  </div>
  </div>
  </div>
  </td>
  <!--================= end Menu ==================-->
  <!--================= start Content ==================--><td>
  <div id="bodycol">
  <div class="app">
  <div align="center">
  <h1>Lifecycle Extensions</h1>
  </div>
  <div class="h3">
    
    
  
    
  <div class="h3">
  <h3>What are lifecycle extensions ?</h3>
  </div>
     
  <p>
      Lifecycle extensions are additional stages a component can traverse through during
      it's lifetime. Lifecycle extensions allow a container to provide extra functionality
      to components in addition to the standard stages defined by Avalon Framework.
     </p>
  
     
  <p>
      Avalon Framework defines a set of standard interfaces often termed as Lifecycle
      stages that can be used by a container to determine the components requirements
      during deployment and subsequent decommissioning.
     </p>
  
     
  <p>
      These interfaces allows the developer to separate the various concerns involved when
      writing a component. Often termed SoC and IoC (Separation of Concerns and Inversion of
      Control), these concepts represent one of the primary advantages of using Avalon.
     </p>
  
     
  <p>
      Sometimes it's useful to extend this development paradigm from the framework level
      into the application domain, to create customized lifecycle extensions that are called
      upon in addition to the standard set defined by the Avalon Framework.
     </p>
  
     
  <p>
      Such custom lifecycle stages can further enable domain specific logic across many,
      perhaps even unrelated components, can reduce code duplication, and allows the developer
      to reuse the same development and thinking paradigm as the standard lifecycle stages.
     </p>
  
     
  <p>
      For example, you might want to pass a specialized SecurityManager to some of your
      components before they are initialized, or have their internal state persistently cached
      during system shutdown and restored at during startup. You might want to pass user
      dependent decryption keys to your component, or give components the opportunity to
      recycle themselves before being disposed or returned to a pooled component handler.
     </p>
  
     
  <p>
      The possibilities and number of extensions are only limited by the requirements of your
      particular application domain.
     </p>
  
     
  <p>
      This document describes how to add new lifecycle extensions using <strong>Fortress</strong>
      and <strong>Merlin</strong> containers.
      This document assumes a knowledge of what an Avalon lifecycle is, and a basic understanding
      of the standard lifecycle interfaces Avalon Framework defines. References in this document to
      Service and ServiceManager can also be freely interpreted as Component and ComponentManager
      by the reader.
     </p>
  
      
  <div class="frame note">
  <div class="label">Note</div>
  <div class="content">As at the time of writing, Fortress and Merlin is the only Avalon container that
      supports lifecycle extensions, which means components that use this feature will not work
      with the other Avalon containers (ExcaliburComponentManager, Phoenix, Tweety, etc)</div>
  </div>
  
     
  <p>
      Support for lifecycle extensions in the other Avalon containers is technically possible but
      has not yet been discussed. Please check with the Avalon developer mailing list if you use
      one of these containers and would like to use lifecycle extensions.
     </p>
  
    
  
    
  <div class="h3">
  <h3>How do I extend a Component's lifecycle ?</h3>
  </div>
     
  <p>
      Extending a Component's lifecycle is straightforward. An overview of the process
      follows:
     </p>
  
      
  <ol>
  	    
  <li>Define the new component interface
  
  		    <br>
  <br>
        Create the new interface defining the operations that should be called upon components
        that implement this interface. Using the previously mentioned examples, this would be
        your <span class="codefrag">SecurityManageable</span>, <span class="codefrag">Cacheable</span>, <span class="codefrag">Decryptable</span>,
        <span class="codefrag">Recycleable</span> interfaces.
        </li>
  
       
  <li>Define an extension object that calls upon the methods defined in the new interface,
  	     during one or more of the pre-defined phases of component's lifecycle
  
  	     <br>
  <br>
        Create a class that implements the <span class="codefrag">Creator</span> and/or <span class="codefrag">Accessor</span>
        interfaces and implemets the interaction with target components supplied under the
        create, destroy, access and relase operations.
        </li>
  
       
  <li>Register your extension object
  
  	     <br>
  <br>
         This depends on the container you are using.  In
         Merlin you need to include the &lt;extensions&gt; tag in the component .xinfo file and
         Merlin will automatically recognize it.  In Fortress you register the extension object
         with a <span class="codefrag">LifecycleExtensionManager</span>
         
  </li>
  
       
  <li>Implement the new component interface on your component
  	     <br>
  <br>
  	    
        Add the new <span class="codefrag">implements</span> clause to your Component, or Component implementation,
        and write any methods defined in the implemented interface.
        <br>
  <br>
  
        Proceed as normal. Checking for extensions is done implicitly within both Fortress and
        Merlin. Once lifecycle extensions are registered they will be activated during the 4
        phases defined later in this document.
        </li>
      
  </ol>
    
  
    
  <div class="h3">
  <h3>When can a Component's lifecycle be extended ?</h3>
  </div>
     
  <p>
      The life of any component can be broken down to the following phases:
     </p>
  
      
  <ol>
  	    
  <li>Creation
  
  		    <br>
  <br>
        When the component is instantiated.
        </li>
  
       
  <li>Access
  
  	     <br>
  <br>
        When the component is accessed via a ServiceManager/Selector
        (<span class="codefrag">lookup()/select()</span>).
        </li>
  
       
  <li>Release
  
  	     <br>
  <br>
        When the component is released via a ServiceManager/Selector (<span class="codefrag">release()</span>).
        </li>
  
       
  <li>Destruction
  
  	     <br>
  <br>
        When the component is decommissioned, ready for garbage collection.
        
       </li>
  
      
  </ol>
  
      
  <div class="frame note">
  <div class="label">Note</div>
  <div class="content">A component will go through it's Creation and Destruction phase only once. Since
      extension classes can implement different handling strategies (Poolable, ThreadSafe,
      etc), the access and release phases of a component can be applied multiple times.</div>
  </div>
  
     
  <p>
      Lifecycle extensions can be added to any of the above defined phases. This allows
      you to control the interception point your particular extension will be applied under.
     </p>
  
     
  <p>
      For example, thread or user dependent extensions would be added at the access and release
      levels (ie. when the component is retrieved and returned to the ServiceManager) as they
      depend on runtime data not available until they are actually used.
     </p>
  
     
  <p>
      More static, or global extensions would be added at the creation or destruction level, since
      they do not depend on any external data that change during runtime, nor are they particular
      to any one context of use.
     </p>
  
    
  
    
  <div class="h3">
  <h3>Lifestyle Extension Interfaces</h3>
  </div>
  
        
  <p>
        A container manages extensions using an extension handler.  Handlers may implement
        the <span class="codefrag">Creator</span> and/or <span class="codefrag">Accessor</span> interfaces.  A creator extension
        will be activated during the create and destroy stages of a component lifecycle.  A
        accessor extension will be activated during the access and release stages.
        </p>
  
        
  <div class="h4">
  <h4>The Creator Interface</h4>
  </div>
  
  
  <p>The <span class="codefrag">Creator</span> interface describes the create and destroy
  stages that occur between a component and a container
  during service management.  Lifecycle extensions supporting create
  and destroy stages must implement this interface.</p>
  
        
  <pre class="code">
   package org.apache.avalon.lifecycle;
  
   import org.apache.avalon.framework.context.Context;
  
   public interface Creator
   {
      /**
       * Create stage handler.
       *
       * @param object the object that is being created
       * @param context the context instance required by the create handler
       *    implementation
       * @exception Exception if an error occurs
       */
      void create( Object object, Context context )
          throws Exception;
  
      /**
       * Destroy stage handler.
       *
       * @param object the object that is being destroyed
       * @param context the context instance required by the handler
       *    implementation
       */
      void destroy( Object object, Context context );
  
   }
       </pre>
        
  
        
  <div class="h4">
  <h4>Accessor Interface</h4>
  </div>
  
  <p>
  The <span class="codefrag">Accessor</span> interface describes the access and release
  stages that occur between a service or component manager and a container
  during service deployment.  Lifecycle extensions supporting access
  and release stages must implement this interface.
  </p>
  
  <pre class="code">
   package org.apache.avalon.lifecycle;
  
   import org.apache.avalon.framework.context.Context;
  
   public interface Accessor
   {
      /**
       * Access stage handler.
       *
       * @param object the object that is being accessed
       * @param context the context instance required by the access handler
       *    implementation
       * @exception Exception if an error occurs
       */
      void access( Object object, Context context )
          throws Exception;
  
      /**
       * Release stage handler.
       *
       * @param object the object that is being released
       * @param context the context instance required by the release handler
       *    implementation
       */
      void release( Object object, Context context );
  
   }
  </pre>
     
    
  
    
  <div class="h3">
  <h3>Need more information ?</h3>
  </div>
     
  <p>
      If you have any particular questions, comments, etc, please send an email to the Avalon
      developer mailing <a href="mailto:dev.at.avalon.apache.org">list</a>.
     </p>
    
  
    
    
  
  <div id="authors" align="right">by&nbsp;Avalon Development Team</div>
  </div>
  </div>
  </div>
  </td>
  <!--================= end Content ==================-->
  </tr>
  </tbody>
  </table>
  <!--================= end Main ==================-->
  <!--================= start Footer ==================-->
  <div id="footer">
  <table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0">
  <tbody>
  <tr>
  <!--================= start Copyright ==================-->
  <td colspan="2">
  <div align="center">
  <div class="copyright">
                Copyright &copy; 2003&nbsp;The Apache Software Foundation.. All rights reserved.
              </div>
  </div>
  </td>
  <!--================= end Copyright ==================-->
  </tr>
  <tr>
  <td align="left">
  <!--================= start Host ==================-->
  <!--================= end Host ==================--></td><td align="right">
  <!--================= start Credits ==================-->
  <div align="right">
  <div class="credit"></div>
  </div>
  <!--================= end Credits ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Footer ==================-->
  </body>
  </html>
  
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/fortress.html
  
  Index: fortress.html
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  <html>
  <head>
  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <!--*** This is a generated file.  Do not edit.  ***-->
  <link rel="stylesheet" href="skin/tigris.css" type="text/css">
  <link rel="stylesheet" href="skin/mysite.css" type="text/css">
  <link rel="stylesheet" href="skin/site.css" type="text/css">
  <link media="print" rel="stylesheet" href="skin/print.css" type="text/css">
  <title>Fortress Lifecycle Extensions</title>
  </head>
  <body bgcolor="white" class="composite">
  <!--================= start Banner ==================-->
  <div id="banner">
  <table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0">
  <tbody>
  <tr>
  <!--================= start Group Logo ==================-->
  <td align="left">
  <div class="groupLogo">
  <a href="http://www.apache.org/"><img border="0" class="logoImage" alt="Apache" src="images/group-logo.gif"></a>
  </div>
  </td>
  <!--================= end Group Logo ==================-->
  <!--================= start Project Logo ==================--><td align="right">
  <div class="projectLogo">
  <a href="http://avalon.apache.org/"><img border="0" class="logoImage" alt="Apache Avalon" src="images/project-logo.gif"></a>
  </div>
  </td>
  <!--================= end Project Logo ==================-->
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Banner ==================-->
  <!--================= start Main ==================-->
  <table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs">
  <tbody>
  <!--================= start Status ==================-->
  <tr class="status">
  <td>
  <!--================= start BreadCrumb ==================--><a href=""></a><a href=""></a><a href=""></a>
  <!--================= end BreadCrumb ==================--></td><td id="tabs">
  <!--================= start Tabs ==================-->
  <div class="tab">
  <span class="unselectedTab"><a href="http://avalon.apache.org/">Avalon Home</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/framework/">Framework</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/components/">Components</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/phoenix/">Phoenix</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/seca/">SECA</a></span>
  </div>
  <!--================= end Tabs ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  <!--================= end Status ==================-->
  <table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0">
  <tbody>
  <tr valign="top">
  <!--================= start Menu ==================-->
  <td id="leftcol">
  <div id="navcolumn">
  <div class="menuBar">
  <div class="menu">
  <span class="menuLabel">About</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/index.html">Excalibur Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/bindownload.cgi">Download</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/compatibility/api/">API Docs</a>
  </div>
  
    
  </div>
  <div class="menu">
  <span class="menuLabel">Lifecycle</span>
      
  <div class="menuItem">
  <a href="index.html">Overview</a>
  </div>
      
  <div class="menuItem">
  <a href="extension.html">Extensions</a>
  </div>
      
  <div class="menuItem">
  <a href="interfaces.html">Interfaces</a>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Tutorial</span>
      
  <div class="menuItem">
  <span class="menuSelected">Fortress</span>
  </div>
      
  <div class="menuItem">
  <a href="merlin.html">Merlin</a>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Related Links</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/fortress/">Fortress Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/sandbox/merlin/">Merlin Home</a>
  </div>
    
  </div>
  </div>
  </div>
  </td>
  <!--================= end Menu ==================-->
  <!--================= start Content ==================--><td>
  <div id="bodycol">
  <div class="app">
  <div align="center">
  <h1>Fortress Lifecycle Extensions</h1>
  </div>
  <div class="h3">
    
    
  
    
  <div class="h3">
  <h3>Example</h3>
  </div>
  
     
  <p>
      Let's look at a simple example. The following is also available as a working sample
      in Fortress' examples directory.
     </p>
  
     
  <p>
      Our example implements a Lifecycle extension for passing a <span class="codefrag">SecurityManager</span> to
      Components. We'll call it the <span class="codefrag">SecurityManageable</span> interface.
     </p>
  
    
  <div class="h4">
  <h4>Define the component extension interface</h4>
  </div>
  
     
  <p>
      First we define the new Component extension interface.
     </p>
  
     
  <pre class="code">
     /**
      * Simple custom lifecycle extension interface for supplying a component
      * with a security manager.
      */
     public interface SecurityManageable
     {
         /**
          * Pass a SecurityManager object to the component
          *
          * @param manager a SecurityManager value
          */
         void secure( SecurityManager manager )
             throws SecurityException;
     }
     </pre>
  
    
  
    
  <div class="h4">
  <h4>Create the lifecycle extensions class</h4>
  </div>
  
     
  <p>
      Next we define the actual extension implementation which invokes the <span class="codefrag">secure()</span>
      method. We extend from <span class="codefrag">AbstractAccessor</span> since we only want
      <span class="codefrag">secure()</span> to be invoked upon each access (ie. lookup()) to the component, and
      don't need to implement the other 3 LifecycleExtension methods (create, release, and
      destroy).
     </p>
  
     
  <pre class="code">
     /**
      * Some custom extensions for this container's components.
      */
     public class Extensions
         extends AbstractAccessor
     {
         /**
          * Access, called when the given component is being
          * accessed (ie. via lookup() or select()).
          *
          * @param component a Component instance
          * @param context a Context instance
          * @exception Exception if an error occurs
          */
         public void access( Object component, Context context )
             throws Exception
         {
             if ( component instanceof SecurityManageable )
             {
                 // pass in a simple security manager, a real system might want to pass
                 // in specialized/custom security managers
                 ( ( SecurityManageable ) component ).secure( new SecurityManager() );
             }
         }
     }
     </pre>
  
      
  <div class="frame note">
  <div class="label">Note</div>
  <div class="content">An extension class may run components through any given number of
      extensions, and are not limited to just one.</div>
  </div>
  
    
  
    
  <div class="h4">
  <h4>Register the lifecycle extensions class</h4>
  </div>
  
     
  <p>
      We then inform our container about the extension. This could be done in several different
      ways, for simplicity we'll extend <span class="codefrag">initialize()</span> and add it to the
      <span class="codefrag">LifecycleExtensionManager</span> there.
     </p>
  
     
  <p>
      (an alternative might be to initialize a LifecycleExtensionManager before creating the
      container and pass it in via the <span class="codefrag">FortressConfig.setExtensionManager()</span> method,
      or to create a LifecycleExtensionManager subclass that includes the extension preset)
     </p>
  
     
  <pre class="code">
     /**
      * Simple container that includes custom lifecycle extensions.
      */
     public final class ExtendedContainer
         extends DefaultContainer
     {
         public void initialize()
             throws Exception
         {
             super.initialize();
  
             m_extManager.addExtension( new Extensions() );
         }
     }
     </pre>
  
    
  
    
  <div class="h4">
  <h4>Use the new component interface</h4>
  </div>
  
     
  <p>
      To use the new SecurityManageable lifecycle extension, we simply implement
      SecurityManageable just as we do with any other Avalon lifecycle interfaces
      (assuming a predefined Component interface <span class="codefrag">ExtendedComponent</span>).
     </p>
  
     
  <pre class="code">
     /**
      * ExtendedComponentImpl, demonstrating the use of a custom
      * lifecycle stage SecurityManageable. This code does
      * a simple access check for several files on the file system and logs
      * the results accordingly.
      */
     public class ExtendedComponentImpl
         extends AbstractLogEnabled
         implements ExtendedComponent, SecurityManageable
     {
         /**
          * Pass a SecurityManager object to the component
          *
          * @param manager a SecurityManager value
          */
         public void secure( final SecurityManager manager )
             throws SecurityException
         {
             getLogger().info( "Received SecurityManager instance: " + manager );
  
             final String[] files = { "/tmp", "/vmlinuz", "/usr/lib/libc.a" };
  
             for ( int i = 0; i &lt; files.length; ++i )
             {
                 try
                 {
                     manager.checkRead( files[ i ] );
                     getLogger().info( "Thread can read " + files[ i ] );
                 }
                 catch ( SecurityException e )
                 {
                     getLogger().info( "Thread can not read " + files[ i ] );
                 }
             }
         }
     }
     </pre>
    
  
    
  
    
    
  
  <div id="authors" align="right">by&nbsp;Avalon Development Team</div>
  </div>
  </div>
  </div>
  </td>
  <!--================= end Content ==================-->
  </tr>
  </tbody>
  </table>
  <!--================= end Main ==================-->
  <!--================= start Footer ==================-->
  <div id="footer">
  <table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0">
  <tbody>
  <tr>
  <!--================= start Copyright ==================-->
  <td colspan="2">
  <div align="center">
  <div class="copyright">
                Copyright &copy; 2003&nbsp;The Apache Software Foundation.. All rights reserved.
              </div>
  </div>
  </td>
  <!--================= end Copyright ==================-->
  </tr>
  <tr>
  <td align="left">
  <!--================= start Host ==================-->
  <!--================= end Host ==================--></td><td align="right">
  <!--================= start Credits ==================-->
  <div align="right">
  <div class="credit"></div>
  </div>
  <!--================= end Credits ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Footer ==================-->
  </body>
  </html>
  
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/index.html
  
  Index: index.html
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  <html>
  <head>
  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <!--*** This is a generated file.  Do not edit.  ***-->
  <link rel="stylesheet" href="skin/tigris.css" type="text/css">
  <link rel="stylesheet" href="skin/mysite.css" type="text/css">
  <link rel="stylesheet" href="skin/site.css" type="text/css">
  <link media="print" rel="stylesheet" href="skin/print.css" type="text/css">
  <title>Lifecycle Extensions</title>
  </head>
  <body bgcolor="white" class="composite">
  <!--================= start Banner ==================-->
  <div id="banner">
  <table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0">
  <tbody>
  <tr>
  <!--================= start Group Logo ==================-->
  <td align="left">
  <div class="groupLogo">
  <a href="http://www.apache.org/"><img border="0" class="logoImage" alt="Apache" src="images/group-logo.gif"></a>
  </div>
  </td>
  <!--================= end Group Logo ==================-->
  <!--================= start Project Logo ==================--><td align="right">
  <div class="projectLogo">
  <a href="http://avalon.apache.org/"><img border="0" class="logoImage" alt="Apache Avalon" src="images/project-logo.gif"></a>
  </div>
  </td>
  <!--================= end Project Logo ==================-->
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Banner ==================-->
  <!--================= start Main ==================-->
  <table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs">
  <tbody>
  <!--================= start Status ==================-->
  <tr class="status">
  <td>
  <!--================= start BreadCrumb ==================--><a href=""></a><a href=""></a><a href=""></a>
  <!--================= end BreadCrumb ==================--></td><td id="tabs">
  <!--================= start Tabs ==================-->
  <div class="tab">
  <span class="unselectedTab"><a href="http://avalon.apache.org/">Avalon Home</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/framework/">Framework</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/components/">Components</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/phoenix/">Phoenix</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/seca/">SECA</a></span>
  </div>
  <!--================= end Tabs ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  <!--================= end Status ==================-->
  <table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0">
  <tbody>
  <tr valign="top">
  <!--================= start Menu ==================-->
  <td id="leftcol">
  <div id="navcolumn">
  <div class="menuBar">
  <div class="menu">
  <span class="menuLabel">About</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/index.html">Excalibur Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/bindownload.cgi">Download</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/compatibility/api/">API Docs</a>
  </div>
  
    
  </div>
  <div class="menu">
  <span class="menuLabel">Lifecycle</span>
      
  <div class="menuItem">
  <span class="menuSelected">Overview</span>
  </div>
      
  <div class="menuItem">
  <a href="extension.html">Extensions</a>
  </div>
      
  <div class="menuItem">
  <a href="interfaces.html">Interfaces</a>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Tutorial</span>
      
  <div class="menuItem">
  <a href="fortress.html">Fortress</a>
  </div>
      
  <div class="menuItem">
  <a href="merlin.html">Merlin</a>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Related Links</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/fortress/">Fortress Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/sandbox/merlin/">Merlin Home</a>
  </div>
    
  </div>
  </div>
  </div>
  </td>
  <!--================= end Menu ==================-->
  <!--================= start Content ==================--><td>
  <div id="bodycol">
  <div class="app">
  <div align="center">
  <h1>Lifecycle Extensions</h1>
  </div>
  <div class="h3">
  
    
  
    
  
      
  <div class="h3">
  <h3>Introduction</h3>
  </div>
  
        
  <p>The Lifecycle package contains a set of interfaces and classes supporting portable lifecycle extensions.</p>
  
        
  <p>Contributions to this project are based on co-development actives by container projects aiming towards cross-container component portability and consistent service management.</p>
  
        
  <p>The first step in the container project has been undertaken between the Fortress and Merlin containers on the subject of lifestyle extension support. The original design and implementation of lifecycle extensions by Marcus Crafter was implemented using the Fortress container.  Subsequently, and alternative implementation based on Marcus' design was introduced using the Merlin container leading to two incompatible solutions aiming at the same objective.  Through a process of cross-project collaboration, the Fortress and Merlin developers reached consensus on a common set of APIs and abstract implementation. These resources constitute the first sub-project of the Excalibur Container package.</p>
  
      
  
    
  
    
  
  
  <div id="authors" align="right">by&nbsp;Avalon Development Team</div>
  </div>
  </div>
  </div>
  </td>
  <!--================= end Content ==================-->
  </tr>
  </tbody>
  </table>
  <!--================= end Main ==================-->
  <!--================= start Footer ==================-->
  <div id="footer">
  <table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0">
  <tbody>
  <tr>
  <!--================= start Copyright ==================-->
  <td colspan="2">
  <div align="center">
  <div class="copyright">
                Copyright &copy; 2003&nbsp;The Apache Software Foundation.. All rights reserved.
              </div>
  </div>
  </td>
  <!--================= end Copyright ==================-->
  </tr>
  <tr>
  <td align="left">
  <!--================= start Host ==================-->
  <!--================= end Host ==================--></td><td align="right">
  <!--================= start Credits ==================-->
  <div align="right">
  <div class="credit"></div>
  </div>
  <!--================= end Credits ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Footer ==================-->
  </body>
  </html>
  
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/interfaces.html
  
  Index: interfaces.html
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  <html>
  <head>
  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <!--*** This is a generated file.  Do not edit.  ***-->
  <link rel="stylesheet" href="skin/tigris.css" type="text/css">
  <link rel="stylesheet" href="skin/mysite.css" type="text/css">
  <link rel="stylesheet" href="skin/site.css" type="text/css">
  <link media="print" rel="stylesheet" href="skin/print.css" type="text/css">
  <title>Extension Interfaces</title>
  </head>
  <body bgcolor="white" class="composite">
  <!--================= start Banner ==================-->
  <div id="banner">
  <table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0">
  <tbody>
  <tr>
  <!--================= start Group Logo ==================-->
  <td align="left">
  <div class="groupLogo">
  <a href="http://www.apache.org/"><img border="0" class="logoImage" alt="Apache" src="images/group-logo.gif"></a>
  </div>
  </td>
  <!--================= end Group Logo ==================-->
  <!--================= start Project Logo ==================--><td align="right">
  <div class="projectLogo">
  <a href="http://avalon.apache.org/"><img border="0" class="logoImage" alt="Apache Avalon" src="images/project-logo.gif"></a>
  </div>
  </td>
  <!--================= end Project Logo ==================-->
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Banner ==================-->
  <!--================= start Main ==================-->
  <table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs">
  <tbody>
  <!--================= start Status ==================-->
  <tr class="status">
  <td>
  <!--================= start BreadCrumb ==================--><a href=""></a><a href=""></a><a href=""></a>
  <!--================= end BreadCrumb ==================--></td><td id="tabs">
  <!--================= start Tabs ==================-->
  <div class="tab">
  <span class="unselectedTab"><a href="http://avalon.apache.org/">Avalon Home</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/framework/">Framework</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/components/">Components</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/phoenix/">Phoenix</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/seca/">SECA</a></span>
  </div>
  <!--================= end Tabs ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  <!--================= end Status ==================-->
  <table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0">
  <tbody>
  <tr valign="top">
  <!--================= start Menu ==================-->
  <td id="leftcol">
  <div id="navcolumn">
  <div class="menuBar">
  <div class="menu">
  <span class="menuLabel">About</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/index.html">Excalibur Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/bindownload.cgi">Download</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/compatibility/api/">API Docs</a>
  </div>
  
    
  </div>
  <div class="menu">
  <span class="menuLabel">Lifecycle</span>
      
  <div class="menuItem">
  <a href="index.html">Overview</a>
  </div>
      
  <div class="menuItem">
  <a href="extension.html">Extensions</a>
  </div>
      
  <div class="menuItem">
  <span class="menuSelected">Interfaces</span>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Tutorial</span>
      
  <div class="menuItem">
  <a href="fortress.html">Fortress</a>
  </div>
      
  <div class="menuItem">
  <a href="merlin.html">Merlin</a>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Related Links</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/fortress/">Fortress Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/sandbox/merlin/">Merlin Home</a>
  </div>
    
  </div>
  </div>
  </div>
  </td>
  <!--================= end Menu ==================-->
  <!--================= start Content ==================--><td>
  <div id="bodycol">
  <div class="app">
  <div align="center">
  <h1>Extension Interfaces</h1>
  </div>
  <div class="h3">
    
    
  
    
  <div class="h3">
  <h3>Lifestyle Extension Interfaces</h3>
  </div>
  
        
  <p>
        A container manages extensions using an extension handler.  Handlers may implement
        the <span class="codefrag">Creator</span> and/or <span class="codefrag">Accessor</span> interfaces.  A creator extension
        will be activated during the create and destroy stages of a component lifecycle.  A
        accessor extension will be activated during the access and release stages.
        </p>
  
        
  <div class="h4">
  <h4>The Creator Interface</h4>
  </div>
  
  
  <p>The <span class="codefrag">Creator</span> interface describes the create and destroy
  stages that occur between a component and a container
  during service management.  Lifecycle extensions supporting create
  and destroy stages must implement this interface.</p>
  
        
  <pre class="code">
   package org.apache.avalon.lifecycle;
  
   import org.apache.avalon.framework.context.Context;
  
   public interface Creator
   {
      /**
       * Create stage handler.
       *
       * @param object the object that is being created
       * @param context the context instance required by the create handler
       *    implementation
       * @exception Exception if an error occurs
       */
      void create( Object object, Context context )
          throws Exception;
  
      /**
       * Destroy stage handler.
       *
       * @param object the object that is being destroyed
       * @param context the context instance required by the handler
       *    implementation
       */
      void destroy( Object object, Context context );
  
   }
       </pre>
        
  
        
  <div class="h4">
  <h4>Accessor Interface</h4>
  </div>
  
  <p>
  The <span class="codefrag">Accessor</span> interface describes the access and release
  stages that occur between a service or component manager and a container
  during service deployment.  Lifecycle extensions supporting access
  and release stages must implement this interface.
  </p>
  
  <pre class="code">
   package org.apache.avalon.lifecycle;
  
   import org.apache.avalon.framework.context.Context;
  
   public interface Accessor
   {
      /**
       * Access stage handler.
       *
       * @param object the object that is being accessed
       * @param context the context instance required by the access handler
       *    implementation
       * @exception Exception if an error occurs
       */
      void access( Object object, Context context )
          throws Exception;
  
      /**
       * Release stage handler.
       *
       * @param object the object that is being released
       * @param context the context instance required by the release handler
       *    implementation
       */
      void release( Object object, Context context );
  
   }
  </pre>
     
    
  
    
    
  
  <div id="authors" align="right">by&nbsp;Avalon Development Team</div>
  </div>
  </div>
  </div>
  </td>
  <!--================= end Content ==================-->
  </tr>
  </tbody>
  </table>
  <!--================= end Main ==================-->
  <!--================= start Footer ==================-->
  <div id="footer">
  <table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0">
  <tbody>
  <tr>
  <!--================= start Copyright ==================-->
  <td colspan="2">
  <div align="center">
  <div class="copyright">
                Copyright &copy; 2003&nbsp;The Apache Software Foundation.. All rights reserved.
              </div>
  </div>
  </td>
  <!--================= end Copyright ==================-->
  </tr>
  <tr>
  <td align="left">
  <!--================= start Host ==================-->
  <!--================= end Host ==================--></td><td align="right">
  <!--================= start Credits ==================-->
  <div align="right">
  <div class="credit"></div>
  </div>
  <!--================= end Credits ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Footer ==================-->
  </body>
  </html>
  
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/merlin.html
  
  Index: merlin.html
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  <html>
  <head>
  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <!--*** This is a generated file.  Do not edit.  ***-->
  <link rel="stylesheet" href="skin/tigris.css" type="text/css">
  <link rel="stylesheet" href="skin/mysite.css" type="text/css">
  <link rel="stylesheet" href="skin/site.css" type="text/css">
  <link media="print" rel="stylesheet" href="skin/print.css" type="text/css">
  <title>Lifecycle Extensions</title>
  </head>
  <body bgcolor="white" class="composite">
  <!--================= start Banner ==================-->
  <div id="banner">
  <table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0">
  <tbody>
  <tr>
  <!--================= start Group Logo ==================-->
  <td align="left">
  <div class="groupLogo">
  <a href="http://www.apache.org/"><img border="0" class="logoImage" alt="Apache" src="images/group-logo.gif"></a>
  </div>
  </td>
  <!--================= end Group Logo ==================-->
  <!--================= start Project Logo ==================--><td align="right">
  <div class="projectLogo">
  <a href="http://avalon.apache.org/"><img border="0" class="logoImage" alt="Apache Avalon" src="images/project-logo.gif"></a>
  </div>
  </td>
  <!--================= end Project Logo ==================-->
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Banner ==================-->
  <!--================= start Main ==================-->
  <table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs">
  <tbody>
  <!--================= start Status ==================-->
  <tr class="status">
  <td>
  <!--================= start BreadCrumb ==================--><a href=""></a><a href=""></a><a href=""></a>
  <!--================= end BreadCrumb ==================--></td><td id="tabs">
  <!--================= start Tabs ==================-->
  <div class="tab">
  <span class="unselectedTab"><a href="http://avalon.apache.org/">Avalon Home</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/framework/">Framework</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/components/">Components</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/phoenix/">Phoenix</a></span> | <span class="unselectedTab"><a href="http://avalon.apache.org/seca/">SECA</a></span>
  </div>
  <!--================= end Tabs ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  <!--================= end Status ==================-->
  <table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0">
  <tbody>
  <tr valign="top">
  <!--================= start Menu ==================-->
  <td id="leftcol">
  <div id="navcolumn">
  <div class="menuBar">
  <div class="menu">
  <span class="menuLabel">About</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/index.html">Excalibur Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/bindownload.cgi">Download</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/compatibility/api/">API Docs</a>
  </div>
  
    
  </div>
  <div class="menu">
  <span class="menuLabel">Lifecycle</span>
      
  <div class="menuItem">
  <a href="index.html">Overview</a>
  </div>
      
  <div class="menuItem">
  <a href="extension.html">Extensions</a>
  </div>
      
  <div class="menuItem">
  <a href="interfaces.html">Interfaces</a>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Tutorial</span>
      
  <div class="menuItem">
  <a href="fortress.html">Fortress</a>
  </div>
      
  <div class="menuItem">
  <span class="menuSelected">Merlin</span>
  </div>
    
  </div>
  <div class="menu">
  <span class="menuLabel">Related Links</span>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/excalibur/fortress/">Fortress Home</a>
  </div>
      
  <div class="menuItem">
  <a href="http://avalon.apache.org/sandbox/merlin/">Merlin Home</a>
  </div>
    
  </div>
  </div>
  </div>
  </td>
  <!--================= end Menu ==================-->
  <!--================= start Content ==================--><td>
  <div id="bodycol">
  <div class="app">
  <div align="center">
  <h1>Lifecycle Extensions</h1>
  </div>
  <div class="h3">
    
    
  
    
  <div class="h3">
  <h3>Example</h3>
  </div>
  
      
  <div class="h4">
  <h4>Create your lifestyle stage interface</h4>
  </div>
  
  
  <p>
  The following interface is your domain specific lifecycle stage interface.  It is the interface that an extension handler will use to interact with your component during deployment and decommissioning.
  </p>
  
        
  <pre class="code">
   public interface Exploitable
   {
      /**
       * Operation invoked by an exploitation manager.
       * @param message a message to be displayed
       */
       void exploit( String message );
   }
        </pre>
  
      
  
      
  <div class="h4">
  <h4>Create the lifestyle extension handler</h4>
  </div>
  
  
  <p>
  An extension handler is the implementation class that will be activated by the Merlin container to handle domain specific tasks during the deployment and decommissioning phases.  The extension can implement etier or both of the Creator and Accessor interfaces depeding on the particular extension requirements.  IN this example we are defining a simple creation stage handler that supplies a message to an instance of Exploitable.
  </p>
        
  <pre class="code">
   public class ExploitationManager implements Creator
   {
      /**
       * Operation invoked by a container to request creation
       * stage extension interception.
       * @param object a component to manager
       * @param context the context
       */
       public void create( Object object, Context context )
       {
           if( object instanceof Exploitable )
           {
               ((Expoitable)object).exploit( "hello" );
           }
       }
  
      /**
       * Operation invoked by a container to request destroy
       * stage extension interception.
       * @param object a component to manager
       * @param context the context
       */
       public void destroy( Object object, Context context )
       {
       }
   }
        </pre>
  
  
  <p>
  To complete the defintion of you extension handler you need to prepare the meta-info that will be used by Merlin to identify the extension and the stage interface is supports.  The following &lt;type/&gt; declaration includes an &lt;extensions/&gt; tag that contains a &lt;reference/&gt; element that includes the reference to the Explitable lifecycle stage interface. This is the key that Merlin uses to associate a handler with a component.  If you extension class requires any specific context values, they should be declared in a context element within the extension element.
  </p>
  
        
  <pre class="code">
  &lt;type&gt;
  
     &lt;info&gt;
        &lt;name&gt;my-extension-handler&lt;/name&gt;
     &lt;/info&gt;
  
     &lt;extensions&gt;
       &lt;extension&gt;
        &lt;name&gt;exploitation&lt;/name&gt;
        &lt;reference type="Exploitable" version="1.0"/&gt;
       &lt;/extension&gt;
     &lt;/extensions&gt;
  
  &lt;/type&gt;
  
        </pre>
  
      
  
      
  <div class="h4">
  <h4>Create a component implementing the stage interface</h4>
  </div>
        
  <pre class="code">
   public class MyComponent extends AbstractLogEnabled implements Exploitable
   {
      /**
       * Operation invoked by an exploitation manager.
       * @param message a message to be displayed
       */
       public void exploit( String message )
       {
           getLogger().info( message );
       }
   }
        </pre>
  
  
  <p>
  To complete the defintion of your component you need to prepare the meta-info that will be used by Merlin to identify the stage interface is requires a handler for.  The following &lt;type/&gt; declaration includes an &lt;stage/&gt; tag that contains a &lt;reference/&gt; element that includes the reference to the Exploitable lifecycle stage interface. This is the key that Merlin uses to associate the component with a handler capable of handling the Exploitable interface.
  </p>
  
        
  <pre class="code">
  &lt;type&gt;
  
     &lt;info&gt;
        &lt;name&gt;my-component&lt;/name&gt;
     &lt;/info&gt;
  
     &lt;stages&gt;
       &lt;stage&gt;
        &lt;name&gt;exploit-me&lt;/name&gt;
        &lt;reference type="Exploitable" version="1.0"/&gt;
       &lt;/stage&gt;
     &lt;/stages&gt;
  
  &lt;/type&gt;
  
        </pre>
      
  
      
  <div class="h4">
  <h4>Register you component and the extension</h4>
  </div>
  
  
  <p>To complete the process you need to declare your handler and component in a jar manifest file.  The following entries show the declaration of the component and the extension handler.</p>
  
        
  <pre class="code">
    Manifest-Version: 1.0
    Created-By: Ant 1.5
  
    Name: MyComponent.class
    Avalon: Type
  
    Name: ExploitationManager.class
    Avalon: Type
        </pre>
  
      
  
      
  <div class="h4">
  <h4>Execute the example</h4>
  </div>
  
  
  <p>To execute the example you simply need to include a reference to you component within a Merlin container declaration.  The following XML source declares a Merlin kernel, container, and component.  You don't need to include the handler because Merlin can sort that out itself based on the information supplied in the meta-info declarations.</p>
  
        
  <pre class="code">
   &lt;kernel&gt;
  
     &lt;container name="my-container&gt;
  
       &lt;classpath&gt;
         &lt;fileset dir="lib"&gt;
           &lt;include name="my-domo.jar"/&gt;
         &lt;/fileset&gt;
       &lt;/classpath&gt;
  
       &lt;component name="demo" class="MyComponent" activation="startup"/&gt;
  
     &lt;container&gt;
  
   &lt;/kernel&gt;
        </pre>
  
      
  
    
  
    
    
  
  <div id="authors" align="right">by&nbsp;Avalon Development Team</div>
  </div>
  </div>
  </div>
  </td>
  <!--================= end Content ==================-->
  </tr>
  </tbody>
  </table>
  <!--================= end Main ==================-->
  <!--================= start Footer ==================-->
  <div id="footer">
  <table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0">
  <tbody>
  <tr>
  <!--================= start Copyright ==================-->
  <td colspan="2">
  <div align="center">
  <div class="copyright">
                Copyright &copy; 2003&nbsp;The Apache Software Foundation.. All rights reserved.
              </div>
  </div>
  </td>
  <!--================= end Copyright ==================-->
  </tr>
  <tr>
  <td align="left">
  <!--================= start Host ==================-->
  <!--================= end Host ==================--></td><td align="right">
  <!--================= start Credits ==================-->
  <div align="right">
  <div class="credit"></div>
  </div>
  <!--================= end Credits ==================-->
  </td>
  </tr>
  </tbody>
  </table>
  </div>
  <!--================= end Footer ==================-->
  </body>
  </html>
  
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/images/group-logo.gif
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/images/project-logo.gif
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/mysite.css
  
  Index: mysite.css
  ===================================================================
  /*
   * Other colors:
   *  - dark blue: #036
   *  - bluish: #269
   *
   */
  
  /*
   * The Banner section.
   */
  .banner, .projectLogo, .groupLogo, .projectLogo a, .groupLogo a,
      .groupLogo a:visited, .projectLogo a:visited,
      .groupLogo a:link, .projectLogo a:link {
  }
  
  /*
   * The Status + Footer section.
   */
  .status, .breadcrumb, .searcher, .tabs {
  }
  
  .selectedTab {
  }
  
  /*
   * The Menu section.
   */
  .menuColumn {
  }
  .menubar {
  }
  .menu {
  }
  .menuLabel {
  }
  .menuItem {
  }
  
  /*
   * The Content section.
   */
  .contentColumn {
  }
  
  h1, h2, h3, h4 {
  }
  
  h3, h4 {
   }
  h3 {
    }
  h4 {  
  }
  
  .code {
  }
  
  .section {
  }
  
  .subsection {
  }
  
  /*
   * The Footer section.
   */
  .footer, .copyright, .host, .credit {
  }
  
  /*
   * General Settings
   */
  body {
  }
  
  a:link, .menuItem a:visited, .status a:visited {
   color: #036;
  }
  
  a:active, a:hover {
  
  }
  
  body, th, td {
  }
  
  .logoImage {
  }
  
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/print.css
  
  Index: print.css
  ===================================================================
  #banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks	{
  	display: none;
  	}
  body.docs div.docs	{
  	margin: 0 !important;
  	border: none !important
  	}
  
  /* just to be sure */
  #navcolumn {
   width: 0px;
  }
  
  #leftcol {
   width: 0px;
  }
  
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/site.css
  
  Index: site.css
  ===================================================================
  div#banner {
   border-top: 1px solid #fff;
   border-bottom: 1px solid #aaa;
  }
  
  #banner, #banner td {
   background: #fff;
   color: #036;
  }
  
  #tabs {
    text-align: right;
  }
  
  .selectedTab {
    color: #036;	
  }
  
   a.unselectedTab {
    color: #888888;	
  }
  
  #source {
   background-color: #fff;
   color: #000;
   border-right: 1px solid #888;
   border-left: 1px solid #888;
   border-top: 1px solid #888;
   border-bottom: 1px solid #888;
   margin-right: 7px;
   margin-left: 7px;
   margin-top: 1em;
  }
  
  #source pre {
   margin-right: 7px;
   margin-left: 7px;
  }
  
  /* make the whole column grey */
  #navcolumn {
   width: 150px;
   }
  
  #leftcol {
   width: 150px;
  }
  
  /*
   * The Menu section.
   */
  .menuColumn {
  }
  
  .menu {
    padding-bottom: .2em;
    font-size: x-small;
    text-decoration: none;
  }
  .menuLabel { font-weight: bold; }
  .menuItem {
    padding-left: 12px;
    text-decoration: none;
  }
  
  /* breadcrumbs */
  #breadcrumbs
  {
  	font-weight: bold;
  }
  .breadcrumbTrail
  {
  	padding-left: 5px;
  }
  .breadcrumb
  {
  	font-weight: bold;
  }
  .crumbSeparator
  {
  }
  
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/tigris.css
  
  Index: tigris.css
  ===================================================================
  /* contains rules unsuitable for Netscape 4.x; simpler rules are in ns4_only.css. see <http://style.tigris.org/> */
  
  /* colors, backgrounds, borders, link indication */ 
  
  body {
   background: #fff;
   color: #000;
   }
  .app h3, .app h4, .app th, .tabs td, .tabs th, .functnbar {
   background-image: url(images/nw_maj_rond.gif);
   background-repeat: no-repeat;
   }
  #navcolumn div div, body.docs #toc li li  {
   background-image: url(images/strich.gif);
   background-repeat: no-repeat;
   background-position: .5em .5em;
   }
  #navcolumn div div.heading  {
   background-image: none;
   }
  .app h3, .app h4 {
   color: #fff;
   }
  .app h3 {
   background-color: #036;
   }
  .app h4 {
   background-color: #888;
   }
  .a td {
   background: #ddd;
   }
  .b td {
   background: #efefef;
   }
  table, th, td {
   border: none
   }
  .mtb {
   border-top: solid 1px #ddd;
   }
  div.colbar {
   background: #bbb;
   }
  div#banner {
   border-top: 1px solid #369;
   border-bottom: 1px solid #003;
   }
  div#helptext th {
   border-bottom: 1px solid #996;
   border-right: 1px solid #996;
   }
  div#helptext td {
   border-bottom: 1px solid #cc9;
   border-right: 1px solid #cc9;
   }
  .tabs { 
   border-bottom: .75em #888 solid;
   }
  .tabs th, .tabs td {
   border-right: 1px solid #333;
   }
  .tabs td {
   border-bottom: 1px solid #ddd;
   }
  #navcolumn {
   background: #eee;
   border-right: 1px solid #aaa;
   border-bottom: 1px solid #aaa;
   }
  #breadcrumbs {
   border-bottom: 1px solid #aaa;
   background-color: #ddd;
   }
  #navcolumn, #breadcrumbs {
   border-top: 1px solid #fff;
   }
  #rightcol div.www, #rightcol div.help {
   border: 1px solid #ddd;
   }
  div#navcolumn div.focus {
   border-top: 1px solid #aaa;
   border-left: 1px solid #aaa;
   background-color: #fff;
   } 
  body.docs div.docs { 
   background: #fff;
   border-left: 1px solid #ddd;
   border-top: 1px solid #ddd;
   }
  body.docs { 
   background: #eee url(images/help_logo.gif) top right no-repeat !important;
   }
  .docs h3, .docs h4 {
   border-top: solid 1px #000;
   }
  #alerterrormessage { 
   background: url(images/icon_alert.gif) top left no-repeat !important;
   }
  .functnbar {
   background-color: #aaa;
   }
  .functnbar2, .functnbar3  {
   background: #aaa;
   }
  .functnbar3 {
   background-color: #ddd;
   }
  .functnbar, .functnbar2, .functnbar3 {
   color: #000;
   }
  .functnbar a, .functnbar2 a, .functnbar3 a {
   color: #000;
   text-decoration: underline;
   }
  #topmodule {
   background: #ddd;
   border-top: 1px solid #fff;
   border-bottom: 1px solid #aaa; 
   border-right: 1px solid #aaa; 
   }
  #topmodule #issueid {
   border-right: 1px solid #aaa;
   }
  a:link, #navcolumn a:visited, .app a:visited, .tasknav a:visited {
   color: blue;
   }
  a:active, a:hover, #leftcol a:active, #leftcol a:hover {
   color: #f30 !important;
   }
  #login a:link, #login a:visited {
   color: white; 
   text-decoration: underline;
   }
  #banner a:active, #banner a:hover {
   color: #f90 !important;
   }
  #leftcol a, #breadcrumbs a  {
   text-decoration: none;
   }
  a:link.selfref, a:visited.selfref {
   color: #555 !important;
   text-decoration: none;
   }
  h2 .lastchild {
   color: #777
   } 
  .tabs td, .tabs th {
   background-color: #ddd;
   }
  .app th {
   background-color: #bbb;
   }
  .tabs th {
   background-color: #888;
   color: #fff;
   }
  .axial th {
   background-color: #ddd;
   color: black
   }
  .tabs td {
   background-color: #ddd;
   }
  .alert { 
   color: #c00;
   }
  .confirm {
   color: green;
   }
  .info {
   color: blue;
   }
  .selection {
   background: #ffc;
   }
  #login {
   color: #fff;
   }
  #helptext th {
   background: #cc9;
   }
  #helptext td {
   background: #ffc;
   }
  .tabs a  {
   text-decoration: none;
   }
  #navcolumn div strong {
   color: #000;
   }
  #banner, #banner td { 
   background: #036;
   color: #fff;
   }
  body #banner #login a { 
   color: #fff;
   }
  
  
  /* font and text properties, exclusive of link indication, alignment, text-indent */
  
  body, th, td, input, select, textarea, h2 small {
   font-family: Verdana, Helvetica, Arial, sans-serif;
   }
  code, pre {
   font-family: 'Andale Mono', Courier, monospace;
   }
  html body, body th, body td, textarea, h2 small, .app h3, .app h4, #rightcol h3, #bodycol pre, #bodycol code {
   font-size: x-small;
   voice-family: "\"}\"";
   voice-family: inherit;
   font-size: small
   }
  html>body, html>body th, html>body td, html>body input, html>body select, html>body textarea, html>body h2 small, html>body .app h3, html>body .app h4, html>body #rightcol h3, html>body #bodycol pre, html>body #bodycol code {
   font-size: small
   }
  small, div#footer td, div#login, div.tabs th, div.tabs td, input, select, .paginate, .functnbar, .functnbar2, .functnbar3, #breadcrumbs td, .courtesylinks, #rightcol div.help, .colbar, .tasknav, body.docs div#toc, #leftcol {
   font-size: x-small;
   voice-family: "\"}\"";
   voice-family: inherit;
   font-size: x-small
   }
  html>body small, html>body div#footer td, html>body div#login, html>body div#helptext td, html>body div#helptext th, html>body div.tabs th, html>body div.tabs td, html>body input, html>body select, html>body .paginate, html>body .functnbar, html>body .functnbar2, html>body .functnbar3, html>body #breadcrumbs td, html>body .courtesylinks, html>body #rightcol div.help, html>body .colbar, html>body .tasknav, html>body.docs #toc {
   font-size: x-small
   }
  #bodycol h2 {
   font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif;
   font-size: 1.5em;
   font-weight: normal;
   }
  h2 small {
   font-weight: bold;
   letter-spacing: .06em;
   }
  dt {
   font-weight: bold
   }
  #login .username {
   font-weight: bold;
   }
  h4 {
   font-size: 1em;
   }
  #breadcrumbs td {
   font-weight: bold;
   } 
  .selection {
   font-weight: bold
   }
  
  
  /* box properties (exclusive of borders), positioning, alignments, list types, text-indent */
  
  #bodycol h2 {
   margin-top: .3em;
   margin-bottom: .5em;
   }
  p, ul, ol, dl {
   margin-top: .67em;
   margin-bottom: .67em;
   }
  h3, h4 {
   margin-bottom: 0;
   }
  form {
   margin-top: 0;
   margin-bottom: 0;
   }
  #bodycol {
   padding-left: 12px;
   padding-right: 12px;
   width: 100%;
   voice-family: "\"}\"";
   voice-family: inherit;
   width: auto;
   }
  html>body #bodycol {
   width: auto;
   }
  .docs {
   line-height: 1.4;
   }
  .app h3, .app h4 {
   padding: 5px;
   margin-right: 2px;
   margin-left: 2px;
   }
  .h3 p, .h4 p, .h3 dt, .h4 dt {
   margin-right: 7px;
   margin-left: 7px;
   }
  .tasknav {
   margin-bottom: 1.33em
   }
  div.colbar {
   padding: 4px;
   margin: 2px 2px 0;
   }
  .tabs { 
   margin-top: .67em;
   margin-right: 2px;
   margin-left: 2px;
   }
  #leftcol {
   padding-bottom: .5em;
   }
  #breadcrumbs td {
   vertical-align: middle;
   padding: 2px 8px;
   } 
  #rightcol div.www, #rightcol div.help {
   padding: 0 .5em
   }
  #navcolumn {
   margin: -8px -8px 0 -8px;
   padding: 4px;
   }
  #navcolumn div {
   padding-left: 5px
   }
  div#navcolumn div div {
   margin-top: .3em;
   margin-bottom: .3em;
   }
  div#navcolumn div.focus { 
   margin-top: -.1em;
   padding: .2em 4px; 
   } 
  body.docs #toc { 
   position: absolute;
   top: 15px;
   left: 0px;
   width: 120px;
   padding: 0 20px 0 0
   }
  body.docs #toc ul, #toc ol {
   margin-left: 0;
   padding-left: 0;
   }
  body.docs #toc li {
   margin-top: 7px;
   padding-left: 10px;
   list-style-type: none;
   }
  body.docs div.docs { 
   margin: 61px 0 0 150px;
   padding: 1em 2em 1em 1em !important;
   }
  .docs p+p {
   text-indent: 5%;
   margin-top: -.67em
   }
  .docs h3, .docs h4 {
   margin-bottom: .1em;
   padding-top: .3em;
   }
  #alerterrormessage { 
   padding-left: 100px;
   }
  .functnbar, .functnbar2, .functnbar3 {
   padding: 5px;
   margin: .67em 2px;
   }
  #topmodule td {
   vertical-align: middle;
   padding: 2px 8px
   } 
  body {
   padding: 1em;
   }
  body.composite, body.docs {
   margin: 0;
   padding: 0;
   }
  th, td {
   text-align: left;
   vertical-align: top 
   }
  .right {
   text-align: right !important;
   }
  .center {
   text-align: center !important;
   }
  .tabs td, .tabs th {
   padding-left: 7px;
   padding-right: 7px;
   }
  .axial th {
   text-align: right;
   }
  .app .axial td th {
   text-align: left;
   }
  body td .stb {
   margin-top: 1em;
   text-indent: 0;
   }
  body td .mtb {
   margin-top: 2em;
   text-indent: 0;
   }
  dd {
   margin-bottom: .67em;
   }
  #footer {
   margin: 4px
   }
  #helptext {
   margin-top: 1em
   }
  #helptext td div {
   margin: .5em
   }
  .courtesylinks {
   margin-top: 1em;
   padding-top: 1em
   }
  #navcolumn div {
   margin-bottom: .5em;
   }
  #navcolumn div div {
   margin-top: .3em
   }
  #navcolumn div div {
   padding-left: 1em;
   }
  #banner, #banner td { 
   vertical-align: middle;
   }
  body.docs, body.nonav {
   margin: 1em
   }
  
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/add.jpg
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/favicon.ico
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/note.gif
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/nw_maj_rond.gif
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/nw_min.gif
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/pdfdoc.gif
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/remove.jpg
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/strich.gif
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/update.jpg
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/valid-html401.png
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/vcss.png
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/void.gif
  
  	<<Binary file>>
  
  
  1.1                  avalon-site/site/excalibur/lifecycle/skin/images/xmldoc.gif
  
  	<<Binary file>>
  
  

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