mcconnell 2003/07/14 13:14:25
Modified: meta maven.xml project.xml
meta/api/src/java/org/apache/avalon/meta/info
CategoryDescriptor.java
meta/tools/src/java/org/apache/avalon/meta/info/ant
MetaTask.java
meta/tools/src/java/org/apache/avalon/meta/info/builder/tags
AbstractTag.java Tags.java
meta/tools/src/test/org/apache/avalon/meta MetaTestCase.java
meta/tools/src/test/org/apache/avalon/playground
Primary.java PrimaryService.java Secondary.java
SecondaryService.java
Added: meta LICENSE.TXT TODO.TXT
meta/tools/src/java/org/apache/avalon/meta/info/builder/tags
ServiceTag.java TypeTag.java
Removed: meta/tools/src/java/org/apache/avalon/meta/info/builder
TaggedServiceBuilder.java TaggedTypeBuilder.java
meta/tools/src/java/org/apache/avalon/meta/info/builder/tags
LifestyleTag.java NameTag.java VersionTag.java
Log:
Update the tags handlers to follow the avalon pattern including explicit version
attributes and a bunch of other deails. Updates to the test case to reflect changes.
Revision Changes Path
1.3 +0 -1 avalon-sandbox/meta/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/meta/maven.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- maven.xml 11 Jul 2003 04:49:33 -0000 1.2
+++ maven.xml 14 Jul 2003 20:14:22 -0000 1.3
@@ -47,7 +47,6 @@
goals="license,xjavadoc,site"
banner="Building Site:"
ignoreFailures="false" />
- <attainGoal name="do-plugin"/>
</goal>
<goal name="xjavadoc">
1.3 +1 -1 avalon-sandbox/meta/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/meta/project.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- project.xml 10 Jul 2003 23:28:28 -0000 1.2
+++ project.xml 14 Jul 2003 20:14:23 -0000 1.3
@@ -25,7 +25,7 @@
<distributionDirectory></distributionDirectory>
<repository>
- <connection>scm:cvs:pserver:[EMAIL
PROTECTED]:/home/cvspublic:avalon-sandbox/merlin</connection>
+ <connection>scm:cvs:pserver:[EMAIL
PROTECTED]:/home/cvspublic:avalon-sandbox/meta</connection>
<url>http://cvs.apache.org/viewcvs/avalon-sandbox/meta/</url>
</repository>
1.1 avalon-sandbox/meta/LICENSE.TXT
Index: LICENSE.TXT
===================================================================
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1997-2003 The Apache Software Foundation.
All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Apache", "Avalon", "Excalibur", "Fortress", "Phoenix",
"Merlin" and "Apache Software Foundation" must not be used to endorse or
promote products derived from this software without prior written
permission. For written permission, please contact [EMAIL PROTECTED]
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see http://www.apache.org/.
1.1 avalon-sandbox/meta/TODO.TXT
Index: TODO.TXT
===================================================================
1. Update all operation names to reflect the descriptor
notion. I.e.:
m_type.getContext();
would become:
m_type.getContextDescriptor();
2. Context entries are currently ties to the contextualizable
interface but Merlin can handle contexualization using
different interfaces. Need to update the ContextTag so that
we associate a context method name with the context
descriptor that is created (ContextDescriptor already
has basic support for this).
3. Review the possibility of replacing the dependencies
declaration and related tags with a context entry (meaning
that we could select a context object for the interface
we are concerned with -
e.g.:
ContextDescriptor cd1 =
m_type.getContextDescriptor( CONTEXTALIZABLE_CLASSNAME );
ContextDescriptor cd2 =
m_type.getContextDescriptor( SERVICEABLE_CLASSNAME );
1.5 +3 -3
avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/CategoryDescriptor.java
Index: CategoryDescriptor.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/CategoryDescriptor.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CategoryDescriptor.java 12 Jul 2003 13:34:27 -0000 1.4
+++ CategoryDescriptor.java 14 Jul 2003 20:14:24 -0000 1.5
@@ -53,9 +53,9 @@
import java.util.Properties;
/**
- * A descriptor describing the [EMAIL PROTECTED]
org.apache.avalon.framework.logger.Logger}
+ * A descriptor describing an Avalon Logger
* child instances that the component will create using the
- * [EMAIL PROTECTED] org.apache.avalon.framework.logger.Logger#getChildLogger}
+ * <code>org.apache.avalon.framework.logger.Logger#getChildLogger</code>
* method. The name of each category is relative to the component. For
* example, a component with an internal logging category named "data"
* would aquire a logger for that category using the
1.2 +23 -15
avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/ant/MetaTask.java
Index: MetaTask.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/ant/MetaTask.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MetaTask.java 10 Jul 2003 12:10:35 -0000 1.1
+++ MetaTask.java 14 Jul 2003 20:14:24 -0000 1.2
@@ -56,17 +56,18 @@
import org.apache.avalon.meta.info.Service;
import org.apache.avalon.meta.info.Type;
-import org.apache.avalon.meta.info.builder.TaggedServiceBuilder;
-import org.apache.avalon.meta.info.builder.TaggedTypeBuilder;
-import org.apache.avalon.meta.info.builder.tags.VersionTag;
import org.apache.avalon.meta.info.writer.SerializedServiceWriter;
import org.apache.avalon.meta.info.writer.SerializedTypeWriter;
import org.apache.avalon.meta.info.writer.ServiceWriter;
import org.apache.avalon.meta.info.writer.TypeWriter;
import org.apache.avalon.meta.info.writer.XMLServiceWriter;
import org.apache.avalon.meta.info.writer.XMLTypeWriter;
+import org.apache.avalon.meta.info.builder.tags.TypeTag;
+import org.apache.avalon.meta.info.builder.tags.ServiceTag;
+
import org.apache.tools.ant.BuildException;
+
import com.thoughtworks.qdox.ant.AbstractQdoxTask;
import com.thoughtworks.qdox.model.JavaClass;
@@ -272,13 +273,14 @@
for( int i = 0; i < size; i++ )
{
final JavaClass javaClass = (JavaClass)allClasses.get( i );
- if( new VersionTag( javaClass ).getVersion( false ) == null )
- {
- continue;
- }
-
if( javaClass.isInterface() )
{
+ Service service = new ServiceTag( javaClass ).getService();
+ if( service == null )
+ {
+ continue;
+ }
+
services++;
//
@@ -286,8 +288,8 @@
// a service descriptor
//
- final TaggedServiceBuilder builder = new TaggedServiceBuilder();
- Service info = builder.buildService( javaClass );
+ //final TaggedServiceBuilder builder = new TaggedServiceBuilder();
+ //Service info = builder.buildService( javaClass );
final String classname = javaClass.getFullyQualifiedName();
final File source = javaClass.getParentSource().getFile();
final File dest = getOutputFileForService( classname );
@@ -310,10 +312,16 @@
throw new BuildException( message );
}
}
- writeService( info );
+ writeService( service );
}
else
{
+ Type type = new TypeTag( javaClass ).getType();
+ if( type == null )
+ {
+ continue;
+ }
+
types++;
//
@@ -321,8 +329,8 @@
// a type descriptor
//
- final TaggedTypeBuilder infoBuilder = new TaggedTypeBuilder();
- Type info = infoBuilder.buildType( javaClass );
+ //final TaggedTypeBuilder infoBuilder = new TaggedTypeBuilder();
+ //Type info = infoBuilder.buildType( javaClass );
final String classname = javaClass.getFullyQualifiedName();
final File source = javaClass.getParentSource().getFile();
final File dest = getOutputFileForClass( classname );
@@ -345,7 +353,7 @@
throw new BuildException( message );
}
}
- writeType( info );
+ writeType( type );
}
}
return new Counter( size, services, types );
1.2 +2 -20
avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/AbstractTag.java
Index: AbstractTag.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/AbstractTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractTag.java 10 Jul 2003 12:10:38 -0000 1.1
+++ AbstractTag.java 14 Jul 2003 20:14:24 -0000 1.2
@@ -109,25 +109,7 @@
*/
public String getNS() throws IllegalArgumentException
{
- final DocletTag ns = getJavaClass().getTagByName( Tags.NAMESPACE_TAG );
- if( null != ns )
- {
- String value = ns.getValue();
- if( value != null )
- {
- return value;
- }
- else
- {
- final String error =
- "Tag " + Tags.NAMESPACE_TAG + " must contain a value.";
- throw new IllegalArgumentException( error );
- }
- }
- else
- {
- return Tags.NAMESPACE;
- }
+ return Tags.NAMESPACE;
}
/**
1.2 +2 -2
avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/Tags.java
Index: Tags.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/Tags.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Tags.java 10 Jul 2003 12:10:41 -0000 1.1
+++ Tags.java 14 Jul 2003 20:14:24 -0000 1.2
@@ -60,7 +60,7 @@
/**
* The defalt namespace for tags related to the meta package.
*/
- public static final String NAMESPACE = "avalon.meta";
+ public static final String NAMESPACE = "avalon";
/**
* The delimiter between namespace and tag key.
1.1
avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/ServiceTag.java
Index: ServiceTag.java
===================================================================
/*
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
"Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact [EMAIL PROTECTED]
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see <http://www.apache.org/>.
*/
package org.apache.avalon.meta.info.builder.tags;
import java.util.Properties;
import org.apache.avalon.framework.Version;
import org.apache.avalon.meta.info.ReferenceDescriptor;
import org.apache.avalon.meta.info.Service;
import com.thoughtworks.qdox.model.DocletTag;
import com.thoughtworks.qdox.model.JavaClass;
/**
* A doclet tag the declares a service definition.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Avalon Development Team</a>
* @version $Revision: 1.1 $ $Date: 2003/07/14 20:14:24 $
*/
public class ServiceTag extends AbstractTag
{
/**
* Javadoc tag key for the name tag.
*/
public static final String KEY = "service";
/**
* The version parameter
*/
public static final String VERSION_PARAM = "version";
/**
* Type tag constructor.
* @param clazz the javadoc class descriptor
*/
public ServiceTag( final JavaClass clazz )
{
super( clazz );
}
/**
* Return the value of the Avalon 'service' tag.
* @return the service descriptor or null if no service is declared
*/
public Service getService()
{
final DocletTag tag = getJavaClass().getTagByName( getNS() + Tags.DELIMITER
+ KEY );
if( null == tag )
{
return null;
}
final Version version = Version.getVersion( getNamedParameter( tag,
VERSION_PARAM, "" ) );
final String type = getJavaClass().getFullyQualifiedName();
final Properties properties = new AttributeTag( getJavaClass()
).getProperties();
final ReferenceDescriptor ref = new ReferenceDescriptor( type, version );
return new Service( ref, properties );
}
}
1.1
avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/TypeTag.java
Index: TypeTag.java
===================================================================
/*
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
"Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact [EMAIL PROTECTED]
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see <http://www.apache.org/>.
*/
package org.apache.avalon.meta.info.builder.tags;
import java.util.Properties;
import org.apache.avalon.framework.Version;
import org.apache.avalon.meta.info.ContextDescriptor;
import org.apache.avalon.meta.info.DependencyDescriptor;
import org.apache.avalon.meta.info.ExtensionDescriptor;
import org.apache.avalon.meta.info.InfoDescriptor;
import org.apache.avalon.meta.info.CategoryDescriptor;
import org.apache.avalon.meta.info.ServiceDescriptor;
import org.apache.avalon.meta.info.StageDescriptor;
import org.apache.avalon.meta.info.Type;
import com.thoughtworks.qdox.model.DocletTag;
import com.thoughtworks.qdox.model.JavaClass;
/**
* A doclet tag the declares a component type.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Avalon Development Team</a>
* @version $Revision: 1.1 $ $Date: 2003/07/14 20:14:24 $
*/
public class TypeTag extends AbstractTag
{
/**
* Javadoc tag key for the name tag.
*/
public static final String KEY = "type";
/**
* The name parameter
*/
public static final String NAME_PARAM = "name";
/**
* The version parameter
*/
public static final String VERSION_PARAM = "version";
/**
* The version parameter
*/
public static final String LIFESTYLE_PARAM = "lifestyle";
/**
* Type tag constructor.
* @param clazz the javadoc class descriptor
*/
public TypeTag( final JavaClass clazz )
{
super( clazz );
}
/**
* Return the value of the Avalon 'type' tag.
* @return the name of the component type
* @exception IllegalArgumentException if the name tag does not contain a value
*/
public Type getType()
{
final DocletTag tag = getJavaClass().getTagByName( getNS() + Tags.DELIMITER
+ KEY );
if( null == tag )
{
return null;
}
final String name = getNamedParameter( tag, NAME_PARAM );
final Version version = Version.getVersion( getNamedParameter( tag,
VERSION_PARAM, "" ) );
final String lifestyle = getNamedParameter( tag, LIFESTYLE_PARAM, null );
final String type = getJavaClass().getFullyQualifiedName();
final Properties properties = new AttributeTag( getJavaClass()
).getProperties();
final InfoDescriptor info = new InfoDescriptor( name, type, version,
lifestyle, properties );
final ServiceDescriptor[] services = new ServicesTag( getJavaClass()
).getServices();
final CategoryDescriptor[] loggers = new LoggerTag( getJavaClass()
).getCategories();
final DependencyDescriptor[] dependencies =
new DependencyTag( getJavaClass() ).getDependencies();
final StageDescriptor[] stages = new StageTag( getJavaClass() ).getStages();
final ExtensionDescriptor[] extensions = new ExtensionTag( getJavaClass()
).getExtensions();
final ContextDescriptor context = new ContextTag( getJavaClass()
).getContext();
return new Type( info, loggers, context, services, dependencies, stages,
extensions, null );
}
}
1.5 +14 -24
avalon-sandbox/meta/tools/src/test/org/apache/avalon/meta/MetaTestCase.java
Index: MetaTestCase.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/tools/src/test/org/apache/avalon/meta/MetaTestCase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MetaTestCase.java 11 Jul 2003 04:49:33 -0000 1.4
+++ MetaTestCase.java 14 Jul 2003 20:14:24 -0000 1.5
@@ -19,8 +19,8 @@
import org.apache.avalon.meta.info.DependencyDescriptor;
import org.apache.avalon.meta.info.ServiceDescriptor;
import org.apache.avalon.meta.info.writer.*;
-import org.apache.avalon.meta.info.builder.TaggedTypeBuilder;
-import org.apache.avalon.meta.info.builder.TaggedServiceBuilder;
+import org.apache.avalon.meta.info.builder.tags.TypeTag;
+import org.apache.avalon.meta.info.builder.tags.ServiceTag;
import com.thoughtworks.qdox.model.JavaClass;
import com.thoughtworks.qdox.model.JavaSource;
import com.thoughtworks.qdox.JavaDocBuilder;
@@ -46,16 +46,6 @@
*/
private JavaDocBuilder m_qdox = null;
- /**
- * The type builder that takes a JavaClass as the build argument.
- */
- private TaggedTypeBuilder m_builder = null;
-
- /**
- * The service builder that takes a JavaClass as the build argument.
- */
- private TaggedServiceBuilder m_serviceBuilder = null;
-
private Service m_primaryService;
private Service m_secondaryService;
private Type m_primary;
@@ -83,8 +73,6 @@
protected void setUp() throws Exception
{
m_qdox = new JavaDocBuilder();
- m_builder = new TaggedTypeBuilder();
- m_serviceBuilder = new TaggedServiceBuilder();
buildMeta();
}
@@ -111,7 +99,11 @@
JavaClass c = classes[j];
if( c.isInterface() )
{
- Service service = m_serviceBuilder.buildService( c );
+ Service service = new ServiceTag( c ).getService();
+ if( service == null )
+ {
+ fail( "encounter null service: " + c );
+ }
if( service.getReference().getClassname().equals( PRIMARY_S ) )
{
m_primaryService = service;
@@ -122,15 +114,16 @@
}
else
{
- final String error = "Unexpected (invalid) service
reference: " + service;
- System.out.println( error );
- assertTrue( error, false );
- throw new Exception( error );
+ fail( "Unexpected (invalid) service reference: " + service
);
}
}
else
{
- Type type = m_builder.buildType( c );
+ Type type = new TypeTag( c ).getType();
+ if( type == null )
+ {
+ fail( "encounter null type: " + c );
+ }
if( type.getInfo().getClassname().equals( PRIMARY ) )
{
m_primary = type;
@@ -141,10 +134,7 @@
}
else
{
- final String error = "Unexpected (invalid) type reference:
" + type;
- System.out.println( error );
- assertTrue( error, false );
- throw new Exception( error );
+ fail( "Unexpected (invalid) type reference: " + type );
}
}
}
1.2 +4 -6
avalon-sandbox/meta/tools/src/test/org/apache/avalon/playground/Primary.java
Index: Primary.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/tools/src/test/org/apache/avalon/playground/Primary.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Primary.java 10 Jul 2003 12:10:43 -0000 1.1
+++ Primary.java 14 Jul 2003 20:14:24 -0000 1.2
@@ -11,17 +11,15 @@
* of the namespace compating mechanism.
*
*
- * @avalon.meta.version 1.3
- * @avalon.meta.name primary-component
- * @avalon.meta.lifestyle singleton
- * @avalon.meta.service
- * type="org.apache.avalon.playground.PrimaryService"
+ * @avalon.type name="primary-component" lifestyle="singleton"
+ * version="1.3"
+ * @avalon.service type="org.apache.avalon.playground.PrimaryService"
* version="9.8"
*/
public class Primary implements PrimaryService, Contextualizable
{
/**
- * @avalon.meta.entry key="home" type="java.io.File"
+ * @avalon.entry key="home" type="java.io.File"
*/
public void contextualize( Context context ) throws ContextException
{
1.2 +2 -2
avalon-sandbox/meta/tools/src/test/org/apache/avalon/playground/PrimaryService.java
Index: PrimaryService.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/tools/src/test/org/apache/avalon/playground/PrimaryService.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PrimaryService.java 10 Jul 2003 12:10:43 -0000 1.1
+++ PrimaryService.java 14 Jul 2003 20:14:24 -0000 1.2
@@ -4,8 +4,8 @@
/**
* An interface representing a service.
*
- * @avalon.meta.version 9.8
- * @avalon.meta.attribute key="status" value="test"
+ * @avalon.service version="9.8"
+ * @avalon.attribute key="status" value="test"
*/
public interface PrimaryService
{
1.2 +8 -5
avalon-sandbox/meta/tools/src/test/org/apache/avalon/playground/Secondary.java
Index: Secondary.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/tools/src/test/org/apache/avalon/playground/Secondary.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Secondary.java 10 Jul 2003 12:10:43 -0000 1.1
+++ Secondary.java 14 Jul 2003 20:14:24 -0000 1.2
@@ -8,9 +8,8 @@
import org.apache.avalon.framework.service.ServiceException;
/**
- * @avalon.meta.name secondary-component
- * @avalon.meta.version 2.4
- * @avalon.meta.service type="org.apache.avalon.playground.SecondaryService:0.1"
+ * @avalon.type name="secondary-component" version="2.4"
+ * @avalon.service type="org.apache.avalon.playground.SecondaryService"
version="0.1"
*/
public class Secondary extends AbstractLogEnabled implements Serviceable,
SecondaryService
{
@@ -20,8 +19,9 @@
/**
* Supply of a logging channel to the component.
+ *
* @param logger the logging channel
- * @avalon.meta.logger name="system"
+ * @avalon.logger name="system"
*/
public void enableLogging( Logger logger )
{
@@ -31,8 +31,11 @@
/**
* Supply of dependent services to this component by the container.
+ *
* @param manager the service manager
- * @avalon.meta.dependency
type="org.apache.avalon.playground.PrimaryService:1.3" key="primary"
+ * @avalon.dependency key="primary"
+ * type="org.apache.avalon.playground.PrimaryService"
+ * version="1.3"
*/
public void service( ServiceManager manager ) throws ServiceException
{
1.2 +1 -1
avalon-sandbox/meta/tools/src/test/org/apache/avalon/playground/SecondaryService.java
Index: SecondaryService.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/tools/src/test/org/apache/avalon/playground/SecondaryService.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SecondaryService.java 10 Jul 2003 12:10:43 -0000 1.1
+++ SecondaryService.java 14 Jul 2003 20:14:24 -0000 1.2
@@ -3,7 +3,7 @@
/**
* An interface representing a service.
- * @avalon.meta.version 0.1
+ * @avalon.service version="0.1"
*/
public interface SecondaryService
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]