notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2064 - in development/laboratory/plus: . api/part/src/main/net/dpml/metro/part standard/builder standard/builder/src/main/net/dpml/metro/builder/impl standard/model/src/main/net/dpml/metro/meta standard/model/src/main/net/dpml/metro/model test/execution
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2064 - in development/laboratory/plus: . api/part/src/main/net/dpml/metro/part standard/builder standard/builder/src/main/net/dpml/metro/builder/impl standard/model/src/main/net/dpml/metro/meta standard/model/src/main/net/dpml/metro/model test/execution
- Date: Mon, 14 Mar 2005 11:39:57 -0500
Author: mcconnell AT dpml.net
Date: Mon Mar 14 11:39:56 2005
New Revision: 2064
Modified:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Registry.java
development/laboratory/plus/index.xml
development/laboratory/plus/standard/builder/build.xml
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentModelBuilderTask.java
development/laboratory/plus/standard/model/src/main/net/dpml/metro/meta/ComponentTypeHandler.java
development/laboratory/plus/standard/model/src/main/net/dpml/metro/model/ComponentPartHandler.java
development/laboratory/plus/test/execution/build.xml
Log:
Modified:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Registry.java
==============================================================================
---
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Registry.java
(original)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Registry.java
Mon Mar 14 11:39:56 2005
@@ -36,14 +36,9 @@
*/
public class Registry extends Descriptor
{
- public static Registry loadRegistry( URI uri ) throws
RegistryNotFoundException, IOException
- {
- URL url = uri.toURL();
- return loadRegistry( url );
- }
-
- public static Registry loadRegistry( URL url ) throws
RegistryNotFoundException, IOException
+ public static Registry loadRegistry( URL url ) throws
RegistryNotFoundException
{
+ System.out.println( "## loading registry: " + url );
try
{
InputStream input = url.openStream();
@@ -59,10 +54,6 @@
{
throw rnfe;
}
- catch( IOException ioe )
- {
- throw ioe;
- }
catch( Throwable e )
{
final String error =
Modified: development/laboratory/plus/index.xml
==============================================================================
--- development/laboratory/plus/index.xml (original)
+++ development/laboratory/plus/index.xml Mon Mar 14 11:39:56 2005
@@ -143,6 +143,7 @@
</info>
<dependencies>
<include key="dpml-metro-part-api"/>
+ <include key="dpml-transit-main"/>
</dependencies>
</project>
Modified: development/laboratory/plus/standard/builder/build.xml
==============================================================================
--- development/laboratory/plus/standard/builder/build.xml (original)
+++ development/laboratory/plus/standard/builder/build.xml Mon Mar 14
11:39:56 2005
@@ -7,12 +7,13 @@
<transit:import uri="artifact:template:dpml/magic/standard"/>
<target name="init" depends="standard.init">
- <x:filter key="dpml-metro-model-api" feature="plugin"
token="TYPE-BUILDER-URI"/>
- <x:filter key="dpml-metro-model-api" feature="plugin"
token="TYPE-HANDLER-URI"/>
- <x:filter key="dpml-metro-model-api" feature="plugin"
token="PART-BUILDER-URI"/>
- <x:filter key="dpml-metro-model-api" feature="plugin"
token="PART-HANDLER-URI"/>
- <x:filter key="dpml-metro-model-api" feature="plugin"
token="CONTROL-BUILDER-URI"/>
- <x:filter key="dpml-metro-model-api" feature="plugin"
token="CONTROL-HANDLER-URI"/>
+ <x:property key="dpml-metro-model-api" feature="uri" type="plugin"
name="model.plugin"/>
+ <filter token="TYPE-HANDLER-URI" value="${model.plugin}"/>
+ <filter token="TYPE-BUILDER-URI" value="${model.plugin}"/>
+ <filter token="PART-HANDLER-URI" value="${model.plugin}"/>
+ <filter token="PART-BUILDER-URI" value="${model.plugin}"/>
+ <filter token="CONTROL-HANDLER-URI" value="${model.plugin}"/>
+ <filter token="CONTROL-BUILDER-URI" value="${model.plugin}"/>
</target>
<target name="package" depends="standard.package">
Modified:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentModelBuilderTask.java
==============================================================================
---
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentModelBuilderTask.java
(original)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentModelBuilderTask.java
Mon Mar 14 11:39:56 2005
@@ -74,7 +74,6 @@
//--------------------------------------------------------------------
private String m_key;
- //private String m_name;
private URI m_registry;
//--------------------------------------------------------------------
@@ -91,19 +90,10 @@
}
/**
- * Set the component part name.
- * @param name component name
- */
- //public void setName( final String name )
- //{
- // m_name = name;
- //}
-
- /**
- * Set the catalog that the part type is declared within. If not defined
- * the value will default to an enclusing catalog uri. If the task is
- * not executing within a catalog an exception will be thrown during
- * task part handling.
+ * Set the registry that the part type is declared within. If not defined
+ * the value will default to an enclosing registry uri. If the task is
+ * not executing within the scope of an enclosing registry element then
+ * an exception will be thrown during task part handling.
*
* @param uri the catalog uri
*/
@@ -153,7 +143,14 @@
throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
BadStrategyException, TypeNotFoundException
{
-System.out.println( "## building part: " + descriptor );
+ if( null != descriptor )
+ {
+ System.out.println( "## building part: " + descriptor );
+ }
+ else
+ {
+ System.out.println( "## building part");
+ }
Type type = resolveType( classloader );
System.out.println( "## resolved type: " + type );
URI registry = resolveRegistryURI();
Modified:
development/laboratory/plus/standard/model/src/main/net/dpml/metro/meta/ComponentTypeHandler.java
==============================================================================
---
development/laboratory/plus/standard/model/src/main/net/dpml/metro/meta/ComponentTypeHandler.java
(original)
+++
development/laboratory/plus/standard/model/src/main/net/dpml/metro/meta/ComponentTypeHandler.java
Mon Mar 14 11:39:56 2005
@@ -24,6 +24,7 @@
import java.io.ObjectInputStream;
import java.rmi.MarshalledObject;
import java.net.URI;
+import java.net.URL;
import net.dpml.metro.part.Type;
import net.dpml.metro.part.TypeHandler;
@@ -34,6 +35,8 @@
import net.dpml.metro.part.RegistryNotFoundException;
import net.dpml.metro.part.TypeNotFoundException;
+import net.dpml.transit.artifact.Handler;
+
/**
* Definition of a type handler.
*
@@ -50,15 +53,24 @@
public Type loadType( TypeReference reference )
throws RegistryNotFoundException, BadStrategyException,
TypeNotFoundException, IOException
{
+ System.out.println( "## loading type reference: " + reference );
+
URI uri = reference.getRegistryURI();
+ URL url = resolveURL( uri );
+ Registry registry = Registry.loadRegistry( url );
String classname = reference.getClassname();
- Registry registry = Registry.loadRegistry( uri );
return registry.getType( this, classname );
}
public Type loadType( URI strategy, byte[] bytes ) throws
BadStrategyException, IOException
{
- // TODO check strategy
+
+ if( getURI().equals( strategy ) == false )
+ {
+ throw new BadStrategyException( strategy );
+ }
+
+ System.out.println( "## loading type with strategy: " + strategy );
try
{
@@ -95,4 +107,15 @@
}
}
+ private URL resolveURL( URI uri ) throws IOException
+ {
+ if( "artifact".equals( uri.getScheme() ) )
+ {
+ return new URL( null, uri.toString(), new Handler() );
+ }
+ else
+ {
+ return uri.toURL();
+ }
+ }
}
Modified:
development/laboratory/plus/standard/model/src/main/net/dpml/metro/model/ComponentPartHandler.java
==============================================================================
---
development/laboratory/plus/standard/model/src/main/net/dpml/metro/model/ComponentPartHandler.java
(original)
+++
development/laboratory/plus/standard/model/src/main/net/dpml/metro/model/ComponentPartHandler.java
Mon Mar 14 11:39:56 2005
@@ -33,6 +33,8 @@
import net.dpml.metro.part.BadStrategyException;
import net.dpml.metro.part.PartNotFoundException;
+import net.dpml.transit.artifact.Handler;
+
/**
* Definition of a type handler.
*
@@ -49,7 +51,12 @@
public Part loadPart( URI uri )
throws BadStrategyException, PartNotFoundException, IOException
{
- URL url = uri.toURL();
+ System.out.println( "## loading part uri: " + uri );
+
+ URL url = resolveURL( uri );
+
+ System.out.println( "## loading part: " + url );
+
InputStream input = url.openStream();
if( null == input )
{
@@ -107,6 +114,18 @@
}
}
+ private URL resolveURL( URI uri ) throws IOException
+ {
+ if( "artifact".equals( uri.getScheme() ) )
+ {
+ return new URL( null, uri.toString(), new Handler() );
+ }
+ else
+ {
+ return uri.toURL();
+ }
+ }
+
private static final URI PART_HANDLER_URI = createStaticURI(
"@PART-HANDLER-URI@" );
private static URI createStaticURI( String path )
Modified: development/laboratory/plus/test/execution/build.xml
==============================================================================
--- development/laboratory/plus/test/execution/build.xml (original)
+++ development/laboratory/plus/test/execution/build.xml Mon Mar 14
11:39:56 2005
@@ -11,10 +11,9 @@
</target>
<target name="package" depends="standard.package">
- <x:property key="dpml-test-hello-impl" feature="plugin"
name="hello.uri"/>
+ <x:property key="dpml-test-hello-impl" feature="uri" type="registry"
name="hello.uri"/>
<component xmlns="plugin:dpml/metro/dpml-metro-builder-impl"
- class="net.dpml.test.hello.impl.HelloComponent"
- registry="${hello.uri}">
+ class="net.dpml.test.hello.impl.HelloComponent"
registry="${hello.uri}">
<parts>
<component class="net.dpml.test.hello.impl.DefaultOutputHandler"
key="OutputHandler"/>
</parts>
- svn commit: r2064 - in development/laboratory/plus: . api/part/src/main/net/dpml/metro/part standard/builder standard/builder/src/main/net/dpml/metro/builder/impl standard/model/src/main/net/dpml/metro/meta standard/model/src/main/net/dpml/metro/model test/execution, mcconnell, 03/13/2005
Archive powered by MHonArc 2.6.24.