Skip to Content.
Sympa Menu

notify-dpml - r1636 - in trunk: main/depot/tools/builder/src/main/net/dpml/tools/tasks main/metro main/metro/component/src/main/net/dpml/component main/metro/model/src/main/net/dpml/metro/data main/metro/runtime/src/main/net/dpml/metro/runtime main/transit/core/src/main/net/dpml/lang main/transit/core/src/main/net/dpml/transit main/transit/core/src/main/net/dpml/util tutorials/components tutorials/components/customize tutorials/components/customize/custom tutorials/components/customize/custom/etc tutorials/components/customize/custom/etc/data tutorials/components/customize/custom/src tutorials/components/customize/custom/src/main tutorials/components/customize/custom/src/main/org tutorials/components/customize/custom/src/main/org/acme tutorials/components/customize/custom/src/main/org/acme/extra tutorials/components/import

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: r1636 - in trunk: main/depot/tools/builder/src/main/net/dpml/tools/tasks main/metro main/metro/component/src/main/net/dpml/component main/metro/model/src/main/net/dpml/metro/data main/metro/runtime/src/main/net/dpml/metro/runtime main/transit/core/src/main/net/dpml/lang main/transit/core/src/main/net/dpml/transit main/transit/core/src/main/net/dpml/util tutorials/components tutorials/components/customize tutorials/components/customize/custom tutorials/components/customize/custom/etc tutorials/components/customize/custom/etc/data tutorials/components/customize/custom/src tutorials/components/customize/custom/src/main tutorials/components/customize/custom/src/main/org tutorials/components/customize/custom/src/main/org/acme tutorials/components/customize/custom/src/main/org/acme/extra tutorials/components/import
  • Date: Sun, 23 Jul 2006 19:52:39 +0200

Author: mcconnell
Date: 2006-07-23 19:52:05 +0200 (Sun, 23 Jul 2006)
New Revision: 1636

Added:
trunk/tutorials/components/customize/custom/etc/
trunk/tutorials/components/customize/custom/etc/data/
trunk/tutorials/components/customize/custom/etc/data/logging.properties
trunk/tutorials/components/customize/custom/src/main/
trunk/tutorials/components/customize/custom/src/main/org/
trunk/tutorials/components/customize/custom/src/main/org/acme/
trunk/tutorials/components/customize/custom/src/main/org/acme/extra/

trunk/tutorials/components/customize/custom/src/main/org/acme/extra/Customizer.java
Removed:
trunk/tutorials/components/customize/module.xml
trunk/tutorials/components/import/module.xml
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
trunk/main/metro/component/src/main/net/dpml/component/Composition.java
trunk/main/metro/model/src/main/net/dpml/metro/data/DefaultComposition.java
trunk/main/metro/module.xml

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionClassLoader.java

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
trunk/main/transit/core/src/main/net/dpml/lang/Builder.java
trunk/main/transit/core/src/main/net/dpml/lang/Part.java
trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
trunk/main/transit/core/src/main/net/dpml/lang/StandardClassLoader.java
trunk/main/transit/core/src/main/net/dpml/lang/SystemClassLoader.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheHandler.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
trunk/main/transit/core/src/main/net/dpml/util/StandardFormatter.java
trunk/tutorials/components/module.xml
Log:
general improvement in logging messages and resolution of duplication
controller classloader creation issue

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
2006-07-23 06:21:33 UTC (rev 1635)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -310,13 +310,7 @@
protected Context getContext( Project project )
{
Context context = (Context) project.getReference( "project.context"
);
- if( null == context )
- {
- final String error =
- "Missing project context reference.";
- throw new BuildException( error );
- }
- context.getPath( Scope.TEST ); // triggers path initialization
+ context.init();
return context;
}
}

Modified:
trunk/main/metro/component/src/main/net/dpml/component/Composition.java
===================================================================
--- trunk/main/metro/component/src/main/net/dpml/component/Composition.java
2006-07-23 06:21:33 UTC (rev 1635)
+++ trunk/main/metro/component/src/main/net/dpml/component/Composition.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -48,13 +48,14 @@
* @param classpath the part classpath definition
* @param controller the part controller
* @param directive the part deployment strategy directive
+ * @param label debug label
* @exception IOException if an I/O error occurs
*/
public Composition(
Logger logger, Info info, Classpath classpath, Controller controller,
- Directive directive ) throws IOException
+ Directive directive, String label ) throws IOException
{
- super( logger, info, classpath );
+ super( logger, info, classpath, label );

if( null == directive )
{

Modified:
trunk/main/metro/model/src/main/net/dpml/metro/data/DefaultComposition.java
===================================================================
---
trunk/main/metro/model/src/main/net/dpml/metro/data/DefaultComposition.java
2006-07-23 06:21:33 UTC (rev 1635)
+++
trunk/main/metro/model/src/main/net/dpml/metro/data/DefaultComposition.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -55,7 +55,7 @@
Logger logger, Info info, Classpath classpath, Controller controller,
ComponentDirective directive )
throws IOException
{
- super( logger, info, classpath, controller, directive );
+ super( logger, info, classpath, controller, directive,
directive.getName() );

m_directive = directive;
}
@@ -80,7 +80,7 @@
ComponentEncoder encoder = new ComponentEncoder();
encoder.writeComponent( writer, m_directive, pad );
}
-
+
/**
* Return true if this object is equal to the supplied object.
* @param other the object to evaluate

Modified: trunk/main/metro/module.xml
===================================================================
--- trunk/main/metro/module.xml 2006-07-23 06:21:33 UTC (rev 1635)
+++ trunk/main/metro/module.xml 2006-07-23 17:52:05 UTC (rev 1636)
@@ -68,7 +68,7 @@
</project>

<project name="dpml-metro-runtime" basedir="runtime">
- <info title="Metro Container Runtime">
+ <info title="Metro Runtime">
<description>
DPML Component management platform runtime container.
</description>

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-23 06:21:33 UTC (rev 1635)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -102,9 +102,9 @@
* @param classpath the part classpath definition
* @exception IOException if an IO error occurs during classpath
evaluation
*/
- public ClassLoader getClassLoader( ClassLoader anchor, Classpath
classpath ) throws IOException
+ public ClassLoader getClassLoader( String name, ClassLoader anchor,
Classpath classpath ) throws IOException
{
- return getCompositionController().getClassLoader( anchor, classpath
);
+ return getCompositionController().getClassLoader( name, anchor,
classpath );
}

