Skip to Content.
Sympa Menu

notify-dpml - r1361 - in trunk/main/depot/library: etc/test/samples src/main/net/dpml/library/impl

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1361 - in trunk/main/depot/library: etc/test/samples src/main/net/dpml/library/impl
  • Date: Wed, 12 Apr 2006 00:31:27 +0200

Author: mcconnell
Date: 2006-04-12 00:31:24 +0200 (Wed, 12 Apr 2006)
New Revision: 1361

Modified:
trunk/main/depot/library/etc/test/samples/anonymous.xml
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultLibrary.java

trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
Log:
add support for symbolic references in anonmouse urn includes

Modified: trunk/main/depot/library/etc/test/samples/anonymous.xml
===================================================================
--- trunk/main/depot/library/etc/test/samples/anonymous.xml 2006-04-11
22:30:39 UTC (rev 1360)
+++ trunk/main/depot/library/etc/test/samples/anonymous.xml 2006-04-11
22:31:24 UTC (rev 1361)
@@ -5,6 +5,7 @@
<property name="project.builder.uri"
value="link:plugin:dpml/tools/dpml-tools-builder"/>
<property name="project.standard.template"
value="local:template:dpml/tools/standard"/>
<property name="project.template" value="${project.standard.template}"/>
+ <property name="cc.version" value="3.0"/>
</properties>

<modules>
@@ -15,7 +16,7 @@
</types>
<dependencies>
<runtime>
- <include
urn="artifact:jar:commons-collections/commons-collections#3.0"/>
+ <include
urn="artifact:jar:commons-collections/commons-collections#${cc.version}"/>
</runtime>
</dependencies>
</project>

Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultLibrary.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultLibrary.java
2006-04-11 22:30:39 UTC (rev 1360)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultLibrary.java
2006-04-11 22:31:24 UTC (rev 1361)
@@ -210,14 +210,6 @@
public Module getModule( String ref ) throws ModuleNotFoundException
{
return m_module.getModule( ref );
- //try
- //{
- // return m_module.getModule( ref );
- //}
- //catch( ModuleNotFoundException e )
- //{
- // return m_imports.getModule( ref );
- //}
}

/**
@@ -229,14 +221,6 @@
public Resource getResource( String ref ) throws
ResourceNotFoundException
{
return m_module.getResource( ref );
- //try
- //{
- // return m_module.getResource( ref );
- //}
- //catch( ResourceNotFoundException e )
- //{
- // return m_imports.getResource( ref );
- //}
}

/**
@@ -381,23 +365,14 @@
* @exception IllegalArgumentException if the include mode is not URN mode
* @exception URISyntaxException if the include urn is invaid
*/
- DefaultResource getAnonymousResource( IncludeDirective include )
+ DefaultResource getAnonymousResource( String urn, Properties properties
)
throws URISyntaxException
{
- if( !include.getMode().equals( IncludeDirective.URN ) )
- {
- throw new IllegalArgumentException(
- "Invalid include mode: "
- + include.getMode() );
- }
-
- String urn = include.getValue();
if( m_anonymous.containsKey( urn ) )
{
return (DefaultResource) m_anonymous.get( urn );
}

- Properties properties = include.getProperties();
Artifact artifact = Artifact.createArtifact( urn );
String group = artifact.getGroup();
String name = artifact.getName();
@@ -428,13 +403,13 @@
m_anonymous.put( urn, resource );
return resource;
}
- catch( Exception pnfe )
+ catch( Exception e )
{
final String error =
"Internal error while creating an ANONYMOUS resource: "
+ urn
+ "].";
- throw new RuntimeException( error, pnfe );
+ throw new RuntimeException( error, e );
}
}


Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
2006-04-11 22:30:39 UTC (rev 1360)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
2006-04-11 22:31:24 UTC (rev 1361)
@@ -916,7 +916,10 @@
{
try
{
- resources[i] = m_library.getAnonymousResource( include );
+ String value = include.getValue();
+ String urn = resolve( value );
+ Properties properties = include.getProperties();
+ resources[i] = m_library.getAnonymousResource( urn,
properties );
}
catch( URISyntaxException e )
{




  • r1361 - in trunk/main/depot/library: etc/test/samples src/main/net/dpml/library/impl, mcconnell at BerliOS, 04/11/2006

Archive powered by MHonArc 2.6.24.

Top of Page