mcconnell 2003/02/27 15:45:09
Modified: merlin/src/java/org/apache/avalon/merlin/block/impl
DefaultBlockLoader.java
Log:
Enhancement to the way in which extension paths are handled (including addition of
support for system verus block scoped library paths).
Revision Changes Path
1.12 +12 -11
avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/block/impl/DefaultBlockLoader.java
Index: DefaultBlockLoader.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/block/impl/DefaultBlockLoader.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DefaultBlockLoader.java 17 Feb 2003 12:12:22 -0000 1.11
+++ DefaultBlockLoader.java 27 Feb 2003 23:45:09 -0000 1.12
@@ -600,8 +600,8 @@
// to be applied to the block.
//
- Map map = new Hashtable();
- map.put("urn:merlin:container.descriptor", descriptor );
+ //Map map = new Hashtable();
+ //map.put("urn:merlin:container.descriptor", descriptor );
DefaultApplianceContext context = new DefaultApplianceContext( descriptor );
@@ -667,12 +667,9 @@
ZipEntry entry = jar.getEntry( BLOCK_XML_ENTRY );
if( entry == null )
{
- if( getLogger().isDebugEnabled() )
- {
- final String msg = "No block configuration - applying defaults.";
- getLogger().debug( msg );
- }
- return new DefaultConfiguration( "block", jar.getName() );
+ final String error =
+ "Missing block descriptor: /" + BLOCK_XML_ENTRY;
+ throw new BlockException( error );
}
try
@@ -794,7 +791,7 @@
throws EngineException
{
LibraryDescriptor extensions =
- createLibraryDescriptor( config.getChild( "library" ) );
+ createLibraryDescriptor( config.getChild( "library", false ) );
ClasspathDescriptor classpath =
createClasspathDescriptor( config.getChild( "classpath" ) );
@@ -813,12 +810,16 @@
* Utility that handles the creation of a extension set descriptor from
* a configuration fragment.
* @param config the configuration
- * @return the library descriptor
+ * @return the library descriptor of null if the supplied configuration is null
* @exception EngineException if an error occurs
*/
private LibraryDescriptor createLibraryDescriptor( Configuration config )
throws EngineException
{
+ if( config == null )
+ {
+ return null;
+ }
try
{
return CREATOR.createLibraryDescriptor( config );
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]