/**
@@ -141,7 +141,7 @@
throw new ControllerException( error, e );
}
}
-
+

//--------------------------------------------------------------------------
// ComponentController

//--------------------------------------------------------------------------
@@ -162,7 +162,8 @@
try
{
Logger logger = new DefaultLogger( partition );
- ClassLoader classloader = getClassLoader( anchor, classpath );
+ String path = partition + "/" + key;
+ ClassLoader classloader = getClassLoader( path, anchor,
classpath );
EventQueue queue = m_controller.getEventQueue();
return new DefaultComponentModel(
queue, logger, classloader, classpath, this, directive,
partition, key );
@@ -184,37 +185,37 @@
/**
* Create a new top-level runtime handler using a supplied anchor
classloader and context.
* @param classloader the anchor classloader
- * @param context the managed context
+ * @param model the component model
* @param flag TRUE if this is a managed model
* @return the runtime handler
*/
DefaultComponentHandler createDefaultComponentHandler(
- ClassLoader classloader, ComponentModel context, boolean flag ) throws
ControlException
+ ClassLoader classloader, ComponentModel model, boolean flag ) throws
ControlException
{
- return createDefaultComponentHandler( null, classloader, context,
flag );
+ return createDefaultComponentHandler( null, classloader, model, flag
);
}

/**
* Create a new runtime handler using a supplied parent, anchor and
context.
* @param parent the parent handler
* @param anchor the anchor classloader
- * @param context the managed context
+ * @param model the component model
* @param flag TRUE if the supplied model is managed by the handler
* @return the runtime handler
*/
DefaultComponentHandler createDefaultComponentHandler(
- Provider parent, ClassLoader anchor, ComponentModel context, boolean
flag )
+ Provider parent, ClassLoader anchor, ComponentModel model, boolean
flag )
throws ControlException
{
try
{
- final String name = context.getName();
- final String path = context.getContextPath();
+ final String name = model.getName();
+ final String path = model.getContextPath();
Logger logger = new DefaultLogger( path );
- Classpath classpath = context.getClasspath();
- ClassLoader classloader = resolveClassLoader( anchor, context );
+ Classpath classpath = model.getClasspath();
+ ClassLoader classloader = resolveClassLoader( anchor, model );
EventQueue queue = m_controller.getEventQueue();
- return new DefaultComponentHandler( queue, parent, classloader,
logger, this, context, flag );
+ return new DefaultComponentHandler( queue, parent, classloader,
logger, this, model, flag );
}
catch( RemoteException e )
{
@@ -244,9 +245,10 @@
}
else
{
- getLogger().debug( "building new classloader (remote mode) for "
+ model.getContextPath() );
+ String path = model.getContextPath();
+ getLogger().debug( "building new classloader (remote mode) for "
+ path );
Classpath classpath = model.getClasspath();
- return getClassLoader( anchor, classpath );
+ return getClassLoader( path, anchor, classpath );
}
}


Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionClassLoader.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionClassLoader.java
2006-07-23 06:21:33 UTC (rev 1635)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionClassLoader.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -30,6 +30,7 @@
import net.dpml.transit.Artifact;
import net.dpml.transit.UnsupportedSchemeException;

+import net.dpml.util.Logger;

/**
* A named classloader.
@@ -49,12 +50,13 @@
// constructor
//--------------------------------------------------------------------

- public CompositionClassLoader(
- URI uri, Category category, ClassLoader management, ClassLoader client
)
+ public CompositionClassLoader( Logger logger, String label, Category
category, ClassLoader management, ClassLoader client )
{
- super( uri, category, new URL[0], client );
+ super( label, category, new URL[0], client );

m_base = management;
+
+ classloaderConstructed( logger, label, category, this );
}

//--------------------------------------------------------------------
@@ -86,6 +88,15 @@
}

//--------------------------------------------------------------------
+ // impl
+ //--------------------------------------------------------------------
+
+ ClassLoader getInterceptionClassLoader()
+ {
+ return m_base;
+ }
+
+ //--------------------------------------------------------------------
// static utilities
//--------------------------------------------------------------------

@@ -166,4 +177,34 @@
return true;
}
}
+
+ /**
+ * Handle notification of the creation of a new classloader.
+ * @param label the classloader label
+ * @param category the classloader category
+ * @param classloader the new classloader to report
+ */
+ private static void classloaderConstructed(
+ Logger logger, String label, Category category, CompositionClassLoader
classloader )
+ {
+ if( logger.isTraceEnabled() )
+ {
+ int id = System.identityHashCode( classloader );
+ StringBuffer buffer = new StringBuffer();
+ buffer.append( "created new " );
+ buffer.append( category.toString() );
+ buffer.append( " interception classloader for " + label );
+ buffer.append( "\n id: " + id );
+ ClassLoader interceptor =
classloader.getInterceptionClassLoader();
+ int iid = System.identityHashCode( interceptor );
+ buffer.append( "\n interceptor: " + iid );
+ ClassLoader parent = classloader.getParent();
+ if( null != parent )
+ {
+ int pid = System.identityHashCode( parent );
+ buffer.append( "\n extends: " + pid );
+ }
+ logger.trace( buffer.toString() );
+ }
+ }
}

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
2006-07-23 06:21:33 UTC (rev 1635)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -18,6 +18,7 @@

package net.dpml.metro.runtime;

+import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
@@ -69,6 +70,8 @@
*/
public static final URI CONTROLLER_URI = createStaticURI(
"@PART-HANDLER-URI@" );

