Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2154 - in development/main/metro/composition: builder/src/main/net/dpml/composition/builder testing/acme/src/main/net/dpml/composition/testing

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2154 - in development/main/metro/composition: builder/src/main/net/dpml/composition/builder testing/acme/src/main/net/dpml/composition/testing
  • Date: Sat, 26 Mar 2005 18:56:36 -0500

Author: mcconnell AT dpml.net
Date: Sat Mar 26 18:56:36 2005
New Revision: 2154

Modified:

development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java

development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultWidget.java
Log:


Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
Sat Mar 26 18:56:36 2005
@@ -21,6 +21,7 @@
import java.io.File;
import java.io.Serializable;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.Properties;
import java.util.List;
@@ -32,6 +33,10 @@
import java.lang.reflect.Modifier;
import java.net.URI;

+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
import net.dpml.meta.info.Type;
import net.dpml.meta.info.ServiceDescriptor;
import net.dpml.meta.info.DependencyDescriptor;
@@ -46,6 +51,7 @@
import net.dpml.part.BadStrategyException;

import net.dpml.configuration.Configuration;
+import net.dpml.configuration.impl.DefaultConfigurationBuilder;

import net.dpml.parameters.Parameters;

@@ -61,6 +67,7 @@
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Path;

+
/**
* The TypeTask creates a serialized descriptor of a component type.
*
@@ -137,7 +144,7 @@
CategoryDescriptor[] categories = new CategoryDescriptor[0];
ContextDescriptor context = createContextDescriptor( subject );
PartDescriptor[] parts = createPartDescriptors( subject );
- Configuration config = null;
+ Configuration config = createDefaultConfiguration( subject );
return new Type( info, categories, context, services, dependencies,
config, parts );
}

@@ -410,6 +417,34 @@
}
}

+ private Configuration createDefaultConfiguration( Class subject )
+ {
+ final String classname = subject.getName();
+ final ClassLoader classloader = subject.getClassLoader();
+ final String xdefaults = classname.replace( '.', '/' ) + ".xconfig";
+ final InputStream input = classloader.getResourceAsStream( xdefaults
);
+ if( null == input )
+ {
+ return null;
+ }
+ else
+ {
+ try
+ {
+ DefaultConfigurationBuilder builder = new
DefaultConfigurationBuilder();
+ return builder.build( input );
+ }
+ catch( Exception e )
+ {
+ final String error =
+ "An unexpected error occured while resolving the static
configuration ["
+ + xdefaults
+ + "].";
+ throw new BuildException( error, e, getLocation() );
+ }
+ }
+ }
+
private Properties getTypeProperties( Class subject ) throws
IntrospectionException
{
try

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultWidget.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultWidget.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultWidget.java
Sat Mar 26 18:56:36 2005
@@ -21,7 +21,8 @@
import net.dpml.logging.Logger;

/**
- * AbstractCompositionTestCase
+ * Component implementation that demonstrates the use of a context
inner-class.
+ *
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Id: CompositionTestCase.java 1393 2005-01-06 10:27:10Z niclas $
*/



  • svn commit: r2154 - in development/main/metro/composition: builder/src/main/net/dpml/composition/builder testing/acme/src/main/net/dpml/composition/testing, mcconnell, 03/26/2005

Archive powered by MHonArc 2.6.24.

Top of Page