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/04 13:49:36 UTC
cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/info LoggerDescriptor.java
mcconnell 2002/08/04 04:49:36
Modified: assembly/demo/src/java/org/apache/excalibur/playground
BasicComponent.xinfo ComplexComponent.xinfo
DemoManager.xinfo EmbeddedDemo.java
ExploitationManager.xinfo InvalidComponent.xinfo
SimpleComponent.xinfo
assembly/src/etc kernel.xml
assembly/src/java/org/apache/excalibur/merlin/assembly
ContainerManager.java ProfileRegistry.java
assembly/src/java/org/apache/excalibur/merlin/model
Profile.java
assembly/src/java/org/apache/excalibur/merlin/model/builder
ProfileBuilder.java ProfileCreator.java
XMLProfileCreator.java
assembly/src/java/org/apache/excalibur/meta/info
LoggerDescriptor.java
Log:
Enhancement of the naming convensions used for implicit and packaged profiles.
Revision Changes Path
1.8 +1 -1 jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/BasicComponent.xinfo
Index: BasicComponent.xinfo
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/BasicComponent.xinfo,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- BasicComponent.xinfo 29 Jul 2002 06:14:28 -0000 1.7
+++ BasicComponent.xinfo 4 Aug 2002 11:49:35 -0000 1.8
@@ -6,7 +6,7 @@
<component-info>
<component>
- <name>basic-component</name>
+ <name>basic</name>
</component>
<context>
1.8 +1 -1 jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ComplexComponent.xinfo
Index: ComplexComponent.xinfo
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ComplexComponent.xinfo,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ComplexComponent.xinfo 29 Jul 2002 06:14:28 -0000 1.7
+++ ComplexComponent.xinfo 4 Aug 2002 11:49:35 -0000 1.8
@@ -6,7 +6,7 @@
<component-info>
<component>
- <name>complex-component</name>
+ <name>complex</name>
</component>
<loggers>
1.3 +1 -1 jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/DemoManager.xinfo
Index: DemoManager.xinfo
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/DemoManager.xinfo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DemoManager.xinfo 2 Aug 2002 06:29:20 -0000 1.2
+++ DemoManager.xinfo 4 Aug 2002 11:49:35 -0000 1.3
@@ -7,7 +7,7 @@
<component-info>
<component>
- <name>demo-ext</name>
+ <name>demonstratable</name>
</component>
<!--
1.5 +2 -2 jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/EmbeddedDemo.java
Index: EmbeddedDemo.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/EmbeddedDemo.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- EmbeddedDemo.java 4 Aug 2002 06:43:19 -0000 1.4
+++ EmbeddedDemo.java 4 Aug 2002 11:49:35 -0000 1.5
@@ -60,9 +60,9 @@
//
m_kernel = new DefaultKernel( );
- m_kernel.enableLogging( getLogger().getChildLogger( "my-kernel" ) );
+ m_kernel.enableLogging( getLogger().getChildLogger( "system" ) );
m_kernel.contextualize( m_context );
- m_kernel.configure( new DefaultConfiguration( "kernel", null ) );
+ m_kernel.configure( new DefaultConfiguration( "config", null ) );
m_kernel.initialize();
//
1.4 +1 -1 jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ExploitationManager.xinfo
Index: ExploitationManager.xinfo
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ExploitationManager.xinfo,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ExploitationManager.xinfo 2 Aug 2002 06:29:20 -0000 1.3
+++ ExploitationManager.xinfo 4 Aug 2002 11:49:35 -0000 1.4
@@ -7,7 +7,7 @@
<component-info>
<component>
- <name>exploit-ext</name>
+ <name>exploit</name>
</component>
<!--
1.7 +1 -1 jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/InvalidComponent.xinfo
Index: InvalidComponent.xinfo
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/InvalidComponent.xinfo,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- InvalidComponent.xinfo 29 Jul 2002 06:14:28 -0000 1.6
+++ InvalidComponent.xinfo 4 Aug 2002 11:49:35 -0000 1.7
@@ -6,7 +6,7 @@
<component-info>
<component>
- <name>invalid-component</name>
+ <name>invalid</name>
</component>
<dependencies>
1.7 +1 -1 jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/SimpleComponent.xinfo
Index: SimpleComponent.xinfo
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/SimpleComponent.xinfo,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SimpleComponent.xinfo 30 Jul 2002 13:49:07 -0000 1.6
+++ SimpleComponent.xinfo 4 Aug 2002 11:49:35 -0000 1.7
@@ -6,7 +6,7 @@
<component-info>
<component>
- <name>simple-component</name>
+ <name>simple</name>
</component>
<services>
1.23 +1 -1 jakarta-avalon-excalibur/assembly/src/etc/kernel.xml
Index: kernel.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/etc/kernel.xml,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- kernel.xml 3 Aug 2002 03:50:06 -0000 1.22
+++ kernel.xml 4 Aug 2002 11:49:36 -0000 1.23
@@ -71,7 +71,7 @@
</fileset>
</classpath>
- <component name="embedded-kernel" class="org.apache.excalibur.playground.EmbeddedDemo" activation="true">
+ <component name="embedded" class="org.apache.excalibur.playground.EmbeddedDemo" activation="true">
<context>
<import key="avalon:home" name="avalon:home"/>
<import key="classloader" name="classloader"/>
1.5 +12 -5 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ContainerManager.java
Index: ContainerManager.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ContainerManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ContainerManager.java 4 Aug 2002 06:43:20 -0000 1.4
+++ ContainerManager.java 4 Aug 2002 11:49:36 -0000 1.5
@@ -388,7 +388,6 @@
Profile[] profiles = m_builder.build( this, types[i] );
for( int j=0; j<profiles.length; j++ )
{
-
addProfile( profiles[j] );
}
}
@@ -563,9 +562,17 @@
final String classname = profile.getType().getInfo().getImplementationKey();
getLocalLogger().debug("adding: " + profile );
- if( m_profiles.get( name ) != null )
- throw new IllegalArgumentException(
- "Profile named '" + name + "' already registered.");
+ final Profile existing = (Profile) m_profiles.get( name );
+ if( existing != null )
+ {
+ //
+ // profile naming conflict
+ //
+
+ throw new IllegalArgumentException(
+ "Profile named '" + name + "' already registered for type: "
+ + existing.getType() );
+ }
m_profiles.put( profile.getName(), profile );
ServiceDescriptor[] services = profile.getType().getServices();
1.5 +5 -9 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ProfileRegistry.java
Index: ProfileRegistry.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ProfileRegistry.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ProfileRegistry.java 2 Aug 2002 06:36:09 -0000 1.4
+++ ProfileRegistry.java 4 Aug 2002 11:49:36 -0000 1.5
@@ -16,25 +16,21 @@
import java.util.Vector;
import java.util.Iterator;
import org.apache.avalon.framework.CascadingException;
-import org.apache.avalon.framework.logger.Logger;
-import org.apache.avalon.framework.logger.LogEnabled;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.activity.Startable;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.activity.Disposable;
-import org.apache.excalibur.configuration.ConfigurationUtil;
-import org.apache.excalibur.meta.info.builder.TypeBuilder;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.logger.Logger;
+import org.apache.avalon.framework.logger.LogEnabled;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.excalibur.meta.info.ServiceDescriptor;
import org.apache.excalibur.meta.info.ReferenceDescriptor;
import org.apache.excalibur.meta.info.DependencyDescriptor;
import org.apache.excalibur.meta.info.PhaseDescriptor;
import org.apache.excalibur.meta.info.Type;
import org.apache.excalibur.meta.info.Facility;
-import org.apache.excalibur.meta.verifier.ComponentVerifier;
import org.apache.excalibur.merlin.model.Profile;
import org.apache.excalibur.merlin.model.Resource;
-import org.apache.excalibur.merlin.model.builder.ProfileBuilder;
/**
* Internal table that holds available component type keyed relative
1.16 +10 -3 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/Profile.java
Index: Profile.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/Profile.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Profile.java 2 Aug 2002 09:34:56 -0000 1.15
+++ Profile.java 4 Aug 2002 11:49:36 -0000 1.16
@@ -206,11 +206,18 @@
{
if( null == name )
{
- m_name = "" + System.identityHashCode( this );
+ m_name = type.getInfo().getName() + "#" + System.identityHashCode( this );
}
else
{
- m_name = name;
+ if( mode != EXPLICIT )
+ {
+ m_name = name + "#" + System.identityHashCode( this );
+ }
+ else
+ {
+ m_name = name;
+ }
}
if( null == type )
1.5 +2 -2 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/builder/ProfileBuilder.java
Index: ProfileBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/builder/ProfileBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ProfileBuilder.java 29 Jul 2002 06:14:33 -0000 1.4
+++ ProfileBuilder.java 4 Aug 2002 11:49:36 -0000 1.5
@@ -50,7 +50,7 @@
loader.getResourceAsStream( xprofile );
final ProfileCreator creator = getXMLProfileCreator( xprofile );
- return creator.createProfiles( loader, type, inputStream );
+ return creator.createPackagedProfiles( loader, type, inputStream );
}
1.6 +6 -5 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/builder/ProfileCreator.java
Index: ProfileCreator.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/builder/ProfileCreator.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ProfileCreator.java 2 Aug 2002 06:34:51 -0000 1.5
+++ ProfileCreator.java 4 Aug 2002 11:49:36 -0000 1.6
@@ -22,14 +22,15 @@
public interface ProfileCreator
{
/**
- * Create a {@link Profile} from stream
+ * Create a set of packaged {@link Profile[]} instances from stream
*
- * @param key the name of component type that we are looking up
+ * @param loader the classloader
+ * @param type the base type
* @param inputStream the stream that the resource is loaded from
- * @return the newly created {@link Type}
+ * @return the newly created {@link Profile} array
* @throws Exception
*/
- Profile[] createProfiles( ClassLoader loader, Type type, InputStream inputStream )
+ Profile[] createPackagedProfiles( ClassLoader loader, Type type, InputStream inputStream )
throws Exception;
/**
1.13 +12 -11 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/builder/XMLProfileCreator.java
Index: XMLProfileCreator.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/builder/XMLProfileCreator.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XMLProfileCreator.java 2 Aug 2002 06:34:51 -0000 1.12
+++ XMLProfileCreator.java 4 Aug 2002 11:49:36 -0000 1.13
@@ -50,16 +50,16 @@
ResourceManager.getPackageResources( XMLTypeCreator.class );
/**
- * Create a {@link Profile} object for specified
- * classname, loaded from specified {@link InputStream}. If the
+ * Create an array of packaged {@link Profile} objects for specified
+ * type, loaded from specified {@link InputStream}. If the
* input stream is null, an implicit profile will be created.
*
- * @param implementationKey The classname of Component
+ * @param type the base type
* @param inputStream the InputStream to load Type from
* @return the created set of profiles
- * @throws ConfigurationException if an error occurs
+ * @throws Exception if an error occurs
*/
- public Profile[] createProfiles(
+ public Profile[] createPackagedProfiles(
ClassLoader loader, Type type, InputStream inputStream )
throws Exception
{
@@ -90,11 +90,12 @@
}
/**
- * Create a {@link Profile} object for specified classname from
+ * Create an array of {@link Profile} object for specified type from
* specified configuration data associated with a single type.
*
- * @param classname The classname of Component
- * @param info the Type configuration
+ * @param loader the classloader to use
+ * @param type the base component type
+ * @param info the configuration
* @return the created set of profiles
* @throws ConfigurationException if an error occurs
*/
@@ -124,8 +125,8 @@
// create the logging categories for this profile
//
- Logger logger;
final String name = profile.getAttribute("name");
+
CategoriesDescriptor categories =
createCategoriesDescriptor( name, profile.getChild("categories") );
@@ -259,7 +260,7 @@
final CategoriesDescriptor categories = createDefaultCategoriesDescriptor( type );
return new Profile(
- type.getInfo().getName(), null, defaults, context, categories, type, true, false,
+ null, null, defaults, context, categories, type, true, false,
Profile.IMPLICIT
);
}
1.2 +4 -1 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/info/LoggerDescriptor.java
Index: LoggerDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/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 5 Jul 2002 10:39:00 -0000 1.1
+++ LoggerDescriptor.java 4 Aug 2002 11:49:36 -0000 1.2
@@ -30,6 +30,9 @@
/**
* Create a descriptor for Logger.
+ *
+ * @param name the logging category name
+ * @param attributes a set of attributes associated with the declaration
*
* @exception NullPointerException if name argument is null
*/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>