You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/08/12 03:56:37 UTC
cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container StructuralExtension.xinfo StructuralExtension.java Structural.java
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>