On Fri, 29 Nov 2002 08:28, Paul Hammant wrote: > Peter, > > > This is a collection of all the previous patches to info/containerkit > > patches. After this is applied I am almost ready to start auto-assembly > > :) > > Applied. Deliberate mistake overcome (you meant cd to excalibur).
Looks like you forget to cvs add all the files prior to commit. Heres the files you missed plus another small patch that renames "role" to key" in output messages. So add all these files to cvs and should be good. -- Cheers, Peter Donald *------------------------------------------------------* | "Religion is what the common people see as true, the | | wise people see as false, and the rulers see as | | useful" --Seneca | *------------------------------------------------------*
/* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.avalon.framework.tools.infobuilder; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import org.apache.avalon.framework.info.ComponentInfo; import org.apache.avalon.framework.info.DependencyDescriptor; import org.apache.avalon.framework.info.FeatureDescriptor; import org.apache.avalon.framework.info.SchemaDescriptor; import org.apache.avalon.framework.info.ServiceDescriptor; /** * Write {@link ComponentInfo} objects to a stream as xml * documents in legacy BlockInfo format. * * @author <a href="mailto:peter at apache.org">Peter Donald</a> * @version $Revision: 1.8 $ $Date: 2002/11/24 12:15:26 $ */ public class LegacyBlockInfoWriter implements InfoWriter { /** * Write out info representation to xml. * * @param info the info object * @param outputStream the stream to write to * @throws IOException if unable to write xml */ public void writeComponentInfo( final ComponentInfo info, final OutputStream outputStream ) throws Exception { final Writer writer = new OutputStreamWriter( outputStream ); writeHeader( writer ); writeDoctype( writer ); writer.write( "<blockinfo>" ); writeBlock( writer, info ); writeServices( writer, info.getServices() ); writeMxServices( writer, info.getServices() ); writeDependencies( writer, info.getDependencies() ); writer.write( "</blockinfo>" ); writer.flush(); } private void writeHeader( final Writer writer ) throws IOException { writer.write( "<?xml version=\"1.0\" ?>" ); } /** * Write out DOCType delcaration. * * @param writer the writer * @throws IOException if unable to write xml */ private void writeDoctype( final Writer writer ) throws IOException { final String doctype = "<!DOCTYPE blockinfo " + "PUBLIC \"-//PHOENIX/Block Info DTD Version 1.0//EN\" " + "\"http://jakarta.apache.org/avalon/dtds/phoenix/blockinfo_1_0.dtd\">"; writer.write( doctype ); } /** * Write out xml representation of a component. * * @param writer the writer * @param info the component info * @throws IOException if unable to write xml */ private void writeBlock( final Writer writer, final ComponentInfo info ) throws IOException { writer.write( "<block>\n" ); writer.write( " <version>1.0</version>" ); final SchemaDescriptor schema = info.getConfigurationSchema(); if( null != schema ) { final String output = " <schema-type>" + schema.getType() + "</schema-type>"; writer.write( output ); } writer.write( "</block>" ); } /** * Write out xml representation of a set of services. * * @param writer the writer * @param services the services * @throws IOException if unable to write xml */ private void writeServices( final Writer writer, final ServiceDescriptor[] services ) throws IOException { if( 0 == services.length ) { return; } writer.write( "<services>" ); for( int i = 0; i < services.length; i++ ) { final ServiceDescriptor service = services[ i ]; if( !LegacyUtil.isMxService( service ) ) { writeService( writer, service.getType(), service ); } } writer.write( "</services>" ); } /** * Write out xml representation of a set of services. * * @param writer the writer * @param services the services * @throws IOException if unable to write xml */ private void writeMxServices( final Writer writer, final ServiceDescriptor[] services ) throws IOException { if( 0 == services.length ) { return; } writer.write( "<management-access-points>" ); for( int i = 0; i < services.length; i++ ) { final ServiceDescriptor service = services[ i ]; if( LegacyUtil.isMxService( service ) ) { writeService( writer, service.getType(), service ); } } writer.write( "</management-access-points>" ); } /** * Write out xml representation of a set of dependencies. * * @param writer the writer * @param dependencies the dependencies * @throws IOException if unable to write xml */ private void writeDependencies( final Writer writer, final DependencyDescriptor[] dependencies ) throws IOException { if( 0 == dependencies.length ) { return; } writer.write( "<dependencies>" ); for( int i = 0; i < dependencies.length; i++ ) { final DependencyDescriptor dependency = dependencies[ i ]; if( dependency.isOptional() ) { continue; } writer.write( "<dependency>" ); final String key = dependency.getKey(); final String type = dependency.getType(); if( !key.equals( type ) ) { writer.write( "<role>" ); writer.write( key ); writer.write( "</role>" ); } writeService( writer, type, dependency ); writer.write( "</dependency>" ); } writer.write( "</dependencies>" ); } /** * Write out xml representation of a service. * * @param writer the writer * @param type the type of the service * @param feature the feature describing service * @throws IOException if unable to write xml */ private void writeService( final Writer writer, final String type, final FeatureDescriptor feature ) throws IOException { writer.write( "<service name=\"" ); writer.write( type ); final String version = LegacyUtil.getVersionString( feature ); if( null != version ) { writer.write( "\" version=\"" ); writer.write( version ); } writer.write( "\"/>" ); } }
/* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.avalon.framework.tools.infobuilder; import org.apache.avalon.framework.info.Attribute; import org.apache.avalon.framework.info.ContextDescriptor; import org.apache.avalon.framework.info.EntryDescriptor; import org.apache.avalon.framework.info.FeatureDescriptor; import org.apache.avalon.framework.info.ServiceDescriptor; import org.apache.avalon.framework.info.ComponentInfo; import org.apache.avalon.framework.info.LoggerDescriptor; import org.apache.avalon.framework.info.DependencyDescriptor; import org.apache.avalon.framework.info.ComponentDescriptor; import org.apache.avalon.framework.Version; import java.util.Properties; /** * This is a set of constants and utility methods * to enablesupport of Legacy BlockInfo files. * * @author <a href="mailto:peter at apache.org">Peter Donald</a> * @version $Revision:$ $Date:$ */ public class LegacyUtil { public static final String MX_ATTRIBUTE_NAME = "phoenix:mx"; public static final Attribute MX_ATTRIBUTE = new Attribute( MX_ATTRIBUTE_NAME, null ); public static final String VERSION_ATTRIBUTE_NAME = "phoenix:version"; public static final String VERSION_ATTRIBUTE_PARAMETER = "version"; public static final ContextDescriptor CONTEXT_DESCRIPTOR = new ContextDescriptor( "org.apache.avalon.phoenix.BlockContext", EntryDescriptor.EMPTY_SET, Attribute.EMPTY_SET ); private LegacyUtil() { } /** * Return the version specified (if any) for feature. * * @param type the type * @return the translated schema type */ public static String translateToSchemaUri( final String type ) { if( type.equals( "relax-ng" ) ) { return "http://relaxng.org/ns/structure/1.0"; } else { return type; } } /** * Return the version specified (if any) for feature. * * @param feature the feature * @return the version string */ public static String getVersionString( final FeatureDescriptor feature ) { final Attribute tag = feature.getAttribute( "avalon" ); if( null != tag ) { return tag.getParameter( "version" ); } return null; } public static Attribute createVersionAttribute( final String version ) { final Properties parameters = new Properties(); parameters.setProperty( VERSION_ATTRIBUTE_PARAMETER, version ); return new Attribute( VERSION_ATTRIBUTE_NAME, parameters ); } /** * Return true if specified service is a management service. * * @param service the service * @return true if specified service is a management service, false otherwise. */ public static boolean isMxService( final ServiceDescriptor service ) { final Attribute tag = service.getAttribute( MX_ATTRIBUTE_NAME ); return null != tag; } /** * Create a version for a feature. Defaults to 1.0 if not specified. * * @param feature the feature * @return the Version object */ public static Version toVersion( final FeatureDescriptor feature ) { final String version = getVersionString( feature ); if( null == version ) { return new Version( 1, 0, 0 ); } else { return Version.getVersion( version ); } } /** * Create a {@link ComponentInfo} for a Listener with specified classname. * * @param implementationKey the classname of listener * @return the ComponentInfo for listener */ public static ComponentInfo createListenerInfo( final String implementationKey ) { final ComponentDescriptor descriptor = new ComponentDescriptor( implementationKey, Attribute.EMPTY_SET ); return new ComponentInfo( descriptor, ServiceDescriptor.EMPTY_SET, LoggerDescriptor.EMPTY_SET, ContextDescriptor.EMPTY_CONTEXT, DependencyDescriptor.EMPTY_SET, null, null ); } }
/* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.excalibur.containerkit.registry; import org.apache.excalibur.containerkit.metadata.PartitionMetaData; /** * The PartitionProfile contains the set of data required * to construct a specific instance of a Profile. It contains * a set of child PartitionProfile and {@link ComponentProfile} * objects. * * @author <a href="mailto:peter at apache.org">Peter Donald</a> * @version $Revision: 1.13 $ $Date: 2002/08/18 03:34:28 $ */ public class PartitionProfile { /** * Constant for an empty set of partitions. */ public static final PartitionProfile[] EMPTY_SET = new PartitionProfile[ 0 ]; /** * The {@link PartitionMetaData} for this partition. */ private final PartitionMetaData m_metaData; /** * An array of partitions that are contained by this * object. */ private final PartitionProfile[] m_partitions; /** * An array of partitions that are contained by this * object. */ private final ComponentProfile[] m_components; /** * Create a PartitionProfile. * * @param metaData the meta data about this profile * @param partitions the partitions contained by this partition * @param components the components contained by this partition */ public PartitionProfile( final PartitionMetaData metaData, final PartitionProfile[] partitions, final ComponentProfile[] components ) { if( null == metaData ) { throw new NullPointerException( "metaData" ); } if( null == partitions ) { throw new NullPointerException( "partitions" ); } if( null == components ) { throw new NullPointerException( "components" ); } m_metaData = metaData; m_partitions = partitions; m_components = components; } /** * Return the metaData about this profile. * * @return the metaData about this profile. */ public PartitionMetaData getMetaData() { return m_metaData; } /** * Return the set of partitions contained in this partition. * * @return the set of partitions contained in this partition. */ public PartitionProfile[] getPartitions() { return m_partitions; } /** * Return the set of components contained in this partition. * * @return the set of components contained in this partition. */ public ComponentProfile[] getComponents() { return m_components; } /** * Return the partition with specified name. * * @return the partition with specified name. */ public PartitionProfile getPartition( final String name ) { for( int i = 0; i < m_partitions.length; i++ ) { final PartitionProfile partition = m_partitions[ i ]; if( partition.getMetaData().getName().equals( name ) ) { return partition; } } return null; } /** * Return the component with specified name. * * @return the component with specified name. */ public ComponentProfile getComponent( final String name ) { for( int i = 0; i < m_components.length; i++ ) { final ComponentProfile component = m_components[ i ]; if( component.getMetaData().getName().equals( name ) ) { return component; } } return null; } }
/* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.excalibur.containerkit.registry; import java.util.Map; /** * Load metadata for an Assembly from some source. * The source is usually one or more xml config files. * * @author <a href="mailto:peter at apache.org">Peter Donald</a> * @version $Revision: 1.2 $ $Date: 2002/10/02 01:52:19 $ */ public interface ProfileBuilder { /** * Load metadata from a particular source * using specified map of parameters. The content * of the parameters is left unspecified. * * @param parameters the parameters indicating method to load meta data source * @return the set of components in metadata * @throws Exception if unable to load or resolve * meta data for any reason */ PartitionProfile buildProfile( Map parameters ) throws Exception; }
Index: containerkit/src/java/org/apache/excalibur/containerkit/verifier/Resources.properties =================================================================== RCS file: /home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier/Resources.properties,v retrieving revision 1.11 diff -u -r1.11 Resources.properties --- containerkit/src/java/org/apache/excalibur/containerkit/verifier/Resources.properties 14 Sep 2002 06:21:00 -0000 1.11 +++ +containerkit/src/java/org/apache/excalibur/containerkit/verifier/Resources.properties + 30 Nov 2002 00:23:42 -0000 @@ -6,11 +6,11 @@ assembly.nocircular-dependencies.notice=Verifying that there are no circular dependencies between Components. assembly.component-type.notice=Verifying that the specified Components have valid types. assembly.circular-dependency.error=Component named "{0}" has a circular dependency via path: {1}. -assembly.missing-dependency.error=Component "{1}" that satisfies the dependency with role "{0}" of Component "{2}" does not exist. +assembly.missing-dependency.error=Component "{1}" that satisfies the dependency with +key "{0}" of Component "{2}" does not exist. assembly.dependency-missing-service.error=Dependency "{0}" of Block "{2}" does not offer the required service "{1}". assembly.bad-class.error=Unable to load class "{1}" for Component named "{0}". (Reason: {2}). assembly.bad-name.error=The Component name "{0}" is invalid. Valid names contain only letters, digits and the '-' character. assembly.duplicate-name.error=The name "{0}" is used by multiple Components in assembly. -assembly.unknown-dependency.error=Unknown dependency named "{0}" with role "{1}" declared for Component {2}. -assembly.unspecified-dependency.error=Dependency for role "{0}" not specified for the Component named "{1}". +assembly.unknown-dependency.error=Unknown dependency named "{0}" with key "{1}" +declared for Component {2}. +assembly.unspecified-dependency.error=Dependency for key "{0}" not specified for the +Component named "{1}". error=Component named "{0}" of type "{1}" is not Contextualizable but declares Context Entrys.
/* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.excalibur.containerkit.metadata; import org.apache.avalon.framework.info.Attribute; import org.apache.avalon.framework.info.FeatureDescriptor; /** * In each Assembly there may be groups of components that * are activated together and treated as a group. These * components are all "visible" to each other as peers. * The group will have a name and may use resources from * other partitions. Partitions can also be nested one inside * each other. * * @author <a href="mailto:peter at apache.org">Peter Donald</a> * @version $Revision: 1.13 $ $Date: 2002/08/18 03:34:28 $ */ public class PartitionMetaData extends FeatureDescriptor { /** * Constant for an empty set of partitions. */ public static final PartitionMetaData[] EMPTY_SET = new PartitionMetaData[ 0 ]; /** * The name of the partition. This is an * abstract name used during assembly. */ private final String m_name; /** * An array listing the set of other partitions required by * this partition. The required partitions must be initialized * and in ready state prior to this partition starting and this * partition must be shutdown prior */ private final String[] m_depends; /** * AN array of partitions that are contained by this * object. */ private final PartitionMetaData[] m_partitions; /** * AN array of components that are contained by this * object. */ private final ComponentMetaData[] m_components; /** * Create a PartitionMetaData. * * @param name the abstract name of component meta data instance * @param depends the partitions depended upon by this parition * @param partitions the partitions contained by this partition * @param components the components contained by this partition * @param attributes the extra attributes that are used to describe component */ public PartitionMetaData( final String name, final String[] depends, final PartitionMetaData[] partitions, final ComponentMetaData[] components, final Attribute[] attributes ) { super( attributes ); if( null == name ) { throw new NullPointerException( "name" ); } if( null == depends ) { throw new NullPointerException( "depends" ); } if( null == partitions ) { throw new NullPointerException( "partitions" ); } if( null == components ) { throw new NullPointerException( "components" ); } m_name = name; m_depends = depends; m_partitions = partitions; m_components = components; } /** * Return the name of component profile. * * @return the name of the component profile. */ public String getName() { return m_name; } /** * Return the set of prereqs for this partition. * * @return the set of prereqs for this partition. */ public String[] getDepends() { return m_depends; } /** * Return the set of partitions contained in this partition. * * @return the set of partitions contained in this partition. */ public PartitionMetaData[] getPartitions() { return m_partitions; } /** * Return the set of components contained in this partition. * * @return the set of components contained in this partition. */ public ComponentMetaData[] getComponents() { return m_components; } /** * Return the partition with specified name. * * @return the partition with specified name. */ public PartitionMetaData getPartition( final String name ) { for( int i = 0; i < m_partitions.length; i++ ) { final PartitionMetaData partition = m_partitions[ i ]; if( partition.getName().equals( name ) ) { return partition; } } return null; } /** * Return the component with specified name. * * @return the component with specified name. */ public ComponentMetaData getComponent( final String name ) { for( int i = 0; i < m_components.length; i++ ) { final ComponentMetaData component = m_components[ i ]; if( component.getName().equals( name ) ) { return component; } } return null; } }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>