+ private static final String BASEPATH = setupBasePathSpec();
+
static final URI ROOT_URI = createStaticURI( "metro:/" );

//--------------------------------------------------------------------
@@ -163,9 +166,8 @@
{
if( getLogger().isTraceEnabled() )
{
- getLogger().trace(
- "building strategy"
- + "\n URI: " + info.getURI() );
+ String path = getPartSpec( info.getURI() );
+ getLogger().trace( "new composition: " + path );
}
ClassLoader context = Thread.currentThread().getContextClassLoader();
try
@@ -194,36 +196,32 @@
* @return the new classloader
* @exception IOException if an IO error occurs during classpath
evaluation
*/
- public ClassLoader getClassLoader( ClassLoader anchor, Classpath
classpath ) throws IOException
+ public ClassLoader getClassLoader( String name, ClassLoader anchor,
Classpath classpath ) throws IOException
{
if( null == classpath )
{
return anchor;
}

- ClassLoader management = ComponentDirective.class.getClassLoader();
+ ClassLoader base = anchor;
+ Logger logger = getLogger();

- ClassLoader composer =
- new CompositionClassLoader( null, Category.PROTECTED, management,
anchor );
-
- URI[] apis = classpath.getDependencies( Category.PUBLIC );
- ClassLoader api = StandardClassLoader.buildClassLoader( null,
Category.PUBLIC, composer, apis );
- if( api != composer )
+ try
{
- classloaderConstructed( Category.PUBLIC, api );
+ base.loadClass( ComponentDirective.class.getName() );
}
- URI[] spis = classpath.getDependencies( Category.PROTECTED );
- ClassLoader spi = StandardClassLoader.buildClassLoader( null,
Category.PROTECTED, api, spis );
- if( spi != api )
+ catch( ClassNotFoundException e )
{
- classloaderConstructed( Category.PROTECTED, spi );
+ ClassLoader management =
ComponentDirective.class.getClassLoader();
+ base = new CompositionClassLoader( logger, name,
Category.PROTECTED, management, anchor );
}
+
+ URI[] apis = classpath.getDependencies( Category.PUBLIC );
+ ClassLoader api = StandardClassLoader.buildClassLoader( logger,
name, Category.PUBLIC, base, apis );
+ URI[] spis = classpath.getDependencies( Category.PROTECTED );
+ ClassLoader spi = StandardClassLoader.buildClassLoader( logger,
name, Category.PROTECTED, api, spis );
URI[] imps = classpath.getDependencies( Category.PRIVATE );
- ClassLoader impl = StandardClassLoader.buildClassLoader( null,
Category.PRIVATE, spi, imps );
- if( impl != spi )
- {
- classloaderConstructed( Category.PRIVATE, impl );
- }
+ ClassLoader impl = StandardClassLoader.buildClassLoader( logger,
name, Category.PRIVATE, spi, imps );
return impl;
}

@@ -232,7 +230,7 @@
* @param category the classloader category (public, protected or private)
* @param classloader the new classloader
*/
- public void classloaderConstructed( Category category, ClassLoader
classloader )
+ public void classloaderConstructed( String name, Category category,
ClassLoader classloader )
{
if( getLogger().isDebugEnabled() )
{
@@ -240,8 +238,21 @@
StringBuffer buffer = new StringBuffer();
buffer.append( "created " );
buffer.append( category.toString() );
- buffer.append( " classloader" );
+ buffer.append( " classloader for " + name );
buffer.append( "\n ID: " + id );
+ if( classloader instanceof CompositionClassLoader )
+ {
+ CompositionClassLoader loader = (CompositionClassLoader)
classloader;
+ ClassLoader interceptor =
loader.getInterceptionClassLoader();
+ int pid = System.identityHashCode( interceptor );
+ buffer.append( "\n interceptor: " + pid );
+ }
+ ClassLoader parent = classloader.getParent();
+ if( null != parent )
+ {
+ int pid = System.identityHashCode( parent );
+ buffer.append( "\n extends: " + pid );
+ }
if( classloader instanceof URLClassLoader )
{
URLClassLoader loader = (URLClassLoader) classloader;
@@ -399,7 +410,8 @@
ClassLoader anchor = Logger.class.getClassLoader();
ComponentModel componentModel = (ComponentModel) model;
Classpath classpath = componentModel.getClasspath();
- ClassLoader classloader = getClassLoader( anchor, classpath );
+ String name = componentModel.getName();
+ ClassLoader classloader = getClassLoader( name, anchor,
classpath );
return m_controller.createDefaultComponentHandler( classloader,
componentModel, flag );
}
else
@@ -510,4 +522,33 @@
dispose();
}
}
+
+ static String setupBasePathSpec()
+ {
+ try
+ {
+ String path = System.getProperty( "user.dir" );
+ File file = new File( path );
+ URI uri = file.toURI();
+ URL url = file.toURL();
+ return url.toString();
+ }
+ catch( Exception e )
+ {
+ return e.toString();
+ }
+ }
+
+ private static String getPartSpec( URI uri )
+ {
+ String path = uri.toASCIIString();
+ if( path.startsWith( BASEPATH ) )
+ {
+ return "./" + path.substring( BASEPATH.length() );
+ }
+ else
+ {
+ return path;
+ }
+ }
}

