notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2077 - in development/laboratory/plus: . standard/builder/src/main/net/dpml/metro/builder/impl standard/control/src/main/net/dpml/metro/control/impl standard/part/src/main/net/dpml/metro/meta standard/part/src/main/net/dpml/metro/model standard/part/src/main/net/dpml/metro/type test/execution/src/test/net/dpml/test/execution
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2077 - in development/laboratory/plus: . standard/builder/src/main/net/dpml/metro/builder/impl standard/control/src/main/net/dpml/metro/control/impl standard/part/src/main/net/dpml/metro/meta standard/part/src/main/net/dpml/metro/model standard/part/src/main/net/dpml/metro/type test/execution/src/test/net/dpml/test/execution
- Date: Tue, 15 Mar 2005 03:31:45 -0500
Author: mcconnell AT dpml.net
Date: Tue Mar 15 03:31:45 2005
New Revision: 2077
Added:
development/laboratory/plus/standard/part/src/main/net/dpml/metro/meta/Type.java
- copied, changed from r2076,
development/laboratory/plus/standard/part/src/main/net/dpml/metro/meta/ComponentDescriptor.java
Removed:
development/laboratory/plus/standard/part/src/main/net/dpml/metro/meta/ComponentDescriptor.java
development/laboratory/plus/standard/part/src/main/net/dpml/metro/model/
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/Type.java
Modified:
development/laboratory/plus/build.xml
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/ComponentTypeBuilderTask.java
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/RegistryTask.java
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/TypeBuilder.java
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/AbstractController.java
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/ComponentPartController.java
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/ComponentPartHandler.java
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DemoControl.java
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/ComponentTypeHandler.java
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/Registry.java
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/TypeEntry.java
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/TypeHandler.java
development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/HomeTestCase.java
Log:
Modified: development/laboratory/plus/build.xml
==============================================================================
--- development/laboratory/plus/build.xml (original)
+++ development/laboratory/plus/build.xml Tue Mar 15 03:31:45 2005
@@ -5,5 +5,9 @@
<transit:import uri="artifact:template:dpml/magic/reactor"/>
+ <target name="patch">
+ <replace token="net.dpml.metro.type" value="net.dpml.metro.catalog"
includes="**/*.java"/>
+ </target>
+
</project>
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
Tue Mar 15 03:31:45 2005
@@ -33,28 +33,28 @@
import java.util.LinkedList;
import java.util.ArrayList;
-import net.dpml.metro.model.ComponentModel;
import net.dpml.metro.builder.PartBuilder;
import net.dpml.metro.builder.IntrospectionException;
import net.dpml.metro.builder.BuilderRuntimeException;
-import net.dpml.metro.meta.PartDescriptor;
-
import net.dpml.metro.part.Part;
import net.dpml.metro.part.PartHolder;
import net.dpml.metro.part.ServiceDescriptor;
+import net.dpml.metro.control.BadStrategyException;
+
+import net.dpml.metro.meta.ComponentPart;
+import net.dpml.metro.meta.PartDescriptor;
+import net.dpml.metro.meta.Type;
+
import net.dpml.metro.type.Registry;
-import net.dpml.metro.type.Type;
import net.dpml.metro.type.TypeReference;
import net.dpml.metro.type.TypeHandler;
import net.dpml.metro.type.TypeNotFoundException;
import net.dpml.metro.type.RegistryNotFoundException;
import net.dpml.metro.type.ComponentTypeHandler;
-import net.dpml.metro.control.BadStrategyException;
-
import net.dpml.magic.tasks.ProjectTask;
import net.dpml.magic.model.Resource;
import net.dpml.magic.model.ResourceRef;
@@ -170,7 +170,7 @@
Type type = resolveType( classloader );
ServiceDescriptor[] services = type.getServiceDescriptors();
URI registry = resolveRegistryURI();
- String classname = type.getClassname();
+ String classname = type.getInfoDescriptor().getClassname();
TypeReference reference = new TypeReference( registry, classname );
if( null != descriptor )
@@ -178,7 +178,7 @@
//checkTypeMeetsCriteria( reference, descriptor );
}
- return new ComponentModel( PART_HANDLER_URI, reference, services );
+ return new ComponentPart( PART_HANDLER_URI, reference, services );
}
/**
Modified:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentTypeBuilderTask.java
==============================================================================
---
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentTypeBuilderTask.java
(original)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentTypeBuilderTask.java
Tue Mar 15 03:31:45 2005
@@ -29,7 +29,7 @@
import java.lang.reflect.Method;
import java.net.URI;
-import net.dpml.metro.meta.ComponentDescriptor;
+import net.dpml.metro.meta.Type;
import net.dpml.metro.meta.DependencyDescriptor;
import net.dpml.metro.meta.PartDescriptor;
import net.dpml.metro.meta.InfoDescriptor;
@@ -41,7 +41,6 @@
import net.dpml.metro.builder.PartBuilder;
import net.dpml.metro.builder.IntrospectionException;
-import net.dpml.metro.type.Type;
import net.dpml.metro.type.RegistryNotFoundException;
import net.dpml.metro.type.TypeNotFoundException;
@@ -133,7 +132,13 @@
throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
BadStrategyException, TypeNotFoundException
{
- return buildComponentDescriptor( classloader );
+ Class subject = loadSubjectClass( classloader );
+ System.out.println( "## component: " + subject.getName() );
+ InfoDescriptor info = createInfoDescriptor( subject );
+ ServiceDescriptor[] services = createServiceDescriptors( subject );
+ DependencyDescriptor[] dependencies = createDependencyDescriptors(
subject );
+ PartDescriptor[] parts = createPartDescriptors( subject );
+ return new Type( info, services, dependencies, parts );
}
//---------------------------------------------------------------
@@ -151,19 +156,6 @@
return m_classname;
}
- public ComponentDescriptor buildComponentDescriptor( ClassLoader
classloader )
- throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
- BadStrategyException, TypeNotFoundException
- {
- Class subject = loadSubjectClass( classloader );
- System.out.println( "## component: " + subject.getName() );
- InfoDescriptor info = createInfoDescriptor( subject );
- ServiceDescriptor[] services = createServiceDescriptors( subject );
- DependencyDescriptor[] dependencies = createDependencyDescriptors(
subject );
- PartDescriptor[] parts = createPartDescriptors( subject );
- return new ComponentDescriptor( info, services, dependencies, parts
);
- }
-
private InfoDescriptor createInfoDescriptor( Class subject )
{
String classname = subject.getName();
Modified:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/RegistryTask.java
==============================================================================
---
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/RegistryTask.java
(original)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/RegistryTask.java
Tue Mar 15 03:31:45 2005
@@ -34,7 +34,8 @@
import java.util.LinkedList;
import java.util.ArrayList;
-import net.dpml.metro.type.Type;
+import net.dpml.metro.meta.Type;
+
import net.dpml.metro.type.Registry;
import net.dpml.metro.type.TypeEntry;
@@ -216,7 +217,7 @@
{
Type type = builder.buildType( classloader );
System.out.println( "# type " + type );
- String classname = type.getClassname();
+ String classname = type.getInfoDescriptor().getClassname();
byte[] bytes = SerializableObjectHelper.writeToByteArray(
type );
entries[i] = new TypeEntry( strategy, classname, bytes );
}
Modified:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/TypeBuilder.java
==============================================================================
---
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/TypeBuilder.java
(original)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/TypeBuilder.java
Tue Mar 15 03:31:45 2005
@@ -26,9 +26,9 @@
import net.dpml.metro.control.BadStrategyException;
+import net.dpml.metro.meta.Type;
import net.dpml.metro.type.TypeNotFoundException;
import net.dpml.metro.type.RegistryNotFoundException;
-import net.dpml.metro.type.Type;
/**
* The contract for builders that create component part.
Modified:
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/AbstractController.java
==============================================================================
---
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/AbstractController.java
(original)
+++
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/AbstractController.java
Tue Mar 15 03:31:45 2005
@@ -24,7 +24,6 @@
import java.util.Hashtable;
import net.dpml.metro.part.Part;
-import net.dpml.metro.model.ComponentModel;
import net.dpml.metro.control.Control;
import net.dpml.metro.control.PartHandler;
Modified:
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/ComponentPartController.java
==============================================================================
---
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/ComponentPartController.java
(original)
+++
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/ComponentPartController.java
Tue Mar 15 03:31:45 2005
@@ -27,7 +27,6 @@
import java.util.WeakHashMap;
import net.dpml.metro.part.Part;
-import net.dpml.metro.model.ComponentModel;
import net.dpml.metro.control.PartHandler;
import net.dpml.metro.control.Controller;
Modified:
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/ComponentPartHandler.java
==============================================================================
---
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/ComponentPartHandler.java
(original)
+++
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/ComponentPartHandler.java
Tue Mar 15 03:31:45 2005
@@ -37,6 +37,8 @@
import net.dpml.metro.control.HandlerNotFoundException;
import net.dpml.metro.control.DelegationException;
+import net.dpml.metro.type.ComponentTypeHandler;
+
import net.dpml.transit.artifact.Handler;
import net.dpml.transit.repository.StandardLoader;
import net.dpml.transit.TransitException;
@@ -47,7 +49,7 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
*/
-public abstract class ComponentPartHandler implements PartHandler
+public abstract class ComponentPartHandler extends ComponentTypeHandler
implements PartHandler
{
/**
* Map containing the foreign part handlers. The map keys
Modified:
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DemoControl.java
==============================================================================
---
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DemoControl.java
(original)
+++
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DemoControl.java
Tue Mar 15 03:31:45 2005
@@ -22,7 +22,6 @@
import java.net.URISyntaxException;
import net.dpml.metro.part.Part;
-import net.dpml.metro.model.ComponentModel;
import net.dpml.metro.control.PartHandler;
import net.dpml.metro.control.Control;
Copied:
development/laboratory/plus/standard/part/src/main/net/dpml/metro/meta/Type.java
(from r2076,
development/laboratory/plus/standard/part/src/main/net/dpml/metro/meta/ComponentDescriptor.java)
==============================================================================
---
development/laboratory/plus/standard/part/src/main/net/dpml/metro/meta/ComponentDescriptor.java
(original)
+++
development/laboratory/plus/standard/part/src/main/net/dpml/metro/meta/Type.java
Tue Mar 15 03:31:45 2005
@@ -21,7 +21,6 @@
import java.io.Serializable;
import java.util.Properties;
-import net.dpml.metro.type.Type;
import net.dpml.metro.part.Descriptor;
import net.dpml.metro.part.ServiceDescriptor;
@@ -31,7 +30,7 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
*/
-public class ComponentDescriptor extends Descriptor implements Type
+public class Type extends Descriptor
{
//------------------------------------------------------------------------------
// state
@@ -46,13 +45,13 @@
// constructors
//------------------------------------------------------------------------------
- public ComponentDescriptor( final InfoDescriptor info,
ServiceDescriptor[] services,
+ public Type( final InfoDescriptor info, ServiceDescriptor[] services,
DependencyDescriptor[] dependencies, PartDescriptor[] parts )
{
this( info, services, dependencies, parts, null );
}
- public ComponentDescriptor( final InfoDescriptor info,
ServiceDescriptor[] services,
+ public Type( final InfoDescriptor info, ServiceDescriptor[] services,
DependencyDescriptor[] dependencies, PartDescriptor[] parts,
Properties properties )
{
super( properties );
@@ -82,15 +81,6 @@
// Type
//------------------------------------------------------------------------------
- public String getClassname()
- {
- return getInfoDescriptor().getClassname();
- }
-
-
//------------------------------------------------------------------------------
- // ComponentDescriptor
-
//------------------------------------------------------------------------------
-
public InfoDescriptor getInfoDescriptor()
{
return m_info;
@@ -144,22 +134,22 @@
{
return false;
}
- else if( other instanceof ComponentDescriptor )
+ else if( other instanceof Type )
{
- ComponentDescriptor component = (ComponentDescriptor) other;
- if( false == getInfoDescriptor().equals(
component.getInfoDescriptor() ) )
+ Type type= (Type) other;
+ if( false == getInfoDescriptor().equals(
type.getInfoDescriptor() ) )
{
return false;
}
- else if( false == equals( getDependencyDescriptors(),
component.getDependencyDescriptors() ) )
+ else if( false == equals( getDependencyDescriptors(),
type.getDependencyDescriptors() ) )
{
return false;
}
- else if( false == equals( getServiceDescriptors(),
component.getServiceDescriptors() ) )
+ else if( false == equals( getServiceDescriptors(),
type.getServiceDescriptors() ) )
{
return false;
}
- else if( false == equals( getPartDescriptors(),
component.getPartDescriptors() ) )
+ else if( false == equals( getPartDescriptors(),
type.getPartDescriptors() ) )
{
return false;
}
@@ -176,6 +166,6 @@
public String toString()
{
- return "component#" + getInfoDescriptor().getClassname();
+ return "type#" + getInfoDescriptor().getClassname();
}
}
Modified:
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/ComponentTypeHandler.java
==============================================================================
---
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/ComponentTypeHandler.java
(original)
+++
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/ComponentTypeHandler.java
Tue Mar 15 03:31:45 2005
@@ -26,7 +26,8 @@
import java.net.URI;
import java.net.URL;
-import net.dpml.metro.type.Type;
+import net.dpml.metro.meta.Type;
+
import net.dpml.metro.type.TypeHandler;
import net.dpml.metro.type.TypeHandlerRuntimeException;
import net.dpml.metro.type.TypeReference;
@@ -34,8 +35,6 @@
import net.dpml.metro.type.RegistryNotFoundException;
import net.dpml.metro.type.TypeNotFoundException;
-import net.dpml.metro.meta.ComponentDescriptor;
-
import net.dpml.metro.control.BadStrategyException;
import net.dpml.transit.artifact.Handler;
@@ -73,7 +72,7 @@
{
ByteArrayInputStream input = new ByteArrayInputStream( bytes );
ObjectInputStream stream = new ObjectInputStream( input );
- return (ComponentDescriptor) stream.readObject();
+ return (Type) stream.readObject();
}
catch( IOException e )
{
@@ -82,9 +81,7 @@
catch( Throwable e )
{
final String error =
- "Unexpected error while attempting to load a type (strategy: "
- + strategy
- + ") from a byte array.";
+ "Unexpected error while attempting to load a type from a byte
array.";
throw new TypeHandlerRuntimeException( error, e );
}
}
Modified:
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/Registry.java
==============================================================================
---
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/Registry.java
(original)
+++
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/Registry.java
Tue Mar 15 03:31:45 2005
@@ -30,6 +30,8 @@
import net.dpml.metro.part.Descriptor;
+import net.dpml.metro.meta.Type;
+
import net.dpml.metro.control.BadStrategyException;
/**
Modified:
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/TypeEntry.java
==============================================================================
---
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/TypeEntry.java
(original)
+++
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/TypeEntry.java
Tue Mar 15 03:31:45 2005
@@ -23,6 +23,8 @@
import java.io.IOException;
import java.net.URI;
+import net.dpml.metro.meta.Type;
+
import net.dpml.metro.part.Holder;
import net.dpml.metro.control.BadStrategyException;
Modified:
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/TypeHandler.java
==============================================================================
---
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/TypeHandler.java
(original)
+++
development/laboratory/plus/standard/part/src/main/net/dpml/metro/type/TypeHandler.java
Tue Mar 15 03:31:45 2005
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.net.URI;
+import net.dpml.metro.meta.Type;
import net.dpml.metro.control.BadStrategyException;
/**
Modified:
development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/HomeTestCase.java
==============================================================================
---
development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/HomeTestCase.java
(original)
+++
development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/HomeTestCase.java
Tue Mar 15 03:31:45 2005
@@ -47,6 +47,7 @@
//--------------------------------------------------------------------
private Controller m_controller;
+ private Model m_model;
//--------------------------------------------------------------------
// TestCase
@@ -55,12 +56,15 @@
public void setUp() throws Exception
{
m_controller = new ComponentPartController();
+ m_model = m_controller.addPart( HELLO_PART_URI );
+ System.out.println( "#model: " + m_model );
}
- public void testHome() throws Exception
+ public void testSetName() throws Exception
{
- Model model = m_controller.addPart( HELLO_PART_URI );
- System.out.println( "#model: " + model );
+ String name = "demo";
+ m_model.setName( name );
+ assertEquals( "name", name, m_model.getName() );
}
//--------------------------------------------------------------------
- svn commit: r2077 - in development/laboratory/plus: . standard/builder/src/main/net/dpml/metro/builder/impl standard/control/src/main/net/dpml/metro/control/impl standard/part/src/main/net/dpml/metro/meta standard/part/src/main/net/dpml/metro/model standard/part/src/main/net/dpml/metro/type test/execution/src/test/net/dpml/test/execution, mcconnell, 03/14/2005
Archive powered by MHonArc 2.6.24.