notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1535 - in trunk/main: central/src/docs/depot/library depot depot/library/etc/data/samples depot/library/src/main/net/dpml/library/impl depot/library/src/main/net/dpml/library/info depot/tools/builder/src/main/net/dpml/tools/impl lang/module/etc metro/runtime/src/main/net/dpml/metro/runtime planet/http planet/http/server transit/core/src/main/net/dpml/transit util
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1535 - in trunk/main: central/src/docs/depot/library depot depot/library/etc/data/samples depot/library/src/main/net/dpml/library/impl depot/library/src/main/net/dpml/library/info depot/tools/builder/src/main/net/dpml/tools/impl lang/module/etc metro/runtime/src/main/net/dpml/metro/runtime planet/http planet/http/server transit/core/src/main/net/dpml/transit util
- Date: Mon, 3 Jul 2006 16:42:59 +0200
Author: mcconnell
Date: 2006-07-03 16:42:38 +0200 (Mon, 03 Jul 2006)
New Revision: 1535
Modified:
trunk/main/central/src/docs/depot/library/dependencies.xml
trunk/main/depot/library/etc/data/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
trunk/main/depot/library/src/main/net/dpml/library/info/IncludeDirective.java
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryDecoder.java
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryEncoder.java
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
trunk/main/depot/module.xml
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
trunk/main/lang/module/etc/module.xsd
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentModel.java
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultPartsManager.java
trunk/main/planet/http/module.xml
trunk/main/planet/http/server/project.xml
trunk/main/transit/core/src/main/net/dpml/transit/Artifact.java
trunk/main/util/module.xml
Log:
replacement of 'urn' attribute with 'uri' to be consistent with overall
semantics
Modified: trunk/main/central/src/docs/depot/library/dependencies.xml
===================================================================
--- trunk/main/central/src/docs/depot/library/dependencies.xml 2006-07-03
04:35:13 UTC (rev 1534)
+++ trunk/main/central/src/docs/depot/library/dependencies.xml 2006-07-03
14:42:38 UTC (rev 1535)
@@ -82,13 +82,13 @@
<td><tt><include ref="[group]/[name]"/></tt></td>
</tr>
<tr>
- <td>urn</td>
+ <td>uri</td>
<td>Establishes an annonomous reference using the artifact uri
to establish
the group, name, version and type.</td>
</tr>
<tr>
<td></td>
- <td><tt><include urn="[artifact]"/></tt></td>
+ <td><tt><include uri="[artifact]"/></tt></td>
</tr>
</table>
@@ -113,7 +113,7 @@
The following project definition uses a combination of all three
include variants.
Two dependencies (dpml-http-api and dpml-http-spi) use the short form
local reference
via the <tt>key</tt> attribute. Five includes reference resources or
projects via
- fully qualified names, and a further seven includes use the urn
notion.
+ fully qualified names, and a further seven includes use the uri
notion.
</p>
<source><![CDATA[
@@ -126,14 +126,14 @@
<runtime>
<include ref="dpml/metro/dpml-metro-model"/>
<include ref="dpml/util/dpml-logging-api"/>
- <include urn="artifact:jar:org/mortbay/servlet-api-2.5#20060213"
tag="PUBLIC"/>
- <include urn="artifact:jar:tomcat/jasper-runtime#5.5.12"/>
- <include urn="artifact:jar:tomcat/jasper-compiler#5.5.12"/>
- <include urn="artifact:jar:tomcat/jasper-compiler-jdt#5.5.12"/>
- <include urn="artifact:jar:org/mortbay/jetty#20060213"/>
- <include urn="artifact:jar:org/slf4j/jcl104-over-slf4j#1.0-rc5"/>
- <include urn="artifact:jar:org/slf4j/slf4j-jdk14#1.0-rc5"/>
- <include urn="artifact:jar:commons-el/commons-el#1.0"/>
+ <include uri="artifact:jar:org/mortbay/servlet-api-2.5#20060213"
tag="PUBLIC"/>
+ <include uri="artifact:jar:tomcat/jasper-runtime#5.5.12"/>
+ <include uri="artifact:jar:tomcat/jasper-compiler#5.5.12"/>
+ <include uri="artifact:jar:tomcat/jasper-compiler-jdt#5.5.12"/>
+ <include uri="artifact:jar:org/mortbay/jetty#20060213"/>
+ <include uri="artifact:jar:org/slf4j/jcl104-over-slf4j#1.0-rc5"/>
+ <include uri="artifact:jar:org/slf4j/slf4j-jdk14#1.0-rc5"/>
+ <include uri="artifact:jar:commons-el/commons-el#1.0"/>
<include ref="dpml/transit/dpml-transit-main"/>
</runtime>
</dependencies>
Modified: trunk/main/depot/library/etc/data/samples/anonymous.xml
===================================================================
--- trunk/main/depot/library/etc/data/samples/anonymous.xml 2006-07-03
04:35:13 UTC (rev 1534)
+++ trunk/main/depot/library/etc/data/samples/anonymous.xml 2006-07-03
14:42:38 UTC (rev 1535)
@@ -20,7 +20,7 @@
</types>
<dependencies>
<runtime>
- <include
urn="artifact:jar:commons-collections/commons-collections#${cc.version}"/>
+ <include
uri="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-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultLibrary.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -374,13 +374,14 @@
}
Artifact artifact = Artifact.createArtifact( urn );
+ String scheme = artifact.getScheme();
String group = artifact.getGroup();
String name = artifact.getName();
String version = artifact.getVersion();
String type = artifact.getType();
ResourceDirective resourceDirective =
- ResourceDirective.createAnonymousResource( name, version, type,
properties );
+ ResourceDirective.createAnonymousResource( scheme, name, version,
type, properties );
ModuleDirective enclosing = null;
String[] elements = group.split( "/", -1 );
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-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -206,17 +206,6 @@
}
}
- //private Type[] buildTypes( TypeDirective[] directives )
- //{
- // Type[] types = new Type[ directives.length ];
- // for( int i=0; i<directives.length; i++ )
- // {
- // TypeDirective directive = directives[i];
- // types[i] = new DefaultType( this, directive );
- // }
- // return types;
- //}
-
//----------------------------------------------------------------------------
// Resource
//----------------------------------------------------------------------------
@@ -468,9 +457,11 @@
String group = getGroupName();
String name = getName();
String version = getVersion();
+ String scheme = m_directive.getScheme();
+
try
{
- return Artifact.createArtifact( group, name, version, id );
+ return Artifact.createArtifact( scheme, group, name, version, id
);
}
catch( Throwable e )
{
@@ -745,7 +736,7 @@
String urn = artifact.toString();
IncludeDirective include =
new IncludeDirective(
- IncludeDirective.URN,
+ IncludeDirective.URI,
category,
urn,
null );
@@ -953,7 +944,7 @@
for( int i=0; i<includes.length; i++ )
{
IncludeDirective include = includes[i];
- if( include.getMode().equals( IncludeDirective.URN ) )
+ if( include.getMode().equals( IncludeDirective.URI ) )
{
try
{
@@ -1349,13 +1340,4 @@
return m_parent.getResourcePath();
}
}
-
- /**
- * Return the logging channel.
- * @return the logging channel
- */
- //protected Logger getLogger()
- //{
- // return m_logger;
- //}
}
Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/IncludeDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/IncludeDirective.java
2006-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/IncludeDirective.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -44,7 +44,7 @@
/**
* URN resource reference mode constant.
*/
- public static final Mode URN = Mode.URN;
+ public static final Mode URI = Mode.URI;
private final Mode m_mode;
private final String m_value;
@@ -179,7 +179,7 @@
/**
* Include by urn definition.
*/
- public static final Mode URN = new Mode( "urn" );
+ public static final Mode URI = new Mode( "uri" );
/**
* Internal constructor.
@@ -205,9 +205,9 @@
{
return REF;
}
- else if( value.equalsIgnoreCase( "urn" ) )
+ else if( value.equalsIgnoreCase( "uri" ) )
{
- return URN;
+ return URI;
}
else
{
Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryDecoder.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryDecoder.java
2006-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryDecoder.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -178,8 +178,8 @@
/**
* Construct a module directive relative to the supplied base directory
* using the supplied DOM element.
- * @param base the basedire of the enclosing library or module
- * @param element the element definting the module
+ * @param base the basedir of the enclosing library or module
+ * @param element the element defining the module
*/
private ResourceDirective[] buildResourceDirectivesFromElement(
File base, Element element ) throws Exception
@@ -236,10 +236,6 @@
{
return buildResourceDirectiveFromElement( parent, root,
basedir );
}
- //catch( DecodingException e )
- //{
- // throw e;
- //}
catch( Throwable e )
{
final String error =
@@ -274,7 +270,6 @@
{
try
{
- //String path = ElementHelper.getAttribute( element, "file"
);
File file = new File( base, path );
File dir = file.getParentFile();
String spec = getRelativePath( base, dir );
@@ -476,15 +471,15 @@
final String value = ElementHelper.getAttribute( element,
"ref", null );
return new IncludeDirective( IncludeDirective.REF, category,
value, properties );
}
- else if( element.hasAttribute( "urn" ) )
+ else if( element.hasAttribute( "uri" ) )
{
- final String value = ElementHelper.getAttribute( element,
"urn", null );
- return new IncludeDirective( IncludeDirective.URN, category,
value, properties );
+ final String value = ElementHelper.getAttribute( element,
"uri", null );
+ return new IncludeDirective( IncludeDirective.URI, category,
value, properties );
}
else
{
final String error =
- "Include directive does not declare a 'urn', 'key' or
'ref' attribute.\n"
+ "Include directive does not declare a 'uri', 'key' or
'ref' attribute.\n"
+ element.toString();
throw new IllegalArgumentException( error );
}
Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryEncoder.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryEncoder.java
2006-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryEncoder.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -330,9 +330,9 @@
{
writer.write( " ref=\"" + value + "\"" );
}
- else if( Mode.URN.equals( mode ) )
+ else if( Mode.URI.equals( mode ) )
{
- writer.write( " urn=\"" + value + "\"" );
+ writer.write( " uri=\"" + value + "\"" );
}
if( Scope.RUNTIME.equals( scope ) )
Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
2006-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -24,6 +24,8 @@
import net.dpml.lang.Enum;
+import net.dpml.transit.Artifact;
+
/**
* The ResourceDirective class describes an available resource.
*
@@ -47,6 +49,7 @@
*/
public static final Classifier ANONYMOUS = Classifier.ANONYMOUS;
+ private final String m_scheme;
private final String m_name;
private final String m_version;
private final String m_basedir;
@@ -66,13 +69,9 @@
* @return the resource directive
*/
public static ResourceDirective createAnonymousResource(
- String name, String version, String type, Properties properties )
+ String scheme, String name, String version, String type, Properties
properties )
{
- return createResourceDirective(
- name, version, Classifier.ANONYMOUS, null,
- null, new DataDirective[]{new TypeDirective( type )},
- new DependencyDirective[0],
- properties, null );
+ return new ResourceDirective( scheme, name, type, version,
properties );
}
/**
@@ -132,6 +131,35 @@
}
/**
+ * Creation of a new annonomous resource directive.
+ * @param scheme the resource schema (artifact or link)
+ * @param name the resource name
+ * @param version the resource version
+ * @param properties suppliementary properties
+ */
+ private ResourceDirective(
+ String scheme, String name, String type, String version, Properties
properties )
+ {
+ super( properties );
+
+ if( null == name )
+ {
+ throw new NullPointerException( "name" );
+ }
+
+ m_name = name;
+ m_types = new TypeDirective[]{new TypeDirective( type )};
+ m_data = m_types;
+ m_dependencies = new DependencyDirective[0];
+ m_classifier = Classifier.ANONYMOUS;
+ m_version = version;
+ m_basedir = ".";
+ m_info = new InfoDirective( null, null );
+ m_filters = new FilterDirective[0];
+ m_scheme = scheme;
+ }
+
+ /**
* Creation of a new resource directive.
* @param name the resource name
* @param version the resource version
@@ -172,6 +200,7 @@
m_version = version;
m_basedir = basedir;
m_classifier = classifier;
+ m_scheme = Artifact.ARTIFACT;
if( null == info )
{
@@ -270,6 +299,16 @@
}
/**
+ * Return the scheme to use when declaring the published artifact (used
+ * in conjunction with anonymous resources.
+ * @return the scheme
+ */
+ public String getScheme()
+ {
+ return m_scheme;
+ }
+
+ /**
* Return an array of types representing artifacts associated
* with the resource.
* @return the type directives
Modified: trunk/main/depot/module.xml
===================================================================
--- trunk/main/depot/module.xml 2006-07-03 04:35:13 UTC (rev 1534)
+++ trunk/main/depot/module.xml 2006-07-03 14:42:38 UTC (rev 1535)
@@ -96,15 +96,15 @@
<dependencies>
<runtime>
<include ref="dpml/depot/dpml-tools-builder"/>
- <include urn="artifact:jar:checkstyle/checkstyle#4.1">
+ <include uri="artifact:jar:checkstyle/checkstyle#4.1">
<property name="project.api.host" value="http://api.dpml.net"/>
<property name="project.api.root"
value="${project.api.host}/${project.group}/${project.version}"/>
</include>
- <include urn="artifact:jar:commons-logging/commons-logging#1.0.4" />
- <include
urn="artifact:jar:commons-collections/commons-collections#3.1" />
- <include
urn="artifact:jar:commons-beanutils/commons-beanutils-core#1.7.0" />
- <include urn="artifact:jar:bcel/bcel#5.1" />
- <include urn="artifact:jar:antlr/antlr#2.7.2" />
+ <include uri="artifact:jar:commons-logging/commons-logging#1.0.4" />
+ <include
uri="artifact:jar:commons-collections/commons-collections#3.1" />
+ <include
uri="artifact:jar:commons-beanutils/commons-beanutils-core#1.7.0" />
+ <include uri="artifact:jar:bcel/bcel#5.1" />
+ <include uri="artifact:jar:antlr/antlr#2.7.2" />
</runtime>
</dependencies>
</project>
@@ -116,7 +116,7 @@
</types>
<dependencies>
<runtime>
- <include urn="artifact:jar:java2html/java2html#4.2"/>
+ <include uri="artifact:jar:java2html/java2html#4.2"/>
<include ref="ant/ant-launcher"/>
</runtime>
</dependencies>
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
2006-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -40,6 +40,7 @@
import net.dpml.transit.Artifact;
import net.dpml.transit.Transit;
+import net.dpml.transit.link.LinkManager;
import net.dpml.util.Logger;
import net.dpml.util.DefaultLogger;
@@ -570,7 +571,7 @@
* @param resources the resource to use in path construction
* @return the path
*/
- public Path createPath( Resource[] resources )
+ public Path createPath( Resource[] resources )
{
return createPath( resources, true, false );
}
@@ -612,15 +613,43 @@
private void addToPath( File cache, Path path, Artifact artifact,
boolean resolve )
{
- String location =
Transit.getInstance().getCacheLayout().resolvePath( artifact );
+ Artifact target = getTargetArtifact( artifact );
+ String location =
Transit.getInstance().getCacheLayout().resolvePath( target );
File file = new File( cache, location );
path.createPathElement().setLocation( file );
+
if( resolve )
{
resolveArtifact( artifact );
}
}
+ private Artifact getTargetArtifact( Artifact artifact )
+ {
+ String scheme = artifact.getScheme();
+ if( !Artifact.LINK.equals( scheme ) )
+ {
+ return artifact;
+ }
+ else
+ {
+ try
+ {
+ LinkManager manager = Transit.getInstance().getLinkManager();
+ URI uri = manager.getTargetURI( artifact.toURI() );
+ return Artifact.createArtifact( uri );
+ }
+ catch( IOException e )
+ {
+ final String error =
+ "Unable to resolve link artifact ["
+ + artifact
+ + "].";
+ throw new BuildException( error, e );
+ }
+ }
+ }
+
private void resolveArtifact( Artifact artifact )
{
try
Modified: trunk/main/lang/module/etc/module.xsd
===================================================================
--- trunk/main/lang/module/etc/module.xsd 2006-07-03 04:35:13 UTC (rev
1534)
+++ trunk/main/lang/module/etc/module.xsd 2006-07-03 14:42:38 UTC (rev
1535)
@@ -143,7 +143,7 @@
</sequence>
<attribute name="key" type="string"/>
<attribute name="ref" type="string"/>
- <attribute name="urn" type="string"/>
+ <attribute name="uri" type="string"/>
</complexType>
<complexType name="InfoType">
Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -123,7 +123,7 @@
String path = partition + name;
Logger logger = new DefaultLogger( path );
EventQueue queue = m_controller.getEventQueue();
- return new DefaultComponentModel( queue, logger, classloader,
classpath, this, directive, partition );
+ return new DefaultComponentModel( queue, logger, classloader,
classpath, this, directive, partition, name );
}
catch( RemoteException e )
{
@@ -155,12 +155,28 @@
ClassLoader anchor, Classpath classpath, String partition,
ComponentDirective directive )
throws ControlException
{
+ return createComponentModel( anchor, classpath, partition,
directive, null );
+ }
+
+ /**
+ * Create a new remotely manageable component model.
+ * @param key the component key
+ * @param anchor the parent classloader
+ * @param classpath the classpath definition
+ * @param partition the enclosing partition
+ * @param directive the component definition
+ * @return the managable component model
+ */
+ ComponentModel createComponentModel(
+ ClassLoader anchor, Classpath classpath, String partition,
ComponentDirective directive, String key )
+ throws ControlException
+ {
try
{
Logger logger = new DefaultLogger( partition );
ClassLoader classloader = getClassLoader( anchor, classpath );
EventQueue queue = m_controller.getEventQueue();
- return new DefaultComponentModel( queue, logger, classloader,
classpath, this, directive, partition );
+ return new DefaultComponentModel( queue, logger, classloader,
classpath, this, directive, partition, key );
}
catch( RemoteException e )
{
Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentModel.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentModel.java
2006-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentModel.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -88,7 +88,7 @@
public DefaultComponentModel(
EventQueue queue, Logger logger, ClassLoader classloader, Classpath
classpath, ComponentController controller,
- ComponentDirective directive, String partition )
+ ComponentDirective directive, String partition, String name )
throws ControlException, IOException, RemoteException
{
super( queue, logger );
@@ -100,7 +100,7 @@
m_classname = directive.getClassname();
m_class = m_controller.loadComponentClass( m_classloader,
m_classname );
m_type = m_controller.loadType( m_class );
- m_path = setupPath( partition );
+ m_path = setupPath( partition, name );
m_activation = directive.getActivationPolicy();
m_lifestyle = setupLifestyle();
m_collection = directive.getCollectionPolicy();
@@ -347,16 +347,29 @@
// internals
//
------------------------------------------------------------------------
- private String setupPath( String partition )
+ private String setupPath( final String partition, final String name )
{
- String name = m_directive.getName();
- if( null == name )
+ String local = resolveName( name );
+ return partition + local;
+ }
+
+ private String resolveName( final String name )
+ {
+ if( null != name )
{
- return partition + m_type.getInfo().getName();
+ return name;
}
else
{
- return partition + name;
+ String alt = m_directive.getName();
+ if( null == alt )
+ {
+ return m_type.getInfo().getName();
+ }
+ else
+ {
+ return alt;
+ }
}
}
Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultPartsManager.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultPartsManager.java
2006-07-03 04:35:13 UTC (rev 1534)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultPartsManager.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -79,9 +79,9 @@
if( references.length > 0 )
{
- if( provider.getLogger().isDebugEnabled() )
+ if( provider.getLogger().isTraceEnabled() )
{
- provider.getLogger().debug( "building internal parts" );
+ provider.getLogger().trace( "building internal parts" );
}
}
@@ -127,7 +127,7 @@
Classpath classpath = composition.getClasspath();
ComponentController controller =
handler.getComponentController();
ComponentModel manager =
- controller.createComponentModel( classloader,
classpath, base, directive );
+ controller.createComponentModel( classloader,
classpath, base, directive, key );
ComponentHandler component =
controller.createDefaultComponentHandler( m_provider,
classloader, manager, true );
m_components[i] = component;
@@ -286,7 +286,10 @@
ComponentHandler[] components = getComponentHandlers();
if( components.length > 0 )
{
- m_provider.getLogger().debug( "commissioning internal parts" );
+ if( m_provider.getLogger().isTraceEnabled() )
+ {
+ m_provider.getLogger().trace( "commissioning internal parts"
);
+ }
for( int i=0; i<components.length; i++ )
{
ComponentHandler component = components[i];
@@ -322,7 +325,10 @@
ComponentHandler[] components = getComponentHandlers();
if( components.length > 0 )
{
- m_provider.getLogger().debug( "decommissioning internal parts in
[" + m_provider + "]" );
+ if( m_provider.getLogger().isTraceEnabled() )
+ {
+ m_provider.getLogger().trace( "decommissioning internal
parts" );
+ }
for( int i=0; i<components.length; i++ )
{
ComponentHandler component = components[i];
Modified: trunk/main/planet/http/module.xml
===================================================================
--- trunk/main/planet/http/module.xml 2006-07-03 04:35:13 UTC (rev 1534)
+++ trunk/main/planet/http/module.xml 2006-07-03 14:42:38 UTC (rev 1535)
@@ -16,16 +16,16 @@
<include ref="dpml/metro/dpml-metro-model"/>
<include ref="dpml/util/dpml-logging-api"/>
<include ref="dpml/transit/dpml-transit-main"/>
- <include
urn="artifact:jar:org/mortbay/jetty/servlet-api-2.5#${jetty.version}"
tag="PUBLIC"/>
- <include
urn="artifact:jar:org/mortbay/jetty/jetty-util#${jetty.version}"/>
- <include
urn="artifact:jar:org/mortbay/jetty/jsp-api-2.0#${jetty.version}"/>
- <include
urn="artifact:jar:org/mortbay/jetty/jetty#${jetty.version}"/>
- <include urn="artifact:jar:tomcat/jasper-runtime#${jasper.version}"/>
- <include
urn="artifact:jar:tomcat/jasper-compiler#${jasper.version}"/>
- <include
urn="artifact:jar:tomcat/jasper-compiler-jdt#${jasper.version}"/>
- <include urn="artifact:jar:commons-el/commons-el#1.0"/>
- <include
urn="artifact:jar:org/slf4j/jcl104-over-slf4j#${sl4j.version}"/>
- <include urn="artifact:jar:org/slf4j/slf4j-jdk14#${sl4j.version}"/>
+ <include
uri="artifact:jar:org/mortbay/jetty/servlet-api-2.5#${jetty.version}"
tag="PUBLIC"/>
+ <include
uri="artifact:jar:org/mortbay/jetty/jetty-util#${jetty.version}"/>
+ <include
uri="artifact:jar:org/mortbay/jetty/jsp-api-2.0#${jetty.version}"/>
+ <include
uri="artifact:jar:org/mortbay/jetty/jetty#${jetty.version}"/>
+ <include uri="artifact:jar:tomcat/jasper-runtime#${jasper.version}"/>
+ <include
uri="artifact:jar:tomcat/jasper-compiler#${jasper.version}"/>
+ <include
uri="artifact:jar:tomcat/jasper-compiler-jdt#${jasper.version}"/>
+ <include uri="artifact:jar:commons-el/commons-el#1.0"/>
+ <include
uri="artifact:jar:org/slf4j/jcl104-over-slf4j#${sl4j.version}"/>
+ <include uri="artifact:jar:org/slf4j/slf4j-jdk14#${sl4j.version}"/>
</runtime>
<test>
<include ref="dpml/transit/dpml-transit-main"/>
@@ -41,7 +41,7 @@
</types>
<dependencies>
<runtime>
- <include
urn="artifact:jar:org/mortbay/jetty/servlet-api-2.5#${jetty.version}"
tag="PUBLIC"/>
+ <include
uri="artifact:jar:org/mortbay/jetty/servlet-api-2.5#${jetty.version}"
tag="PUBLIC"/>
</runtime>
</dependencies>
</project>
Modified: trunk/main/planet/http/server/project.xml
===================================================================
--- trunk/main/planet/http/server/project.xml 2006-07-03 04:35:13 UTC (rev
1534)
+++ trunk/main/planet/http/server/project.xml 2006-07-03 14:42:38 UTC (rev
1535)
@@ -142,7 +142,7 @@
<include key="dpml-http-app"/>
</build>
<runtime>
- <include
urn="artifact:jar:org/mortbay/jetty/servlet-api-2.5#${jetty.version}"
tag="PUBLIC"/>
+ <include
uri="artifact:jar:org/mortbay/jetty/servlet-api-2.5#${jetty.version}"
tag="PUBLIC"/>
<include key="dpml-http-impl"/>
</runtime>
</dependencies>
Modified: trunk/main/transit/core/src/main/net/dpml/transit/Artifact.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Artifact.java
2006-07-03 04:35:13 UTC (rev 1534)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Artifact.java
2006-07-03 14:42:38 UTC (rev 1535)
@@ -36,8 +36,14 @@
*/
public final class Artifact implements Serializable, Comparable
{
+ public static final String ARTIFACT = "artifact";
+
+ public static final String LINK = "link";
+
+ public static final String LOCAL = "local";
+
static final long serialVersionUID = 1L;
-
+
//
------------------------------------------------------------------------
// static
//
------------------------------------------------------------------------
@@ -130,7 +136,7 @@
"URI does not declare a scheme: " + uri;
throw new UnsupportedSchemeException( error );
}
- if( !scheme.equals( "artifact" ) && !scheme.equals( "link" ) &&
!scheme.equals( "local" ) )
+ if( !scheme.equals( ARTIFACT ) && !scheme.equals( LINK ) &&
!scheme.equals( LOCAL ) )
{
final String error =
"URI contains a scheme that is not recognized: " + uri;
@@ -155,6 +161,26 @@
public static Artifact createArtifact( String group, String name, String
version, String type )
throws NullArgumentException
{
+ return createArtifact( ARTIFACT, group, name, version, type );
+ }
+
+ /**
+ * Creation of a new artifact instance using a supplied group, name,
+ * version and type arguments.
+ *
+ * @param scheme the artifact scheme
+ * @param group the artifact group identifier
+ * @param name the artifact name
+ * @param version the version
+ * @param type the type
+ * @return the new artifact
+ * @exception NullArgumentException if any of the <code>group</code>,
+ * <code>name</code> or <code>type</code> arguments are
+ * <code>null</code>.
+ */
+ public static Artifact createArtifact( String scheme, String group,
String name, String version, String type )
+ throws NullArgumentException
+ {
if( name == null )
{
throw new NullArgumentException( "name" );
@@ -163,7 +189,11 @@
{
throw new NullArgumentException( "type" );
}
- String composite = buildComposite( group, name, version, type );
+ if( scheme == null )
+ {
+ throw new NullArgumentException( "scheme" );
+ }
+ String composite = buildComposite( scheme, group, name, version,
type );
try
{
URI uri = new URI( composite );
@@ -179,28 +209,28 @@
}
}
- private static String buildComposite( String group, String name, String
version, String type )
+ private static String buildComposite( String scheme, String group,
String name, String version, String type )
{
if( null == group )
{
if( null == version )
{
- return "artifact:" + type + ":" + name;
+ return scheme + ":" + type + ":" + name;
}
else
{
- return "artifact:" + type + ":" + name + "#" + version;
+ return scheme + ":" + type + ":" + name + "#" + version;
}
}
else
{
if( null == version )
{
- return "artifact:" + type + ":" + group + "/" + name;
+ return scheme + ":" + type + ":" + group + "/" + name;
}
else
{
- return "artifact:" + type + ":" + group + "/" + name + "#" +
version;
+ return scheme + ":" + type + ":" + group + "/" + name + "#"
+ version;
}
}
}
@@ -235,17 +265,17 @@
public static boolean isRecognized( URI uri )
{
String scheme = uri.getScheme();
- if( "artifact".equals( scheme ) )
+ if( ARTIFACT.equals( scheme ) )
{
return true;
}
- else if( "link".equals( scheme ) )
+ else if( LINK.equals( scheme ) )
{
return true;
}
else
{
- return "local".equals( scheme );
+ return LOCAL.equals( scheme );
}
}
@@ -434,15 +464,15 @@
public URL toURL()
{
String scheme = getScheme();
- if( "artifact".equals( scheme ) )
+ if( ARTIFACT.equals( scheme ) )
{
return toURL( new net.dpml.transit.artifact.Handler() );
}
- else if( "link".equals( scheme ) )
+ else if( LINK.equals( scheme ) )
{
return toURL( new net.dpml.transit.link.Handler() );
}
- else if( "local".equals( scheme ) )
+ else if( LOCAL.equals( scheme ) )
{
return toURL( new net.dpml.transit.local.Handler() );
}
Modified: trunk/main/util/module.xml
===================================================================
--- trunk/main/util/module.xml 2006-07-03 04:35:13 UTC (rev 1534)
+++ trunk/main/util/module.xml 2006-07-03 14:42:38 UTC (rev 1535)
@@ -36,7 +36,7 @@
<project name="dpml-logging-api" basedir="logging">
<types>
- <type id="jar"/>
+ <type id="jar" alias="true"/>
</types>
</project>
- r1535 - in trunk/main: central/src/docs/depot/library depot depot/library/etc/data/samples depot/library/src/main/net/dpml/library/impl depot/library/src/main/net/dpml/library/info depot/tools/builder/src/main/net/dpml/tools/impl lang/module/etc metro/runtime/src/main/net/dpml/metro/runtime planet/http planet/http/server transit/core/src/main/net/dpml/transit util, mcconnell at BerliOS, 07/03/2006
Archive powered by MHonArc 2.6.24.