Modified: trunk/main/transit/core/src/main/net/dpml/lang/Builder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/Builder.java 2006-07-23
06:21:33 UTC (rev 1635)
+++ trunk/main/transit/core/src/main/net/dpml/lang/Builder.java 2006-07-23
17:52:05 UTC (rev 1636)
@@ -33,16 +33,6 @@
public interface Builder
{
/**
- * Construct a new part.
- * @param info the part information descriptor
- * @param classpath the part classpath descriptor
- * @param strategy the DOM element definining the deployment strategy
- * @return the part definition
- * @exception IOException if an I/O error occurs
- */
- //Part build( Info info, Classpath classpath, Element strategy ) throws
IOException;
-
- /**
* Construct a new part using a supplied value resolver.
* @param info the part information descriptor
* @param classpath the part classpath descriptor

Modified: trunk/main/transit/core/src/main/net/dpml/lang/Part.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/Part.java 2006-07-23
06:21:33 UTC (rev 1635)
+++ trunk/main/transit/core/src/main/net/dpml/lang/Part.java 2006-07-23
17:52:05 UTC (rev 1636)
@@ -102,10 +102,24 @@
* @param logger the logging channel
* @param info the info descriptor
* @param classpath the part classpath definition
+ * @param label debug label
* @exception IOException if an I/O error occurs
*/
public Part( Logger logger, Info info, Classpath classpath ) throws
IOException
{
+ this( logger, info, classpath, null );
+ }
+
+ /**
+ * Creation of a new part datastructure.
+ * @param logger the logging channel
+ * @param info the info descriptor
+ * @param classpath the part classpath definition
+ * @param label debug label
+ * @exception IOException if an I/O error occurs
+ */
+ public Part( Logger logger, Info info, Classpath classpath, String label
) throws IOException
+ {
super();
if( null == info )
{
@@ -118,7 +132,7 @@
m_logger = logger;
m_info = info;
m_classpath = classpath;
- m_classloader = buildClassLoader();
+ m_classloader = buildClassLoader( label );
}

/**
@@ -339,16 +353,33 @@
return m_logger;
}

- private ClassLoader buildClassLoader() throws IOException
+ private ClassLoader buildClassLoader( String label ) throws IOException
{
ClassLoader base = getAnchorClassLoader();
Classpath classpath = getClasspath();
- return newClassLoader( base, classpath );
+ String tag = getLabel( label );
+ return newClassLoader( base, classpath, tag );
}

- private ClassLoader newClassLoader( ClassLoader base, Classpath
classpath ) throws IOException
+ private String getLabel( String label )
{
- URI uri = getInfo().getURI();
+ if( null != label )
+ {
+ return label;
+ }
+ if( null != getInfo().getTitle() )
+ {
+ return getInfo().getTitle();
+ }
+ else
+ {
+ return PartDecoder.getPartSpec( getInfo().getURI() );
+ }
+ }
+
+ private ClassLoader newClassLoader( ClassLoader base, Classpath
classpath, String label ) throws IOException
+ {
+ Logger logger = getLogger();
URI[] uris = classpath.getDependencies( Category.SYSTEM );
if( uris.length > 0 )
{
@@ -356,24 +387,11 @@
}

URI[] apis = classpath.getDependencies( Category.PUBLIC );
- ClassLoader api = StandardClassLoader.buildClassLoader( uri,
Category.PUBLIC, base, apis );
- if( api != base )
- {
- classloaderConstructed( Category.PUBLIC, api );
- }
+ ClassLoader api = StandardClassLoader.buildClassLoader( logger,
label, Category.PUBLIC, base, apis );
URI[] spis = classpath.getDependencies( Category.PROTECTED );
- ClassLoader spi = StandardClassLoader.buildClassLoader( uri,
Category.PROTECTED, api, spis );
- if( spi != api )
- {
- classloaderConstructed( Category.PROTECTED, spi );
- }
+ ClassLoader spi = StandardClassLoader.buildClassLoader( logger,
label, Category.PROTECTED, api, spis );
URI[] imps = classpath.getDependencies( Category.PRIVATE );
- ClassLoader impl = StandardClassLoader.buildClassLoader( uri,
Category.PRIVATE, spi, imps );
- if( impl != spi )
- {
- classloaderConstructed( Category.PRIVATE, impl );
- }
- return impl;
+ return StandardClassLoader.buildClassLoader( logger, label,
Category.PRIVATE, spi, imps );
}

private ClassLoader getAnchorClassLoader()
@@ -414,10 +432,12 @@

/**
* Handle notification of the creation of a new classloader.
+ * @param label the classloader label
* @param category the classloader category
* @param classloader the new classloader to report
*/
- private void classloaderConstructed( Category category, ClassLoader
classloader )
+ /*
+ private void classloaderConstructed( String label, Category category,
ClassLoader classloader )
{
if( getLogger().isDebugEnabled() )
{
@@ -427,7 +447,7 @@
buffer.append( category.toString() );
buffer.append( " classloader" );
buffer.append( "\n ID: " + id );
- buffer.append( "\n URI: " + m_info.getURI().toString() );
+ buffer.append( "\n Label: " + label + " " + category );
ClassLoader parent = classloader.getParent();
if( null != parent )
{
@@ -446,7 +466,8 @@
getLogger().debug( buffer.toString() );
}
}
-
+ */
+
/**
* Handle notification of system classloader expansion.
* @param uris the array of uris added to the system classloader

Modified: trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
2006-07-23 06:21:33 UTC (rev 1635)
+++ trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -18,8 +18,10 @@

package net.dpml.lang;

+import java.io.File;
import java.io.IOException;
import java.net.URI;
+import java.net.URL;
import java.util.Map;
import java.util.Hashtable;
import java.lang.ref.WeakReference;
@@ -57,6 +59,8 @@

private static final PartDecoder DECODER = new PartDecoder();

+ private static final String BASEPATH = setupBasePathSpec();
+
/**
* Get the singleton instance of the part decoder.
* @return the decoder instance.
@@ -91,15 +95,26 @@
}
if( getLogger().isDebugEnabled() )
{
- getLogger().debug( "loading part [" + uri + "]" );
+ String path = getPartSpec( uri );
+ if( getLogger().isTraceEnabled() )
+ {
+ if( cache )
+ {
+ getLogger().trace( "loading part (cache enabled): " +
path );
+ }
+ else
+ {
+ getLogger().trace( "loading part (cache disabled): " +
path );
+ }
+ }
+ else
+ {
+ getLogger().debug( "loading part: " + path );
+ }
}
String key = buildKey( uri );
if( cache )
{
- if( getLogger().isDebugEnabled() )
- {
- getLogger().debug( "using cache key part [" + key + "]" );
- }
WeakReference ref = (WeakReference) m_map.get( key );
if( null != ref )
{
@@ -115,7 +130,7 @@
}
}

- // cache based retrival was disabled or no cache value present
+ // cache based retrieval was disabled or no cache value present

try
{
@@ -130,8 +145,8 @@
if( getLogger().isTraceEnabled() )
{
getLogger().trace( "caching part"
- + "\n URI: " + uri
- + "\n Key: " + key );
+ + "\n uri: " + uri
+ + "\n key: " + key );
}
}
return value;
@@ -140,7 +155,7 @@
{
final String error =
"An error while attempting to load a part."
- + "\n URI: " + uri;
+ + "\n uri: " + uri;
IOException exception = new IOException( error );
exception.initCause( e );
throw exception;
@@ -154,6 +169,13 @@
return "" + n + "#" + getRealURI( uri ).toASCIIString();
}

+ private String getID()
+ {
+ ClassLoader classloader = getAnchorClassLoader();
+ int n = System.identityHashCode( classloader );
+ return "" + n;
+ }
+
private URI getRealURI( URI uri ) throws IOException
{
if( "link".equals( uri.getScheme() ) )
@@ -222,6 +244,7 @@
Info information, Classpath classpath, Element strategy, Resolver
resolver )
throws IOException
{
+ ClassLoader anchor = getAnchorClassLoader();
TypeInfo info = strategy.getSchemaTypeInfo();
String namespace = info.getTypeNamespace();
if( PART_XSD_URI.equals( namespace ) )
@@ -239,7 +262,12 @@
String classname = ElementHelper.getAttribute( strategy,
"class" );
Element[] elements = ElementHelper.getChildren( strategy );
Value[] values = VALUE_DECODER.decodeValues( elements );
- return new Plugin( logger, information, classpath,
classname, values );
+ Part part = new Plugin( logger, information, classpath,
classname, values );
+ if( getLogger().isTraceEnabled() )
+ {
+ getLogger().trace( "loaded plugin definition" );
+ }
+ return part;
}
else if( "resource".equals( name ) )
{
@@ -249,7 +277,12 @@
}
String urn = ElementHelper.getAttribute( strategy, "urn" );
String path = ElementHelper.getAttribute( strategy, "path" );
- return new Resource( logger, information, classpath, urn,
path );
+ Part part = new Resource( logger, information, classpath,
urn, path );
+ if( getLogger().isTraceEnabled() )
+ {
+ getLogger().trace( "loaded resource definition" );
+ }
+ return part;
}
else
{
@@ -266,18 +299,18 @@
{
// this is a foreign part

- if( getLogger().isTraceEnabled() )
- {
- getLogger().trace( "loading foreign part definition" );
- }
try
{
+ if( getLogger().isTraceEnabled() )
+ {
+ getLogger().trace( "loading foreign builder" );
+ }
URI uri = getDecoderURI( strategy );
Builder builder = loadForeignBuilder( uri );
if( getLogger().isTraceEnabled() )
{
getLogger().trace(
- "loaded foreign builder ["
+ "using builder ["
+ builder.getClass().getName()
+ "]" );
}
@@ -289,6 +322,10 @@
"Internal error while attempting to load foreign part.";
throw new DecodingException( strategy, error, ioe );
}
+ finally
+ {
+ Thread.currentThread().setContextClassLoader( anchor );
+ }
}
}

@@ -350,11 +387,6 @@
*/
private Builder loadForeignBuilder( URI uri ) throws DecodingException,
Exception
{
- if( getLogger().isTraceEnabled() )
- {
- getLogger().trace( "loading builder [" + uri + "]" );
- }
- Part part = loadPart( uri, true );
WeakReference ref = (WeakReference) m_builders.get( uri );
if( null != ref )
{
@@ -363,48 +395,45 @@
{
if( getLogger().isTraceEnabled() )
{
- getLogger().trace( "located builder in cache" );
+ getLogger().trace( "located builder [" + uri + "]" );
}
return builder;
}
- }
-
- if( part instanceof Plugin )
- {
- Plugin plugin = (Plugin) part;
- Logger logger = getLogger();
- Object[] args = new Object[]{logger};
- Object object = plugin.instantiate( args );
- if( object instanceof Builder )
+ else
{
- Builder builder = (Builder) object;
- WeakReference reference = new WeakReference( builder );
- m_builders.put( uri, reference );
if( getLogger().isTraceEnabled() )
{
- getLogger().trace( "added builder in cache" );
+ getLogger().trace( "reloading builder [" + uri + "]" );
}
- return builder;
}
- else
+ }
+ else
+ {
+ if( getLogger().isTraceEnabled() )
{
- final String error =
- "Plugin does not implement the "
- + Builder.class.getName()
- + " interface."
- + "\nURI: " + uri
- + "\nClass: " + object.getClass().getName();
- throw new PartException( error );
+ getLogger().trace( "loading builder [" + uri + "]" );
}
}
+
+ Part part = loadPart( uri, true );
+ Logger logger = getLogger();
+ Object[] args = new Object[]{logger};
+ Object object = part.instantiate( args );
+ if( object instanceof Builder )
+ {
+ Builder builder = (Builder) object;
+ WeakReference reference = new WeakReference( builder );
+ m_builders.put( uri, reference );
+ return builder;
+ }
else
{
final String error =
- "Cannot resolve an instance from a part that is not derived
from "
- + Plugin.class.getName()
- + "."
+ "Plugin does not implement the "
+ + Builder.class.getName()
+ + " interface."
+ "\nURI: " + uri
- + "\nPart Type: " + part.getClass().getName();
+ + "\nClass: " + object.getClass().getName();
throw new PartException( error );
}
}
@@ -427,7 +456,7 @@
private Info getInfo( URI uri, Element root )
{
Element element = ElementHelper.getChild( root, "info" );
- String title = ElementHelper.getAttribute( element, "title",
"Unknown" );
+ String title = ElementHelper.getAttribute( element, "title" );
Element descriptionElement = ElementHelper.getChild( element,
"description" );
String description = ElementHelper.getValue( descriptionElement );
return new Info( uri, title, description );
@@ -501,4 +530,32 @@
}
}

+ private static String setupBasePathSpec()
+ {
+ try
+ {
+ String path = System.getProperty( "user.dir" );
+ File file = new File( path );
+ URI uri = file.toURI();
+ URL url = file.toURL();
+ return url.toString();
+ }
+ catch( Exception e )
+ {
+ return e.toString();
+ }
+ }
+
+ static String getPartSpec( URI uri )
+ {
+ String path = uri.toASCIIString();
+ if( path.startsWith( BASEPATH ) )
+ {
+ return "./" + path.substring( BASEPATH.length() );
+ }
+ else
+ {
+ return path;
+ }
+ }
}

