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/21 05:34:32 UTC
cvs commit: jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/verifier ComponentVerifier.java
mcconnell 2002/08/20 20:34:32
Modified: meta build.xml
meta/src/java/org/apache/excalibur/meta
ConfigurationBuilder.java
meta/src/java/org/apache/excalibur/meta/info
ComponentDescriptor.java ContextDescriptor.java
DependencyDescriptor.java Descriptor.java
EntryDescriptor.java ExtensionDescriptor.java
LoggerDescriptor.java ReferenceDescriptor.java
ServiceDescriptor.java Type.java
meta/src/java/org/apache/excalibur/meta/info/builder
BlockBuilder.java SerializedTypeCreator.java
TypeBuilder.java TypeCreator.java
XMLBlockCreator.java XMLTypeCreator.java
meta/src/java/org/apache/excalibur/meta/verifier
ComponentVerifier.java
Log:
Updates to pass checkstyle validation.
Revision Changes Path
1.3 +8 -0 jakarta-avalon-excalibur/meta/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/build.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- build.xml 20 Aug 2002 23:17:29 -0000 1.2
+++ build.xml 21 Aug 2002 03:34:31 -0000 1.3
@@ -368,4 +368,12 @@
<delete dir="${dist.base}" />
</target>
+ <target name="patch">
+ <replace dir="src"
+ token="PhaseDescriptor"
+ value="StageDescriptor" >
+ <include name="**/*.*"/>
+ </replace>
+ </target>
+
</project>
1.2 +6 -2 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/ConfigurationBuilder.java
Index: ConfigurationBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/ConfigurationBuilder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ConfigurationBuilder.java 20 Aug 2002 16:06:45 -0000 1.1
+++ ConfigurationBuilder.java 21 Aug 2002 03:34:31 -0000 1.2
@@ -75,6 +75,7 @@
/**
* Build a configuration object using an URI
* @param uri an input source system identifier
+ * @return the contfiguration instance
* @exception SAXException is a parser exception is encountered
* @exception ParserConfigurationException if a parser configuration failure occurs
* @exception IOException if an IO exception occurs while attempting to read the
@@ -89,6 +90,7 @@
/**
* Build a configuration object using an XML InputSource object
* @param input an input source
+ * @return the contfiguration instance
* @exception SAXException is a parser exception is encountered
* @exception ParserConfigurationException if a parser configuration failure occurs
* @exception IOException if an IO exception occurs while attempting to read the
@@ -98,7 +100,9 @@
throws SAXException, ParserConfigurationException, IOException
{
if( input == null )
- throw new NullPointerException("input");
+ {
+ throw new NullPointerException("input");
+ }
final XMLReader reader = createXMLReader();
final SAXConfigurationHandler handler = new SAXConfigurationHandler();
1.2 +11 -1 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ComponentDescriptor.java
Index: ComponentDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ComponentDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ComponentDescriptor.java 20 Aug 2002 16:06:45 -0000 1.1
+++ ComponentDescriptor.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -50,10 +50,20 @@
*/
private final Version m_version;
+ /**
+ * Creation of a new component descriptor using a supplied name, key, version
+ * and attribute set.
+ * @param name the component name
+ * @param key the implemetation key - typeically the classname
+ * @param version the implementation version
+ * @param attributes a set of attributes associated with the component type
+ * @exception IllegalArgumentException if the implementation key is not a classname
+ */
public ComponentDescriptor( final String name,
final String key,
final Version version,
final Properties attributes )
+ throws IllegalArgumentException
{
super( attributes );
1.2 +24 -20 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ContextDescriptor.java
Index: ContextDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ContextDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ContextDescriptor.java 20 Aug 2002 16:06:45 -0000 1.1
+++ ContextDescriptor.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -9,8 +9,6 @@
import java.util.Properties;
-import org.apache.excalibur.meta.info.EntryDescriptor;
-
/**
* A descriptor describing the Context that the Component
* is passed to describe information about Runtime environment
@@ -18,7 +16,7 @@
* <ul>
* <li>classname: the classname of the Context type if it
* differs from base Context class (ie BlockContext).</li>
- * <li>entrys: a list of entrys contained in context</li>
+ * <li>entries: a list of entries contained in context</li>
* </ul>
*
* <p>Also associated with each Context is a set of arbitrary
@@ -33,25 +31,31 @@
public class ContextDescriptor extends Descriptor
{
private final String m_type;
- private final EntryDescriptor[] m_entrys;
+ private final EntryDescriptor[] m_entries;
/**
- * Create a descriptor sans attributes.
+ * Create a descriptor without attributes.
+ * @param type the classname of the context class
+ * @param entries the set of entries required within the context
*/
public ContextDescriptor( final String type,
- final EntryDescriptor[] entrys )
+ final EntryDescriptor[] entries )
{
- this( type, entrys, null );
+ this( type, entries, null );
}
/**
* Create a descriptor.
- * @exception NullPointerException if type or entrys argument is null
+ * @param type the classname of the context class
+ * @param entries the set of entries required within the context
+ * @param attributes supplimentary atrtributes associated with the context
+ * @exception NullPointerException if type or entries argument is null
* @exception IllegalArgumentException if the classname format is invalid
*/
public ContextDescriptor( final String type,
- final EntryDescriptor[] entrys,
- final Properties attributes )
+ final EntryDescriptor[] entries,
+ final Properties attributes )
+ throws NullPointerException, IllegalArgumentException
{
super( attributes );
@@ -60,9 +64,9 @@
throw new NullPointerException( "type" );
}
- if( null == entrys )
+ if( null == entries )
{
- throw new NullPointerException( "entrys" );
+ throw new NullPointerException( "entries" );
}
if( type.indexOf("/") > -1 )
@@ -71,7 +75,7 @@
}
m_type = type;
- m_entrys = entrys;
+ m_entries = entries;
}
/**
@@ -85,25 +89,25 @@
}
/**
- * Return the entrys contained in the context.
+ * Return the entries contained in the context.
*
- * @return the entrys contained in the context.
+ * @return the entries contained in the context.
*/
public EntryDescriptor[] getEntrys()
{
- return m_entrys;
+ return m_entries;
}
/**
* Return the entry with specified key.
- *
+ * @param key the context entry key to lookup
* @return the entry with specified key.
*/
public EntryDescriptor getEntry( final String key )
{
- for( int i = 0; i < m_entrys.length; i++ )
+ for( int i = 0; i < m_entries.length; i++ )
{
- final EntryDescriptor entry = m_entrys[ i ];
+ final EntryDescriptor entry = m_entries[ i ];
if( entry.getKey().equals( key ) )
{
return entry;
1.2 +9 -3 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/DependencyDescriptor.java
Index: DependencyDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/DependencyDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DependencyDescriptor.java 20 Aug 2002 16:06:45 -0000 1.1
+++ DependencyDescriptor.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -53,7 +53,9 @@
private final boolean m_optional;
/**
- * Constructor a dependency sans Attributes.
+ * Creation of a new dependency descriptor.
+ * @param role the role name that will be used by the type when looking up a service
+ * @param service the version insterface service reference
*/
public DependencyDescriptor( final String role,
final ReferenceDescriptor service )
@@ -62,7 +64,11 @@
}
/**
- * Constructor that has all parts sans parent.
+ * Creation of a new dependency descriptor.
+ * @param role the role name that will be used by the type when looking up a service
+ * @param service the version insterface service reference
+ * @param optional TRUE if this depedency is optional
+ * @param attributes a set of attributes to associate with the dependency
*/
public DependencyDescriptor( final String role,
final ReferenceDescriptor service,
1.2 +8 -1 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/Descriptor.java
Index: Descriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/Descriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Descriptor.java 20 Aug 2002 16:06:45 -0000 1.1
+++ Descriptor.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -28,6 +28,10 @@
*/
private final Properties m_attributes;
+ /**
+ * Creation of an abstract descriptor.
+ * @param attributes the set of attributes to assign to the descriptor
+ */
protected Descriptor( final Properties attributes )
{
m_attributes = attributes;
@@ -36,6 +40,7 @@
/**
* Return the attribute for specified key.
*
+ * @param key the attribute key to resolve
* @return the attribute for specified key.
*/
public String getAttribute( final String key )
@@ -53,6 +58,8 @@
/**
* Return the attribute for specified key.
*
+ * @param key the attribute key to resolve
+ * @param defaultValue the default value to use if the value is not defined
* @return the attribute for specified key.
*/
public String getAttribute( final String key,
1.2 +10 -3 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/EntryDescriptor.java
Index: EntryDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/EntryDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EntryDescriptor.java 20 Aug 2002 16:06:45 -0000 1.1
+++ EntryDescriptor.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -42,19 +42,26 @@
/**
* Construct an Entry.
+ * @param key the context entry key
+ * @param type the classname of the context entry
+ * @exception NullPointerException if the key or type value are null
*/
public EntryDescriptor( final String key,
- final String type )
+ final String type ) throws NullPointerException
{
this( key, type, false );
}
/**
* Construct an Entry.
+ * @param key the context entry key
+ * @param type the classname of the context entry
+ * @param optional TRUE if this is an optional entry
+ * @exception NullPointerException if the key or type value are null
*/
public EntryDescriptor( final String key,
final String type,
- final boolean optional )
+ final boolean optional ) throws NullPointerException
{
if( null == key )
{
1.2 +19 -6 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ExtensionDescriptor.java
Index: ExtensionDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ExtensionDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExtensionDescriptor.java 20 Aug 2002 16:06:45 -0000 1.1
+++ ExtensionDescriptor.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -33,35 +33,48 @@
private final ContextDescriptor m_context;
/**
- * Constructor a phase descriptor without attributes.
- * @param name the phase name
- * @param interface the phase type
+ * Constructor an extension descriptor without attributes.
+ * @param name the extension name
+ * @param reference a version interface reference
+ * @param context the context criteria associated with the extension
+ * @exception NullPointerException if the name, reference or context parameters are null
*/
public ExtensionDescriptor( final String name,
final ContextDescriptor context,
final ReferenceDescriptor reference )
+ throws NullPointerException
{
this( name, reference, context, null );
}
/**
* Constructor a phase descriptor with attributes.
- * @param name the phase name
- * @param interface the phase type
+ * @param name the extension name
+ * @param reference a version interface reference
+ * @param context the context criteria associated with the extension
+ * @param attributes a set of attributes to associate with the extension
+ * @exception NullPointerException if the name, reference or context parameters are null
*/
public ExtensionDescriptor( final String name,
final ReferenceDescriptor reference,
final ContextDescriptor context,
final Properties attributes )
+ throws NullPointerException
{
super( attributes );
if( null == name )
+ {
throw new NullPointerException( "name" );
+ }
if( null == reference )
+ {
throw new NullPointerException( "reference" );
+ }
if( null == context )
+ {
throw new NullPointerException( "context" );
+ }
m_name = name;
m_reference = reference;
1.2 +2 -1 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/LoggerDescriptor.java
Index: LoggerDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/LoggerDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LoggerDescriptor.java 20 Aug 2002 16:06:45 -0000 1.1
+++ LoggerDescriptor.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -38,6 +38,7 @@
*/
public LoggerDescriptor( final String name,
final Properties attributes )
+ throws NullPointerException
{
super( attributes );
if( null == name )
1.2 +6 -5 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ReferenceDescriptor.java
Index: ReferenceDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ReferenceDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ReferenceDescriptor.java 20 Aug 2002 16:06:45 -0000 1.1
+++ ReferenceDescriptor.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -34,12 +34,12 @@
private final Version m_version;
/**
- * Construct a service with specified name, version and attributes.
+ * Construct a service with specified classname.
*
* @param classname the name of the service
- * @param version the version of service
+ * @exception NullPointerException if the classname is null
*/
- public ReferenceDescriptor( final String classname )
+ public ReferenceDescriptor( final String classname ) throws NullPointerException
{
this( classname, Version.getVersion( "1.0" ) );
}
@@ -49,9 +49,10 @@
*
* @param classname the name of the service
* @param version the version of service
+ * @exception NullPointerException if the classname or version is null
*/
public ReferenceDescriptor( final String classname,
- final Version version )
+ final Version version ) throws NullPointerException
{
if( null == classname )
{
1.2 +6 -3 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ServiceDescriptor.java
Index: ServiceDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/ServiceDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServiceDescriptor.java 20 Aug 2002 16:06:45 -0000 1.1
+++ ServiceDescriptor.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -8,7 +8,6 @@
package org.apache.excalibur.meta.info;
import java.util.Properties;
-import org.apache.avalon.framework.Version;
/**
@@ -44,9 +43,11 @@
/**
* Construct a service descriptor for specified ReferenceDescriptor
*
- * @param service reference
+ * @param designator the service reference
+ * @exception NullPointerException if the designator argument is null
*/
public ServiceDescriptor( final ReferenceDescriptor designator )
+ throws NullPointerException
{
this( designator, null );
}
@@ -56,9 +57,11 @@
*
* @param designator the ReferenceDescriptor
* @param attributes the attributes of service
+ * @exception NullPointerException if the designator argument is null
*/
public ServiceDescriptor( final ReferenceDescriptor designator,
final Properties attributes )
+ throws NullPointerException
{
super( attributes );
1.2 +49 -25 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/Type.java
Index: Type.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/Type.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Type.java 20 Aug 2002 16:06:45 -0000 1.1
+++ Type.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -13,12 +13,6 @@
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.excalibur.meta.ConfigurationBuilder;
-import org.apache.excalibur.meta.info.ComponentDescriptor;
-import org.apache.excalibur.meta.info.ContextDescriptor;
-import org.apache.excalibur.meta.info.DependencyDescriptor;
-import org.apache.excalibur.meta.info.LoggerDescriptor;
-import org.apache.excalibur.meta.info.ServiceDescriptor;
-import org.apache.excalibur.meta.info.PhaseDescriptor;
/**
* This class contains the meta information about a particular
@@ -31,7 +25,7 @@
* <li>the services that this component type is capable of providing</li>
* <li>the services that this component type requires to operate (and the
* names via which services are accessed)</li>
- * <li>extended lifecycle phases that this component uses</li>
+ * <li>extended lifecycle stages that this component uses</li>
* </ul>
*
* <p><b>UML</b></p>
@@ -48,22 +42,41 @@
private final ServiceDescriptor[] m_services;
private final DependencyDescriptor[] m_dependencies;
private final LoggerDescriptor[] m_loggers;
- private final PhaseDescriptor[] m_phases;
+ private final StageDescriptor[] m_stages;
private final ExtensionDescriptor[] m_extensions;
private transient Configuration m_configuration;
private transient boolean m_loaded = false;
/**
- * Basic constructor that takes as parameters all parts.
+ * Creation of a new Type instance using a supplied component descriptor,
+ * logging, cotext, services, depedencies, stages and extension descriptors.
+ * @param descriptor a component descriprot that contains information about
+ * the component type
+ * @param loggers a set of logger descriptors the declare the logging channels
+ * required by the type
+ * @param context a component context descriptor that declares the context type
+ * and context entry key and value classnames
+ * @param services a set of service descriprors that detail the service that
+ * this component type is capable of supplying
+ * @param dependencies a set of depedency descriprors that detail the service
+ * that this component type is depedent on
+ * @param stages a set of stage descriprors that detail the extensiuon stage
+ * interfaces that this component requires a handler for
+ * @param extensions a set of lifecycle extension capabilities that this
+ * componet can provide to its container during the process of stage
+ * suppier resolution
+ * @exception NullPointerException if the descriptor, loggers, context, services,
+ * dependencies, stages, or extensions argument is null
*/
public Type( final ComponentDescriptor descriptor,
final LoggerDescriptor[] loggers,
final ContextDescriptor context,
final ServiceDescriptor[] services,
final DependencyDescriptor[] dependencies,
- final PhaseDescriptor[] phases,
+ final StageDescriptor[] stages,
final ExtensionDescriptor[] extensions )
+ throws NullPointerException
{
if( null == descriptor )
{
@@ -85,9 +98,9 @@
{
throw new NullPointerException( "dependencies" );
}
- if( null == phases )
+ if( null == stages )
{
- throw new NullPointerException( "phases" );
+ throw new NullPointerException( "stages" );
}
if( null == extensions )
{
@@ -99,7 +112,7 @@
m_context = context;
m_services = services;
m_dependencies = dependencies;
- m_phases = phases;
+ m_stages = stages;
m_extensions = extensions;
}
@@ -136,7 +149,9 @@
{
LoggerDescriptor logger = loggers[i];
if( logger.getName().equals( name ) )
- return true;
+ {
+ return true;
+ }
}
return false;
}
@@ -194,12 +209,17 @@
/**
* Returns the default configuration supplied with the type.
*
+ * @param loader the classloader to use to load the default configuration
* @return the default configuration or null if no packaged defaults
+ * @exception Exception if an error occurs while marchalling the default
+ * confiugration for the type
*/
public Configuration getConfiguration( ClassLoader loader ) throws Exception
{
if( m_loaded )
- return m_configuration;
+ {
+ return m_configuration;
+ }
final String xconfig =
getInfo().getImplementationKey().replace( '.', '/' ) + ".xconfig";
@@ -219,17 +239,17 @@
}
/**
- * Return the lifecycle phases extensions required by this extension.
+ * Return the lifecycle stages extensions required by this extension.
*
- * @return an array of phase descriptors.
+ * @return an array of stage descriptors.
*/
- public PhaseDescriptor[] getPhases()
+ public StageDescriptor[] getPhases()
{
- return m_phases;
+ return m_stages;
}
/**
- * Return the phases supported by this extension.
+ * Return the stages supported by this extension.
*
* @return an array of extension descriptors.
*/
@@ -239,20 +259,23 @@
}
/**
- * Return the extension supporting the supplied phase.
+ * Return the extension supporting the supplied stage.
*
+ * @param stage the lifecycle stage that this type requires a handler for
* @return a matching extension or null if no matching extension
*/
- public ExtensionDescriptor getExtension( PhaseDescriptor phase )
+ public ExtensionDescriptor getExtension( StageDescriptor stage )
{
- ReferenceDescriptor reference = phase.getReference();
+ ReferenceDescriptor reference = stage.getReference();
ExtensionDescriptor[] extensions = getExtensions();
for( int i=0; i<extensions.length; i++ )
{
ExtensionDescriptor extension = extensions[i];
ReferenceDescriptor ref = extension.getReference();
if( reference.matches( ref ) )
+ {
return extension;
+ }
}
return null;
}
@@ -263,6 +286,7 @@
*/
public String toString()
{
- return "Type name: " + getInfo().getName() + " key: " + getInfo().getImplementationKey();
+ return "Type name: " + getInfo().getName()
+ + " key: " + getInfo().getImplementationKey();
}
}
1.2 +4 -4 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/BlockBuilder.java
Index: BlockBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/BlockBuilder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BlockBuilder.java 20 Aug 2002 16:06:46 -0000 1.1
+++ BlockBuilder.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -10,7 +10,6 @@
import java.io.InputStream;
import org.apache.avalon.excalibur.i18n.ResourceManager;
import org.apache.avalon.excalibur.i18n.Resources;
-import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.logger.Logger;
import org.apache.excalibur.meta.info.Type;
@@ -31,6 +30,7 @@
/**
* Setup logging for all subcomponents
+ * @param logger the logging channel to assign to the builder
*/
public void enableLogging( final Logger logger )
{
@@ -47,7 +47,7 @@
*
* @param clazz The class of Component
* @return the created Type
- * @throws ConfigurationException if an error occurs
+ * @throws Exception if an error occurs
*/
public Type build( final Class clazz )
throws Exception
@@ -62,7 +62,7 @@
* @param classname The classname of block
* @param classLoader the ClassLoader to load info from
* @return the created Type
- * @throws ConfigurationException if an error occurs
+ * @throws Exception if an error occurs
*/
public Type build( final String classname,
final ClassLoader classLoader )
1.2 +9 -1 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/SerializedTypeCreator.java
Index: SerializedTypeCreator.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/SerializedTypeCreator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SerializedTypeCreator.java 20 Aug 2002 16:06:46 -0000 1.1
+++ SerializedTypeCreator.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -22,6 +22,14 @@
public class SerializedTypeCreator
implements TypeCreator
{
+
+ /**
+ * Create of a type instance from a serialized form.
+ * @param key not-used
+ * @param inputStream the input stream
+ * @return the meta-info instance that describes the component type
+ * @exception Exception if an error occurs
+ */
public Type createType( final String key,
final InputStream inputStream )
throws Exception
1.2 +4 -4 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/TypeBuilder.java
Index: TypeBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/TypeBuilder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TypeBuilder.java 20 Aug 2002 16:06:46 -0000 1.1
+++ TypeBuilder.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -10,7 +10,6 @@
import java.io.InputStream;
import org.apache.avalon.excalibur.i18n.ResourceManager;
import org.apache.avalon.excalibur.i18n.Resources;
-import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.logger.Logger;
import org.apache.excalibur.meta.info.Type;
@@ -38,6 +37,7 @@
/**
* Setup logging for all subcomponents
+ * @param logger the logging channel
*/
public void enableLogging( final Logger logger )
{
@@ -54,7 +54,7 @@
*
* @param clazz The class of Component
* @return the created Type
- * @throws ConfigurationException if an error occurs
+ * @throws Exception if an error occurs
*/
public Type build( final Class clazz )
throws Exception
@@ -69,7 +69,7 @@
* @param classname The classname of Component
* @param classLoader the ClassLoader to load info from
* @return the created Type
- * @throws ConfigurationException if an error occurs
+ * @throws Exception if an error occurs
*/
public Type build( final String classname,
final ClassLoader classLoader )
1.2 +2 -2 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/TypeCreator.java
Index: TypeCreator.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/TypeCreator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TypeCreator.java 20 Aug 2002 16:06:46 -0000 1.1
+++ TypeCreator.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -28,7 +28,7 @@
* @param key the name of component type that we are looking up
* @param input the input stream that the resource is loaded from
* @return the newly created {@link Type}
- * @throws Exception
+ * @exception Exception if an error occurs
*/
Type createType( String key, InputStream input )
throws Exception;
1.2 +5 -8 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/XMLBlockCreator.java
Index: XMLBlockCreator.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/XMLBlockCreator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XMLBlockCreator.java 20 Aug 2002 16:06:46 -0000 1.1
+++ XMLBlockCreator.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -10,23 +10,19 @@
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Properties;
-import org.apache.excalibur.configuration.ConfigurationUtil;
import org.apache.avalon.excalibur.i18n.ResourceManager;
import org.apache.avalon.excalibur.i18n.Resources;
import org.apache.avalon.framework.Version;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.context.Context;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.excalibur.meta.info.ComponentDescriptor;
import org.apache.excalibur.meta.info.Type;
import org.apache.excalibur.meta.info.ContextDescriptor;
import org.apache.excalibur.meta.info.DependencyDescriptor;
-import org.apache.excalibur.meta.info.EntryDescriptor;
import org.apache.excalibur.meta.info.LoggerDescriptor;
import org.apache.excalibur.meta.info.ServiceDescriptor;
import org.apache.excalibur.meta.info.ReferenceDescriptor;
-import org.apache.excalibur.meta.info.PhaseDescriptor;
+import org.apache.excalibur.meta.info.StageDescriptor;
import org.apache.excalibur.meta.info.ExtensionDescriptor;
import org.apache.excalibur.meta.ConfigurationBuilder;
import org.xml.sax.InputSource;
@@ -61,8 +57,9 @@
throws Exception
{
if( inputStream == null )
+ {
throw new NullPointerException("input");
-
+ }
final InputSource input = new InputSource( inputStream );
final String classname = implementationKey;
final Configuration xinfo = ConfigurationBuilder.build( input );
@@ -121,7 +118,7 @@
final DependencyDescriptor[] dependencies = buildDependencies( classname, configuration );
configuration = info.getChild( "stages" );
- final PhaseDescriptor[] phases = buildPhases( configuration );
+ final StageDescriptor[] phases = buildPhases( configuration );
configuration = info.getChild( "extensions" );
final ExtensionDescriptor[] extensions = buildExtensions( configuration );
1.2 +18 -9 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/XMLTypeCreator.java
Index: XMLTypeCreator.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/XMLTypeCreator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XMLTypeCreator.java 20 Aug 2002 16:06:46 -0000 1.1
+++ XMLTypeCreator.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -25,7 +25,7 @@
import org.apache.excalibur.meta.info.LoggerDescriptor;
import org.apache.excalibur.meta.info.ServiceDescriptor;
import org.apache.excalibur.meta.info.ReferenceDescriptor;
-import org.apache.excalibur.meta.info.PhaseDescriptor;
+import org.apache.excalibur.meta.info.StageDescriptor;
import org.apache.excalibur.meta.info.ExtensionDescriptor;
import org.apache.excalibur.meta.ConfigurationBuilder;
import org.xml.sax.InputSource;
@@ -60,7 +60,9 @@
throws Exception
{
if( inputStream == null )
+ {
throw new NullPointerException("input");
+ }
final InputSource input = new InputSource( inputStream );
final String classname = implementationKey;
@@ -75,7 +77,7 @@
* @param classname The classname of Component
* @param info the Type configuration
* @return the created Type
- * @throws ConfigurationException if an error occurs
+ * @throws Exception if an error occurs
*/
private Type build( final String classname, final Configuration info )
throws Exception
@@ -120,7 +122,7 @@
final DependencyDescriptor[] dependencies = buildDependencies( classname, configuration );
configuration = info.getChild( "stages" );
- final PhaseDescriptor[] phases = buildPhases( configuration );
+ final StageDescriptor[] phases = buildPhases( configuration );
configuration = info.getChild( "extensions" );
final ExtensionDescriptor[] extensions = buildExtensions( configuration );
@@ -149,7 +151,7 @@
* @return an array of phase descriptors
* @exception Exception if a build error occurs
*/
- protected PhaseDescriptor[] buildPhases( Configuration config ) throws Exception
+ protected StageDescriptor[] buildPhases( Configuration config ) throws Exception
{
ArrayList list = new ArrayList();
Configuration[] phases = config.getChildren("stage");
@@ -160,9 +162,9 @@
buildReferenceDescriptor( phase.getChild("reference") );
final Properties attributes =
buildAttributes( phase.getChild( "attributes" ) );
- list.add( new PhaseDescriptor( reference, attributes ) );
+ list.add( new StageDescriptor( reference, attributes ) );
}
- return (PhaseDescriptor[]) list.toArray( new PhaseDescriptor[0] );
+ return (StageDescriptor[]) list.toArray( new StageDescriptor[0] );
}
/**
@@ -265,7 +267,10 @@
//
Configuration serviceRef = dependency.getChild( "service-ref", false );
- if( serviceRef == null ) serviceRef = dependency.getChild( "reference" );
+ if( serviceRef == null )
+ {
+ serviceRef = dependency.getChild( "reference" );
+ }
final ReferenceDescriptor service =
buildReferenceDescriptor( serviceRef );
final boolean optional =
@@ -395,7 +400,10 @@
throws ConfigurationException
{
Configuration serviceRef = service.getChild( "service-ref", false );
- if( serviceRef == null ) serviceRef = service.getChild( "reference" );
+ if( serviceRef == null )
+ {
+ serviceRef = service.getChild( "reference" );
+ }
final ReferenceDescriptor designator = buildReferenceDescriptor( serviceRef );
final Properties attributes =
buildAttributes( service.getChild( "attributes" ) );
@@ -407,6 +415,7 @@
*
* @param config the attributes config
* @return the Properties object representing attributes
+ * @throws ConfigurationException if an error occurs
*/
protected Properties buildAttributes( final Configuration config )
throws ConfigurationException
1.2 +2 -1 jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/verifier/ComponentVerifier.java
Index: ComponentVerifier.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/verifier/ComponentVerifier.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ComponentVerifier.java 20 Aug 2002 16:06:46 -0000 1.1
+++ ComponentVerifier.java 21 Aug 2002 03:34:32 -0000 1.2
@@ -69,6 +69,7 @@
* @param name the name of component
* @param implementation the implementation class of component
* @param services the classes representing services
+ * @param phases the classes representing stage depedencies
* @throws VerifyException if error thrown on failure and
* component fails check
*/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>