avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container StructuralExtension.xinfo StructuralExtension.java Structural.java
Date Mon, 12 Aug 2002 01:56:37 GMT
mcconnell    2002/08/11 18:56:37

  Added:       assembly/src/java/org/apache/excalibur/merlin/container
                        StructuralExtension.xinfo StructuralExtension.java
                        Structural.java
  Log:
  Lifecycle extensions for a container related to the assembly stage.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/StructuralExtension.xinfo
  
  Index: StructuralExtension.xinfo
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
  Definition of the extension type phase support.
  -->
  
  <facility>
  
    <component>
      <name>structural</name>
    </component>
  
    <extensions>
  
      <extension stage="CREATE">
  
        <name>assemble</name>
        <reference type="org.apache.excalibur.merlin.container.Structural"/>
  
        <!--
        <context>
          <entry key="merlin:container.descriptor" 
            type="org.apache.excalibur.merlin.model.ContainerDescriptor" />
          <entry key="merlin:container.manager"
            type="org.apache.excalibur.merlin.assembly.ContainerManager"/>
          <entry key="merlin:container.configuration"
            type="org.apache.avalon.framework.configuration.Configuration"/>
        </context>
        -->
  
      </extension>
  
    </extensions>
  
  </facility>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/StructuralExtension.java
  
  Index: StructuralExtension.java
  ===================================================================
  
  
  package org.apache.excalibur.merlin.container;
  
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.excalibur.merlin.container.Container;
  import org.apache.excalibur.merlin.container.Structural;
  import org.apache.excalibur.merlin.assembly.TypeException;
  import org.apache.excalibur.merlin.assembly.ContainerManager;
  import org.apache.excalibur.merlin.assembly.resource.Extension;
  import org.apache.excalibur.merlin.assembly.resource.AbstractExtension;
  import org.apache.excalibur.merlin.model.builder.XMLContainerUtil;
  import org.apache.excalibur.merlin.model.ContainerDescriptor;
  import org.apache.excalibur.meta.info.Type;
  import org.apache.excalibur.merlin.model.Profile;
  
  /**
   * Extension that supplorts the assembly of a container structure.
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class StructuralExtension extends AbstractExtension
  {
  
      private XMLContainerUtil m_creator = new XMLContainerUtil();
  
      //=======================================================================
      // Extension
      //=======================================================================
  
      /**
       * Invoked by a container to request the application of the assembly
       * phase on the supplied object.
       *
       * @param int lifecycle stage
       * @param object the object to apply the extension to
       * @param context the context
       * @exception Exception if an error occurs
       */
      public void extend( int stage, Object object, Context context )
          throws Exception
       {
          if( !( object instanceof Structural ) )
            return;
  
          if( !( stage == CREATE ) )
            return;
  
          super.extend( stage, object, context );
  
          ((Structural)object).assemble( );
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/Structural.java
  
  Index: Structural.java
  ===================================================================
  
  
  package org.apache.excalibur.merlin.container;
  
  import org.apache.excalibur.merlin.assembly.AssemblyException;
  
  /**
   * Lifecycle stage interface used to trigger dynamic assembly
   * of service profiles.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public interface Structural
  {
     /**
      * Request the assembly of the container.
      * @exception AssemblyException if an assembly error occurs
      */
      public void assemble( ) throws AssemblyException;
  }
  
  
  

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


Mime
View raw message