Modified:
trunk/main/transit/core/src/main/net/dpml/lang/StandardClassLoader.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/StandardClassLoader.java
2006-07-23 06:21:33 UTC (rev 1635)
+++ trunk/main/transit/core/src/main/net/dpml/lang/StandardClassLoader.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -26,6 +26,8 @@

import net.dpml.transit.Artifact;

+import net.dpml.util.Logger;
+
/**
* A named classloader.
*
@@ -42,14 +44,14 @@
* Internal utility class to build a classloader. If the supplied url
* sequence is zero length the parent classloader is returned directly.
*
- * @param uri the uri identifying the classloader source part
+ * @param name the name identifying the classloader
* @param category the category that this classloader is handling
* @param parent the parent classloader
* @param uris the uris to assign as classloader content
* @return the classloader
* @exception IOException if an I/O error occurs
*/
- public static ClassLoader buildClassLoader( URI uri, Category category,
ClassLoader parent, URI[] uris )
+ public static ClassLoader buildClassLoader( Logger logger, String name,
Category category, ClassLoader parent, URI[] uris )
throws IOException
{
URL[] urls = toURLs( uris );
@@ -72,12 +74,15 @@
}
else
{
- return new StandardClassLoader( uri, category, qualified, parent
);
+ ClassLoader loader =
+ new StandardClassLoader( name, category, qualified, parent );
+ classloaderConstructed( logger, name, category, loader );
+ return loader;
}
}

/**
- * Convert a sequncence of URIs to URLs.
+ * Convert a sequence of URIs to URLs.
* @param uris the uris to convert
* @return the corresponding urls
* @exception IOException of a transformation error occurs
@@ -139,7 +144,7 @@
//--------------------------------------------------------------------

private final Category m_category;
- private final URI m_plugin;
+ private final String m_name;

//--------------------------------------------------------------------
// constructor
@@ -147,16 +152,16 @@

/**
* Creation of a new classloader.
- * @param plugin uri identifying the plugin
+ * @param name a name identifying the plugin
* @param category the classloader category identifier
* @param urls an array of urls to add to the classloader
* @param parent the parent classloader
*/
- public StandardClassLoader( URI plugin, Category category, URL[] urls,
ClassLoader parent )
+ public StandardClassLoader( String name, Category category, URL[] urls,
ClassLoader parent )
{
super( urls, parent );
m_category = category;
- m_plugin = plugin;
+ m_name = name;
}

//--------------------------------------------------------------------
@@ -173,15 +178,6 @@
}

/**
- * Return the plugin uri identifier
- * @return the plugin uri
- */
- public URI getPluginURI()
- {
- return m_plugin;
- }
-
- /**
* Return a string representation of the classloader.
* @return the string value
*/
@@ -294,10 +290,10 @@
{
listClasspath( buffer, parent );
}
-
- if( null != m_plugin )
+
+ if( null != m_name )
{
- label = label.concat( "\nGroup: " + m_plugin + " " +
cl.getCategory() );
+ label = label.concat( "\nLabel: " + m_name + " " +
cl.getCategory() );
}
else
{
@@ -445,12 +441,14 @@
if( classloader instanceof StandardClassLoader )
{
StandardClassLoader loader = (StandardClassLoader) classloader;
- buffer.append( " " + loader.m_category );
- URI uri = loader.getPluginURI();
- if( null != uri )
+ if( null != loader.m_name )
{
- buffer.append( "\nURI: " + uri );
+ buffer.append( "\nLabel: " + loader.m_name + " " +
loader.m_category );
}
+ else
+ {
+ buffer.append( "\nCategory: " + loader.m_category );
+ }
}
if( classloader instanceof URLClassLoader )
{
@@ -459,4 +457,48 @@
appendEntries( buffer, urlcl );
}
}
+
+ /**
+ * Handle notification of the creation of a new classloader.
+ * @param label the classloader label
+ * @param category the classloader category
+ * @param classloader the new classloader to report
+ */
+ protected static void classloaderConstructed( Logger logger, String
label, Category category, ClassLoader classloader )
+ {
+ if( logger.isTraceEnabled() )
+ {
+ int id = System.identityHashCode( classloader );
+ StringBuffer buffer = new StringBuffer();
+ buffer.append( "new " );
+ buffer.append( category.toString() );
+ buffer.append( " classloader for " + label );
+ buffer.append( "\n id: " + id );
+ ClassLoader parent = classloader.getParent();
+ if( null != parent )
+ {
+ int pid = System.identityHashCode( parent );
+ buffer.append( "\n extends: " + pid );
+ }
+ if( classloader instanceof URLClassLoader )
+ {
+ URLClassLoader loader = (URLClassLoader) classloader;
+ URL[] urls = loader.getURLs();
+ if( urls.length == 1 )
+ {
+ buffer.append( "\n contains: 1 entry" );
+ }
+ else
+ {
+ buffer.append( "\n contains: " + urls.length + "
entries" );
+ }
+ for( int i=0; i < urls.length; i++ )
+ {
+ URL url = urls[i];
+ buffer.append( "\n [" + (i+1) + "] " +
url.toString() );
+ }
+ }
+ logger.trace( buffer.toString() );
+ }
+ }
}

Modified:
trunk/main/transit/core/src/main/net/dpml/lang/SystemClassLoader.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/SystemClassLoader.java
2006-07-23 06:21:33 UTC (rev 1635)
+++ trunk/main/transit/core/src/main/net/dpml/lang/SystemClassLoader.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -38,13 +38,14 @@
private final ClassLoader m_parent;

/**
- * Creation of a new Depot classloader.
+ * Creation of a new system classloader.
*
* @param parent the parent classloader
*/
public SystemClassLoader( ClassLoader parent )
{
- super( SYSTEM_URI, Category.SYSTEM, new URL[0], parent );
+ super( "system", Category.SYSTEM, new URL[0], parent );
+
m_parent = parent;

if( "true".equals( System.getProperty( "dpml.transit.include.tools"
) ) )
@@ -92,19 +93,5 @@
}
}
}
-
- private static final URI createSystemLabel()
- {
- try
- {
- return new URI( "transit:system" );
- }
- catch( Exception e )
- {
- return null;
- }
- }
-
- private static final URI SYSTEM_URI = createSystemLabel();
}


Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheHandler.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheHandler.java
2006-07-23 06:21:33 UTC (rev 1635)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheHandler.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -121,9 +121,9 @@
throw new TransitException( error, e );
}

- if( getLogger().isDebugEnabled() )
+ if( getLogger().isTraceEnabled() )
{
- getLogger().debug( "cache initialization" );
+ getLogger().trace( "cache initialization" );
}

//
@@ -135,9 +135,9 @@
//

HostModel[] hosts = model.getHostModels();
- if( getLogger().isDebugEnabled() )
+ if( getLogger().isTraceEnabled() )
{
- getLogger().debug( "host count: " + hosts.length );
+ getLogger().trace( "host count: " + hosts.length );
}
for( int i=0; i < hosts.length; i++ )
{
@@ -154,9 +154,9 @@
File cache = model.getCacheDirectory();
setLocalCacheDirectory( cache );

- if( getLogger().isDebugEnabled() )
+ if( getLogger().isTraceEnabled() )
{
- getLogger().debug( "bootstrap initialization complete" );
+ getLogger().trace( "bootstrap initialization complete" );
}
}

@@ -309,14 +309,14 @@
*/
public void initialize() throws IOException
{
- if( getLogger().isDebugEnabled() )
+ if( getLogger().isTraceEnabled() )
{
- getLogger().debug( "secondary initialization phase" );
+ getLogger().trace( "secondary initialization phase" );
}
m_model.addCacheListener( this );
- if( getLogger().isDebugEnabled() )
+ if( getLogger().isTraceEnabled() )
{
- getLogger().debug( "cache subsystem established" );
+ getLogger().trace( "cache subsystem established" );
}
}

@@ -331,21 +331,24 @@
throw new NullArgumentException( "file" );
}
File cache = file;
- if( null == m_cacheDir )
+ if( getLogger().isTraceEnabled() )
{
- final String message =
- "Setting cache to: "
- + cache;
- getLogger().debug( message );
+ if( null == m_cacheDir )
+ {
+ final String message =
+ "Setting cache to: "
+ + cache;
+ getLogger().trace( message );
+ }
+ else
+ {
+ final String message =
+ "Changing cache:"
+ + "\nOld: " + m_cacheDir
+ + "\nNew: " + cache;
+ getLogger().trace( message );
+ }
}
- else
- {
- final String message =
- "Changing cache:"
- + "\nOld: " + m_cacheDir
- + "\nNew: " + cache;
- getLogger().debug( message );
- }
if( !cache.isAbsolute() )
{
cache = new File( Transit.DPML_DATA, file.toString() );
@@ -720,14 +723,14 @@

private ResourceHost createDefaultResourceHost( HostModel model ) throws
IOException
{
- if( getLogger().isDebugEnabled() )
+ if( getLogger().isTraceEnabled() )
{
final String message =
"Creating host ["
+ model.getID()
+ "] on "
+ model.getBaseURL();
- getLogger().debug( message );
+ getLogger().trace( message );
}
try
{

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
2006-07-23 06:21:33 UTC (rev 1635)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -122,7 +122,12 @@
cache = new File( anchor, resolved );
cache.mkdirs();
}
- logger.debug( "setting cache: " + cache );
+
+ if( logger.isDebugEnabled() )
+ {
+ logger.debug( "setting cache: " + cache );
+ }
+
m_cache = cache;

// setup the standard local respository host

Modified:
trunk/main/transit/core/src/main/net/dpml/util/StandardFormatter.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/util/StandardFormatter.java
2006-07-23 06:21:33 UTC (rev 1635)
+++ trunk/main/transit/core/src/main/net/dpml/util/StandardFormatter.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -96,7 +96,7 @@
buffer.append( record.getLevel().getLocalizedName() );
buffer.append( " " );
String tag = buffer.toString();
- return tag.substring( 0, LEVEL_HEADER_WEIDTH ) + "] ";
+ return tag.substring( 0, LEVEL_HEADER_WIDTH ) + "] ";
}

private String getProcessHeader( LogRecord record )
@@ -119,6 +119,6 @@
return tag.substring( 0, PROCESS_HEADER_WIDTH ) + "] ";
}

- private static final int LEVEL_HEADER_WEIDTH = 8;
+ private static final int LEVEL_HEADER_WIDTH = 8;
private static final int PROCESS_HEADER_WIDTH = 6;
}

Added: trunk/tutorials/components/customize/custom/etc/data/logging.properties
===================================================================
--- trunk/tutorials/components/customize/custom/etc/data/logging.properties
2006-07-23 06:21:33 UTC (rev 1635)
+++ trunk/tutorials/components/customize/custom/etc/data/logging.properties
2006-07-23 17:52:05 UTC (rev 1636)
@@ -0,0 +1,4 @@
+.level=FINEST
+sun.rmi.level=INFO
+dpml.level=INFO
+

Added:
trunk/tutorials/components/customize/custom/src/main/org/acme/extra/Customizer.java
===================================================================
---
trunk/tutorials/components/customize/custom/src/main/org/acme/extra/Customizer.java
2006-07-23 06:21:33 UTC (rev 1635)
+++
trunk/tutorials/components/customize/custom/src/main/org/acme/extra/Customizer.java
2006-07-23 17:52:05 UTC (rev 1636)
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.extra;
+
+/**
+ * An example of a class used to resolve a customize context value in
+ * an overriden component part.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Customizer
+{
+ /**
+ * Static method that returns a customized format value.
+ * @return the customized format value
+ */
+ public static String getCustomFormat()
+ {
+ return "h:mm";
+ }
+}

Deleted: trunk/tutorials/components/customize/module.xml
===================================================================
--- trunk/tutorials/components/customize/module.xml 2006-07-23 06:21:33
UTC (rev 1635)
+++ trunk/tutorials/components/customize/module.xml 2006-07-23 17:52:05
UTC (rev 1636)
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<module name="customize" xmlns="link:xsd:dpml/lang/dpml-module#1.0" >
-
- <project name="acme-simple-clock" basedir="clock">
- <types>
- <type id="jar"/>
- <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
- type="org.acme.clock.SimpleClock">
- <context>
- <entry key="format" value="K:mm a, z"/>
- </context>
- </component>
- </types>
- <dependencies>
- <build>
- <include ref="org/acme/acme-type-demo"/>
- </build>
- <test>
- <include ref="ant/ant-junit"/>
- <include ref="dpml/transit/dpml-transit-main"/>
- </test>
- </dependencies>
- </project>
-
- <project name="acme-custom-clock" basedir="custom">
- <types>
- <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
- uri="resource:part:org/acme/customize/acme-simple-clock">
- <context>
- <entry key="format" value="h:mm a"/>
- </context>
- </component>
- </types>
- <dependencies>
- <test>
- <include ref="ant/ant-junit"/>
- <include ref="dpml/transit/dpml-transit-main"/>
- <include key="acme-simple-clock"/>
- </test>
- </dependencies>
- </project>
-
-</module>

Deleted: trunk/tutorials/components/import/module.xml
===================================================================
--- trunk/tutorials/components/import/module.xml 2006-07-23 06:21:33
UTC (rev 1635)
+++ trunk/tutorials/components/import/module.xml 2006-07-23 17:52:05
UTC (rev 1636)
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<module name="import" xmlns="link:xsd:dpml/lang/dpml-module#1.0" >
-
- <project name="acme-clock-api" basedir="api">
- <types>
- <type id="jar"/>
- </types>
- <dependencies>
- <build>
- <include ref="org/acme/customize"/>
- </build>
- </dependencies>
- </project>
-
- <project name="acme-clock-impl" basedir="clock">
- <types>
- <type id="jar"/>
- <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
- type="org.acme.scheduler.SimpleClock"/>
- </types>
- <dependencies>
- <runtime>
- <include key="acme-clock-api"/>
- </runtime>
- </dependencies>
- </project>
-
- <project name="acme-clock-demo" basedir="demo">
- <types>
- <type id="jar"/>
- <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
- type="org.acme.demo.Demo">
- <parts>
- <component key="clock"
uri="resource:part:org/acme/import/acme-clock-impl">
- <context>
- <entry key="format" value="h:mm a"/>
- </context>
- </component>
- </parts>
- </component>
- </types>
- <dependencies>
- <build>
- <include key="acme-clock-impl"/>
- </build>
- <runtime>
- <include key="acme-clock-api"/>
- <include ref="dpml/util/dpml-logging-api"/>
- </runtime>
- <test>
- <include ref="ant/ant-junit"/>
- <include ref="dpml/transit/dpml-transit-main"/>
- </test>
- </dependencies>
- </project>
-
-</module>

Modified: trunk/tutorials/components/module.xml
===================================================================
--- trunk/tutorials/components/module.xml 2006-07-23 06:21:33 UTC (rev
1635)
+++ trunk/tutorials/components/module.xml 2006-07-23 17:52:05 UTC (rev
1636)
@@ -330,10 +330,11 @@
<!-- customization demo -->

<project name="acme-simple-clock" basedir="customize/clock">
+ <info title="Simple Clock"/>
<types>
<type id="jar"/>
<component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
- type="org.acme.clock.SimpleClock">
+ type="org.acme.clock.SimpleClock" name="clock">
<context>
<entry key="format" value="K:mm a, z"/>
</context>
@@ -351,11 +352,13 @@
</project>

<project name="acme-custom-clock" basedir="customize/custom">
+ <info title="Custom Clock"/>
<types>
+ <type id="jar"/>
<component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
- uri="resource:part:dpmlx/tutorials/components/acme-simple-clock">
+ uri="resource:part:dpmlx/tutorials/components/acme-simple-clock"
name="custom">
<context>
- <entry key="format" value="h:mm a"/>
+ <entry key="format" class="org.acme.extra.Customizer"
method="getCustomFormat"/>
</context>
</component>
</types>




  • r1636 - in trunk: main/depot/tools/builder/src/main/net/dpml/tools/tasks main/metro main/metro/component/src/main/net/dpml/component main/metro/model/src/main/net/dpml/metro/data main/metro/runtime/src/main/net/dpml/metro/runtime main/transit/core/src/main/net/dpml/lang main/transit/core/src/main/net/dpml/transit main/transit/core/src/main/net/dpml/util tutorials/components tutorials/components/customize tutorials/components/customize/custom tutorials/components/customize/custom/etc tutorials/components/customize/custom/etc/data tutorials/components/customize/custom/src tutorials/components/customize/custom/src/main tutorials/components/customize/custom/src/main/org tutorials/components/customize/custom/src/main/org/acme tutorials/components/customize/custom/src/main/org/acme/extra tutorials/components/import, mcconnell at BerliOS, 07/23/2006

Archive powered by MHonArc 2.6.24.

Top of Page