notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1320 - in trunk/main: . central/src/docs/transit/concepts depot/core/src/main/net/dpml/depot depot/install/src/main/net/dpml/depot/install depot/library/src/main/net/dpml/library/impl depot/library/src/test/net/dpml/library/impl depot/tools/builder/src/main/net/dpml/tools/info depot/tools/builder/src/main/net/dpml/tools/process metro/component/src/main/net/dpml/component metro/runtime/src/main/net/dpml/metro/builder metro/state/impl/src/main/net/dpml/state/impl metro/test/src/test/net/dpml/test/part metro/test/src/test/net/dpml/test/runtime planet/http/impl/src/main/net/dpml/http planet/http/test/src/test/net/dpml/http/test station/api/src/test/net/dpml/station/info station/builder/src/main/net/dpml/station/builder station/console/src/main/net/dpml/station/console station/exec/src/main/net/dpml/station/exec station/server/etc/prefs/propertiess station/server/src/main/net/dpml/station/server transit/console/src/main/net/dpml/transit/console transit/core/src/main/net! /dpml transit/core/src/main/net/dpml/lang transit/core/src/main/net/dpml/part transit/core/src/main/net/dpml/transit transit/core/src/main/net/dpml/transit/artifact transit/core/src/main/net/dpml/transit/link transit/core/src/main/net/dpml/util transit/core/src/test/net/dpml/transit/test transit/tools/src/main/net/dpml/transit/tools util/job/impl/src/test/net/dpml/job/test
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1320 - in trunk/main: . central/src/docs/transit/concepts depot/core/src/main/net/dpml/depot depot/install/src/main/net/dpml/depot/install depot/library/src/main/net/dpml/library/impl depot/library/src/test/net/dpml/library/impl depot/tools/builder/src/main/net/dpml/tools/info depot/tools/builder/src/main/net/dpml/tools/process metro/component/src/main/net/dpml/component metro/runtime/src/main/net/dpml/metro/builder metro/state/impl/src/main/net/dpml/state/impl metro/test/src/test/net/dpml/test/part metro/test/src/test/net/dpml/test/runtime planet/http/impl/src/main/net/dpml/http planet/http/test/src/test/net/dpml/http/test station/api/src/test/net/dpml/station/info station/builder/src/main/net/dpml/station/builder station/console/src/main/net/dpml/station/console station/exec/src/main/net/dpml/station/exec station/server/etc/prefs/propertiess station/server/src/main/net/dpml/station/server transit/console/src/main/net/dpml/transit/console transit/core/src/main/net! /dpml transit/core/src/main/net/dpml/lang transit/core/src/main/net/dpml/part transit/core/src/main/net/dpml/transit transit/core/src/main/net/dpml/transit/artifact transit/core/src/main/net/dpml/transit/link transit/core/src/main/net/dpml/util transit/core/src/test/net/dpml/transit/test transit/tools/src/main/net/dpml/transit/tools util/job/impl/src/test/net/dpml/job/test
- Date: Wed, 5 Apr 2006 22:33:46 +0200
Author: mcconnell
Date: 2006-04-05 22:33:36 +0200 (Wed, 05 Apr 2006)
New Revision: 1320
Added:
trunk/main/transit/core/src/main/net/dpml/util/
Removed:
trunk/main/transit/core/src/main/net/dpml/transit/util/
Modified:
trunk/main/build.xml
trunk/main/central/src/docs/transit/concepts/classloaders.xml
trunk/main/depot/core/src/main/net/dpml/depot/Main.java
trunk/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
trunk/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultDictionary.java
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java
trunk/main/depot/library/src/test/net/dpml/library/impl/AbstractTestCase.java
trunk/main/depot/tools/builder/src/main/net/dpml/tools/info/BuilderDirectiveHelper.java
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/PluginProcess.java
trunk/main/metro/component/src/main/net/dpml/component/Composition.java
trunk/main/metro/runtime/src/main/net/dpml/metro/builder/ComponentDecoder.java
trunk/main/metro/runtime/src/main/net/dpml/metro/builder/ComponentTypeDecoder.java
trunk/main/metro/state/impl/src/main/net/dpml/state/impl/StateDecoder.java
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/AppTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/ArrayTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/CategoriesTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/CompositeTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/ContextTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/DefaultComponentHandlerTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/DisposalTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/HardCollectionPolicyTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/LifecycleTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/NullTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/ObserverTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/PartsTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/ProviderTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/SingletonProviderTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/StateTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/TransientProviderTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/WeakCollectionPolicyTestCase.java
trunk/main/planet/http/impl/src/main/net/dpml/http/LoggerAdapter.java
trunk/main/planet/http/impl/src/main/net/dpml/http/NCSARequestLog.java
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java
trunk/main/station/api/src/test/net/dpml/station/info/ApplicationXMLTestCase.java
trunk/main/station/builder/src/main/net/dpml/station/builder/RegistryBuilder.java
trunk/main/station/console/src/main/net/dpml/station/console/StationPlugin.java
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
trunk/main/station/server/etc/prefs/propertiess/application.properties
trunk/main/station/server/etc/prefs/propertiess/logging.properties
trunk/main/station/server/etc/prefs/propertiess/server.properties
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplicationRegistry.java
trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
trunk/main/transit/core/src/main/net/dpml/lang/Construct.java
trunk/main/transit/core/src/main/net/dpml/part/DOM3DocumentBuilder.java
trunk/main/transit/core/src/main/net/dpml/part/Part.java
trunk/main/transit/core/src/main/net/dpml/part/PartDecoder.java
trunk/main/transit/core/src/main/net/dpml/part/Plugin.java
trunk/main/transit/core/src/main/net/dpml/part/Resource.java
trunk/main/transit/core/src/main/net/dpml/part/ValueDecoder.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultHostModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultResourceHost.java
trunk/main/transit/core/src/main/net/dpml/transit/NetworkLoader.java
trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
trunk/main/transit/core/src/main/net/dpml/transit/artifact/ArtifactURLConnection.java
trunk/main/transit/core/src/main/net/dpml/transit/link/ArtifactLinkManager.java
trunk/main/transit/core/src/main/net/dpml/transit/link/LinkURLConnection.java
trunk/main/transit/core/src/main/net/dpml/util/ConfigurationHandler.java
trunk/main/transit/core/src/main/net/dpml/util/ElementHelper.java
trunk/main/transit/core/src/main/net/dpml/util/ExceptionHelper.java
trunk/main/transit/core/src/main/net/dpml/util/MimeTypeHandler.java
trunk/main/transit/core/src/main/net/dpml/util/PropertyResolver.java
trunk/main/transit/core/src/main/net/dpml/util/StandardFormatter.java
trunk/main/transit/core/src/main/net/dpml/util/StreamUtils.java
trunk/main/transit/core/src/main/net/dpml/util/Util.java
trunk/main/transit/core/src/test/net/dpml/transit/test/LinkTestCase.java
trunk/main/transit/core/src/test/net/dpml/transit/test/MimeHandlerTestCase.java
trunk/main/transit/core/src/test/net/dpml/transit/test/PropertyResolverTestCase.java
trunk/main/transit/tools/src/main/net/dpml/transit/tools/AntAdapter.java
trunk/main/transit/tools/src/main/net/dpml/transit/tools/ImportArtifactTask.java
trunk/main/transit/tools/src/main/net/dpml/transit/tools/PluginTask.java
trunk/main/transit/tools/src/main/net/dpml/transit/tools/TransitComponentHelper.java
trunk/main/util/job/impl/src/test/net/dpml/job/test/DefaultCommissionerTestCase.java
Log:
1. incorporate content handling into the part definition
2. move net.dpml.transit.util package to net.dpml.util
Modified: trunk/main/build.xml
===================================================================
--- trunk/main/build.xml 2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/build.xml 2006-04-05 20:33:36 UTC (rev 1320)
@@ -255,6 +255,7 @@
<package name="net.dpml.part"/>
<package name="net.dpml.transit"/>
<package name="net.dpml.transit.*"/>
+ <package name="net.dpml.util"/>
</group>
<group title="Metro">
<package name="net.dpml.component"/>
Modified: trunk/main/central/src/docs/transit/concepts/classloaders.xml
===================================================================
--- trunk/main/central/src/docs/transit/concepts/classloaders.xml
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/central/src/docs/transit/concepts/classloaders.xml
2006-04-05 20:33:36 UTC (rev 1320)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
+ Copyright 2004-2006 Stephen McConnell
Copyright 2005 David Leangen
- Copyright 2004-2005 Stephen McConnell
Copyright 2004 Niclas Hedhman
Licensed under the Apache License, Version 2.0 (the "License");
@@ -68,11 +68,22 @@
</p>
<source>
-URI uri = new URI( "artifact:plugin:dpml/examples/hello/hello-world#1.0.0" );
+URI uri = new URI( "artifact:part:dpml/examples/hello/hello-world#1.0.0" );
Part part = Part.load( uri );
ClassLoader classloader = part.getClassloader();
</source>
+ <p>
+ The following code fragment demonstrates the equivalent functionality
+ using strict Java core classes.
+ </p>
+
+<source>
+URI uri = new URI( "artifact:part:dpml/examples/hello/hello-world#1.0.0" );
+URL url = uri.toURL();
+ClassLoader classloader = (ClassLoader) url.getContent( new Class[]{
ClassLoader.class } );
+</source>
+
</section>
</body>
Modified: trunk/main/depot/core/src/main/net/dpml/depot/Main.java
===================================================================
--- trunk/main/depot/core/src/main/net/dpml/depot/Main.java 2006-04-05
19:00:01 UTC (rev 1319)
+++ trunk/main/depot/core/src/main/net/dpml/depot/Main.java 2006-04-05
20:33:36 UTC (rev 1320)
@@ -462,7 +462,7 @@
static
{
setSystemProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
- setSystemProperty( "java.util.logging.config.class",
"net.dpml.transit.util.ConfigurationHandler" );
+ setSystemProperty( "java.util.logging.config.class",
"net.dpml.util.ConfigurationHandler" );
setSystemProperty( "java.rmi.server.RMIClassLoaderSpi",
"net.dpml.depot.DepotRMIClassLoaderSpi" );
setSystemProperty( Transit.SYSTEM_KEY,
Transit.DPML_SYSTEM.getAbsolutePath() );
setSystemProperty( Transit.HOME_KEY,
Transit.DPML_HOME.getAbsolutePath() );
Modified:
trunk/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
===================================================================
---
trunk/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -41,7 +41,7 @@
import net.dpml.transit.model.DefaultTransitRegistryModel;
import net.dpml.lang.Logger;
import net.dpml.transit.store.TransitStorageHome;
-import net.dpml.transit.util.CLIHelper;
+import net.dpml.util.CLIHelper;
/**
* The DepotInstaller is responsible for the establishment and integrity of
Modified:
trunk/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
===================================================================
---
trunk/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -39,7 +39,7 @@
import net.dpml.lang.Logger;
import net.dpml.transit.model.TransitModel;
import net.dpml.transit.model.TransitRegistryModel;
-import net.dpml.transit.util.StreamUtils;
+import net.dpml.util.StreamUtils;
/**
* Table model that maps table rows to child nodes of a supplied preferences
node.
Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultDictionary.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultDictionary.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultDictionary.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -25,7 +25,7 @@
import net.dpml.library.Dictionary;
import net.dpml.library.info.AbstractDirective;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.PropertyResolver;
/**
* Utility class used for construction of a module model from an XML source.
Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -37,7 +37,7 @@
import net.dpml.library.info.TypeDirective;
import net.dpml.library.info.Scope;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import net.dpml.lang.Category;
import net.dpml.part.DecodingException;
Modified:
trunk/main/depot/library/src/test/net/dpml/library/impl/AbstractTestCase.java
===================================================================
---
trunk/main/depot/library/src/test/net/dpml/library/impl/AbstractTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/depot/library/src/test/net/dpml/library/impl/AbstractTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -219,6 +219,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/info/BuilderDirectiveHelper.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/info/BuilderDirectiveHelper.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/info/BuilderDirectiveHelper.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -35,7 +35,7 @@
import net.dpml.transit.Artifact;
import net.dpml.transit.Transit;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import org.w3c.dom.Element;
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/PluginProcess.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/PluginProcess.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/PluginProcess.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -18,7 +18,7 @@
package net.dpml.tools.process;
-import net.dpml.transit.util.ExceptionHelper;
+import net.dpml.util.ExceptionHelper;
import net.dpml.tools.tasks.PartTask;
Modified:
trunk/main/metro/component/src/main/net/dpml/component/Composition.java
===================================================================
--- trunk/main/metro/component/src/main/net/dpml/component/Composition.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/metro/component/src/main/net/dpml/component/Composition.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -56,6 +56,37 @@
m_directive = directive;
m_controller = controller;
}
+
+ /**
+ * Return the part content or null if the result type is unresolvable
+ * relative to the supplied classes argument.
+ * @param classes the content type selection classes
+ * @return the content
+ * @exception IOException if an IO error occurs
+ */
+ protected Object getContent( Class c ) throws IOException
+ {
+ if( Directive.class.isAssignableFrom( c ) )
+ {
+ return m_directive;
+ }
+ else if( Model.class.isAssignableFrom( c ) )
+ {
+ return getModel();
+ }
+ else if( Component.class.isAssignableFrom( c ) )
+ {
+ return newComponent();
+ }
+ else if( Controller.class.isAssignableFrom( c ) )
+ {
+ return m_controller;
+ }
+ else
+ {
+ return super.getContent( c );
+ }
+ }
/**
* Get the deployment directive.
Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/builder/ComponentDecoder.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/builder/ComponentDecoder.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/builder/ComponentDecoder.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -40,7 +40,7 @@
import net.dpml.part.DOM3DocumentBuilder;
import net.dpml.part.ValueDecoder;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/builder/ComponentTypeDecoder.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/builder/ComponentTypeDecoder.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/builder/ComponentTypeDecoder.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -46,7 +46,7 @@
import net.dpml.state.impl.StateDecoder;
import net.dpml.state.impl.DefaultState;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import org.w3c.dom.Element;
import org.w3c.dom.Document;
Modified:
trunk/main/metro/state/impl/src/main/net/dpml/state/impl/StateDecoder.java
===================================================================
---
trunk/main/metro/state/impl/src/main/net/dpml/state/impl/StateDecoder.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/state/impl/src/main/net/dpml/state/impl/StateDecoder.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -30,7 +30,7 @@
import net.dpml.part.DOM3DocumentBuilder;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -78,7 +78,7 @@
{
System.setProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" );
+ "net.dpml.util.ConfigurationHandler" );
System.setProperty(
"dpml.logging.config",
"file:" + System.getProperty( "project.test.dir" ) +
"/logging.properties" );
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/AppTestCase.java
===================================================================
--- trunk/main/metro/test/src/test/net/dpml/test/runtime/AppTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/metro/test/src/test/net/dpml/test/runtime/AppTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -74,6 +74,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/ArrayTestCase.java
===================================================================
--- trunk/main/metro/test/src/test/net/dpml/test/runtime/ArrayTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/metro/test/src/test/net/dpml/test/runtime/ArrayTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -74,6 +74,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/CategoriesTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/CategoriesTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/CategoriesTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -71,6 +71,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/CompositeTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/CompositeTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/CompositeTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -98,6 +98,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/ContextTestCase.java
===================================================================
--- trunk/main/metro/test/src/test/net/dpml/test/runtime/ContextTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/metro/test/src/test/net/dpml/test/runtime/ContextTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -222,6 +222,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/DefaultComponentHandlerTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/DefaultComponentHandlerTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/DefaultComponentHandlerTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -94,6 +94,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/DisposalTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/DisposalTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/DisposalTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -73,6 +73,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/HardCollectionPolicyTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/HardCollectionPolicyTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/HardCollectionPolicyTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -95,6 +95,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/LifecycleTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/LifecycleTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/LifecycleTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -73,6 +73,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/NullTestCase.java
===================================================================
--- trunk/main/metro/test/src/test/net/dpml/test/runtime/NullTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/metro/test/src/test/net/dpml/test/runtime/NullTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -45,6 +45,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/ObserverTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/ObserverTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/ObserverTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -76,6 +76,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/PartsTestCase.java
===================================================================
--- trunk/main/metro/test/src/test/net/dpml/test/runtime/PartsTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/metro/test/src/test/net/dpml/test/runtime/PartsTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -77,6 +77,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/ProviderTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/ProviderTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/ProviderTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -222,6 +222,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/SingletonProviderTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/SingletonProviderTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/SingletonProviderTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -70,6 +70,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/StateTestCase.java
===================================================================
--- trunk/main/metro/test/src/test/net/dpml/test/runtime/StateTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/metro/test/src/test/net/dpml/test/runtime/StateTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -77,6 +77,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/TransientProviderTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/TransientProviderTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/TransientProviderTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -73,6 +73,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/WeakCollectionPolicyTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/WeakCollectionPolicyTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/WeakCollectionPolicyTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -92,6 +92,6 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
}
}
Modified:
trunk/main/planet/http/impl/src/main/net/dpml/http/LoggerAdapter.java
===================================================================
--- trunk/main/planet/http/impl/src/main/net/dpml/http/LoggerAdapter.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/planet/http/impl/src/main/net/dpml/http/LoggerAdapter.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -17,7 +17,7 @@
import net.dpml.logging.Logger;
-import net.dpml.transit.util.ExceptionHelper;
+import net.dpml.util.ExceptionHelper;
/**
* Wrapper to redirect Jetty logging to DPML logging.
Modified:
trunk/main/planet/http/impl/src/main/net/dpml/http/NCSARequestLog.java
===================================================================
--- trunk/main/planet/http/impl/src/main/net/dpml/http/NCSARequestLog.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/planet/http/impl/src/main/net/dpml/http/NCSARequestLog.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -20,7 +20,7 @@
import java.util.ArrayList;
import java.util.StringTokenizer;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.PropertyResolver;
/**
* Wrapper for the Jetty NCSA request logger.
Modified:
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java
===================================================================
---
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -50,7 +50,7 @@
"java.util.logging.config.class",
System.getProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" ) );
+ "net.dpml.util.ConfigurationHandler" ) );
System.setProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
System.setProperty(
"dpml.logging.config",
Modified:
trunk/main/station/api/src/test/net/dpml/station/info/ApplicationXMLTestCase.java
===================================================================
---
trunk/main/station/api/src/test/net/dpml/station/info/ApplicationXMLTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/station/api/src/test/net/dpml/station/info/ApplicationXMLTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -23,7 +23,7 @@
import junit.framework.TestCase;
import net.dpml.part.DOM3DocumentBuilder;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
trunk/main/station/builder/src/main/net/dpml/station/builder/RegistryBuilder.java
===================================================================
---
trunk/main/station/builder/src/main/net/dpml/station/builder/RegistryBuilder.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/station/builder/src/main/net/dpml/station/builder/RegistryBuilder.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -33,7 +33,7 @@
import net.dpml.part.Decoder;
import net.dpml.lang.ValueDirective;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
trunk/main/station/console/src/main/net/dpml/station/console/StationPlugin.java
===================================================================
---
trunk/main/station/console/src/main/net/dpml/station/console/StationPlugin.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/station/console/src/main/net/dpml/station/console/StationPlugin.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -59,8 +59,8 @@
import net.dpml.lang.PID;
import net.dpml.transit.Disposable;
import net.dpml.lang.ValueDirective;
-import net.dpml.transit.util.ExceptionHelper;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.ExceptionHelper;
+import net.dpml.util.PropertyResolver;
import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.DuplicateKeyException;
Modified:
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
===================================================================
---
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -33,7 +33,7 @@
import net.dpml.station.ApplicationException;
import net.dpml.transit.Artifact;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.PropertyResolver;
import net.dpml.lang.PID;
import net.dpml.lang.Logger;
Modified:
trunk/main/station/server/etc/prefs/propertiess/application.properties
===================================================================
--- trunk/main/station/server/etc/prefs/propertiess/application.properties
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/station/server/etc/prefs/propertiess/application.properties
2006-04-05 20:33:36 UTC (rev 1320)
@@ -8,7 +8,7 @@
java.util.logging.FileHandler.count=10
java.util.logging.FileHandler.limit=100000
java.util.logging.FileHandler.pattern=${dpml.station.logging.dir}/${dpml.station.key}/${dpml.station.key}-%g.log
-java.util.logging.FileHandler.formatter=net.dpml.transit.util.StandardFormatter
+java.util.logging.FileHandler.formatter=net.dpml.util.StandardFormatter
sun.rmi.transport.tcp.level=INFO
sun.rmi.loader.level=INFO
Modified: trunk/main/station/server/etc/prefs/propertiess/logging.properties
===================================================================
--- trunk/main/station/server/etc/prefs/propertiess/logging.properties
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/station/server/etc/prefs/propertiess/logging.properties
2006-04-05 20:33:36 UTC (rev 1320)
@@ -2,7 +2,7 @@
java.util.logging.FileHandler.pattern=${dpml.data}/logs/station/server-%u.log
java.util.logging.FileHandler.limit=50000
java.util.logging.FileHandler.count=1
-java.util.logging.FileHandler.formatter=net.dpml.transit.util.StandardFormatter
+java.util.logging.FileHandler.formatter=net.dpml.util.StandardFormatter
sun.rmi.transport.tcp.level=INFO
sun.rmi.loader.level=INFO
Modified: trunk/main/station/server/etc/prefs/propertiess/server.properties
===================================================================
--- trunk/main/station/server/etc/prefs/propertiess/server.properties
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/station/server/etc/prefs/propertiess/server.properties
2006-04-05 20:33:36 UTC (rev 1320)
@@ -6,7 +6,7 @@
java.util.logging.FileHandler.pattern=${dpml.data}/logs/station/server-%u.log
java.util.logging.FileHandler.limit=50000
java.util.logging.FileHandler.count=1
-java.util.logging.FileHandler.formatter=net.dpml.transit.util.StandardFormatter
+java.util.logging.FileHandler.formatter=net.dpml.util.StandardFormatter
sun.rmi.transport.tcp.level=INFO
sun.rmi.loader.level=INFO
Modified:
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplicationRegistry.java
===================================================================
---
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplicationRegistry.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplicationRegistry.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -46,7 +46,7 @@
import net.dpml.station.info.RegistryDescriptor.Entry;
import net.dpml.station.info.ApplicationRegistryRuntimeException;
-import net.dpml.transit.util.StreamUtils;
+import net.dpml.util.StreamUtils;
/**
* Implements of the application registry within which a set of application
profiles
Modified:
trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
===================================================================
---
trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -61,7 +61,7 @@
import net.dpml.transit.info.HostDirective;
import net.dpml.transit.info.LayoutDirective;
import net.dpml.transit.info.ContentDirective;
-import net.dpml.transit.util.ExceptionHelper;
+import net.dpml.util.ExceptionHelper;
/**
Modified: trunk/main/transit/core/src/main/net/dpml/lang/Construct.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/Construct.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/lang/Construct.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -26,7 +26,7 @@
import java.util.Arrays;
import java.util.Map;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.PropertyResolver;
/**
* A object resolvable from primitive arguments.
Modified:
trunk/main/transit/core/src/main/net/dpml/part/DOM3DocumentBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/DOM3DocumentBuilder.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/part/DOM3DocumentBuilder.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -32,7 +32,7 @@
import javax.xml.XMLConstants;
import net.dpml.transit.Artifact;
-import net.dpml.transit.util.ExceptionHelper;
+import net.dpml.util.ExceptionHelper;
import org.w3c.dom.DOMError;
import org.w3c.dom.DOMLocator;
Modified: trunk/main/transit/core/src/main/net/dpml/part/Part.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/Part.java 2006-04-05
19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/part/Part.java 2006-04-05
20:33:36 UTC (rev 1320)
@@ -112,6 +112,106 @@
}
/**
+ * Return the part content default content.
+ * @param classes the content type selection classes
+ * @return the content
+ * @exception IOException if an IO error occurs
+ */
+ public Object getContent() throws IOException
+ {
+ try
+ {
+ return instantiate( new Object[0] );
+ }
+ catch( IOException e )
+ {
+ throw e;
+ }
+ catch( Exception e )
+ {
+ final String error =
+ "Part instantiation error.";
+ throw new PartException( error, e );
+ }
+ }
+
+ /**
+ * Return the part content or null if the result type is unresolvable
+ * relative to the supplied classes argument.
+ * @param classes the content type selection classes
+ * @return the content
+ * @exception IOException if an IO error occurs
+ */
+ public Object getContent( Class[] classes ) throws IOException
+ {
+ if( classes.length == 0 )
+ {
+ return getContent();
+ }
+ else
+ {
+ for( int i=0; i<classes.length; i++ )
+ {
+ Class c = classes[i];
+ Object content = getContent( c );
+ if( null != content )
+ {
+ return content;
+ }
+ }
+ return null;
+ }
+ }
+
+ /**
+ * Return the part content or null if the result type is unresolvable
+ * relative to the supplied classes argument.
+ * @param classes the content type selection classes
+ * @return the content
+ * @exception IOException if an IO error occurs
+ */
+ protected Object getContent( Class c ) throws IOException
+ {
+ if( Info.class.isAssignableFrom( c ) )
+ {
+ return getInfo();
+ }
+ else if( Classpath.class.isAssignableFrom( c ) )
+ {
+ return getClasspath();
+ }
+ else if( Part.class.isAssignableFrom( c ) )
+ {
+ return this;
+ }
+ else if( ClassLoader.class.isAssignableFrom( c ) )
+ {
+ return getClassLoader();
+ }
+ else if( Object.class == c )
+ {
+ try
+ {
+ return instantiate( new Object[0] );
+ }
+ catch( IOException e )
+ {
+ throw e;
+ }
+ catch( Exception e )
+ {
+ final String error =
+ "Part instantiation error.";
+ throw new PartException( error, e );
+ }
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
* Get the part info descriptor.
*
* @return the part info datastructure
Modified: trunk/main/transit/core/src/main/net/dpml/part/PartDecoder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/PartDecoder.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/part/PartDecoder.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -30,7 +30,7 @@
import net.dpml.lang.Value;
import net.dpml.transit.Artifact;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: trunk/main/transit/core/src/main/net/dpml/part/Plugin.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/Plugin.java 2006-04-05
19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/part/Plugin.java 2006-04-05
20:33:36 UTC (rev 1320)
@@ -85,6 +85,25 @@
}
/**
+ * Return the part content or null if the result type is unresolvable
+ * relative to the supplied classes argument.
+ * @param classes the content type selection classes
+ * @return the content
+ * @exception IOException if an IO error occurs
+ */
+ protected Object getContent( Class c ) throws IOException
+ {
+ if( Class.class.equals( c ) )
+ {
+ return getPluginClass();
+ }
+ else
+ {
+ return super.getContent( c );
+ }
+ }
+
+ /**
* Get the target classname.
* @return the classname
*/
@@ -107,11 +126,20 @@
* @return the plugin class
* @exception Exception if an error occurs
*/
- public Class getPluginClass() throws Exception
+ public Class getPluginClass() throws IOException
{
ClassLoader classloader = getClassLoader();
String classname = getClassname();
- return classloader.loadClass( classname );
+ try
+ {
+ return classloader.loadClass( classname );
+ }
+ catch( ClassNotFoundException e )
+ {
+ final String error =
+ "Plugin class [" + classname + "] not found.";
+ throw new PartException( error );
+ }
}
/**
Modified: trunk/main/transit/core/src/main/net/dpml/part/Resource.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/Resource.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/part/Resource.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -20,6 +20,7 @@
import java.io.IOException;
import java.io.Writer;
+import java.net.URL;
import net.dpml.lang.Logger;
import net.dpml.lang.Classpath;
@@ -58,11 +59,38 @@
m_urn = urn;
m_path = path;
}
+
+ /**
+ * Return the part content or null if the result type is unresolvable
+ * relative to the supplied classes argument. Class arguments recognized
+ * over an above plugin include the URL and String classes. If the URL
+ * class is supplied a URL referencing the resource identified by path
+ * is returned. If a String is requested the urn value is returned.
+ *
+ * @param classes the content type selection classes
+ * @return the content
+ * @exception IOException if an IO error occurs
+ */
+ protected Object getContent( Class c ) throws IOException
+ {
+ if( URL.class.equals( c ) )
+ {
+ return getClassLoader().getResource( m_path );
+ }
+ else if( String.class.equals( c ) )
+ {
+ return getURN();
+ }
+ else
+ {
+ return super.getContent( c );
+ }
+ }
/**
* Get the resource urn.
* @return the urn
- */
+ */
public String getURN()
{
return m_urn;
@@ -85,7 +113,7 @@
*/
public Object instantiate( Object[] args ) throws Exception
{
- throw new UnsupportedOperationException( "instantiate/1" );
+ return getClassLoader().getResource( m_path );
}
/**
Modified: trunk/main/transit/core/src/main/net/dpml/part/ValueDecoder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/ValueDecoder.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/part/ValueDecoder.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -20,7 +20,7 @@
import net.dpml.lang.Value;
import net.dpml.lang.Construct;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import org.w3c.dom.Element;
Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -45,7 +45,7 @@
import net.dpml.transit.model.CacheListener;
import net.dpml.transit.model.CacheDirectoryChangeEvent;
import net.dpml.transit.model.CacheEvent;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.PropertyResolver;
import net.dpml.lang.DuplicateKeyException;
import net.dpml.lang.UnknownKeyException;
Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultHostModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultHostModel.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultHostModel.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -36,7 +36,7 @@
import net.dpml.transit.model.HostPriorityEvent;
import net.dpml.transit.model.HostNameEvent;
import net.dpml.transit.model.RequestIdentifier;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.PropertyResolver;
import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.Logger;
Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultResourceHost.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultResourceHost.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultResourceHost.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -51,7 +51,7 @@
import net.dpml.transit.model.HostChangeEvent;
import net.dpml.transit.model.HostPriorityEvent;
import net.dpml.transit.model.HostLayoutEvent;
-import net.dpml.transit.util.Util;
+import net.dpml.util.Util;
import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.Logger;
Modified: trunk/main/transit/core/src/main/net/dpml/transit/NetworkLoader.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/NetworkLoader.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/transit/NetworkLoader.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -20,7 +20,7 @@
import net.dpml.transit.artifact.ArtifactException;
import net.dpml.transit.monitor.NetworkMonitorRouter;
-import net.dpml.transit.util.StreamUtils;
+import net.dpml.util.StreamUtils;
import java.io.IOException;
import java.io.InputStream;
Modified:
trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -30,7 +30,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import net.dpml.transit.info.TransitDirective;
import net.dpml.transit.info.CacheDirective;
import net.dpml.transit.info.HostDirective;
Modified:
trunk/main/transit/core/src/main/net/dpml/transit/artifact/ArtifactURLConnection.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/artifact/ArtifactURLConnection.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/transit/core/src/main/net/dpml/transit/artifact/ArtifactURLConnection.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -36,7 +36,7 @@
import net.dpml.transit.SecuredTransitContext;
import net.dpml.transit.ContentRegistry;
import net.dpml.transit.CacheHandler;
-import net.dpml.transit.util.MimeTypeHandler;
+import net.dpml.util.MimeTypeHandler;
import net.dpml.part.Plugin;
import net.dpml.part.Part;
@@ -203,77 +203,8 @@
if( "part".equals( type ) )
{
URI uri = m_artifact.toURI();
- if( classes.length == 0 )
- {
- try
- {
- Part part = Part.load( uri );
- return part.instantiate( new Object[0] );
- }
- catch( InvocationTargetException e )
- {
- final String error =
- "Plugin constructor invocation exception."
- + "\nURI: " + uri;
- IOException ioe = new IOException( error );
- ioe.initCause( e );
- throw ioe;
- }
- catch( IOException e )
- {
- throw e;
- }
- catch( Exception e )
- {
- final String error =
- "Unexpect part exception."
- + "\nURI: " + uri;
- IOException ioe = new IOException( error );
- ioe.initCause( e );
- throw ioe;
- }
- }
- else
- {
- try
- {
- for( int i=0; i < classes.length; i++ )
- {
- Class c = classes[i];
- if( Part.class.equals( c ) )
- {
- return Part.load( uri );
- }
- else if( ClassLoader.class.equals( c ) )
- {
- Part part = Part.load( uri );
- return part.getClassLoader();
- }
- else if( Class.class.equals( c ) )
- {
- Part part = Part.load( uri );
- if( part instanceof Plugin )
- {
- Plugin plugin = (Plugin) part;
- return plugin.getPluginClass();
- }
- }
- }
- }
- catch( IOException e )
- {
- throw e;
- }
- catch( Exception e )
- {
- final String error =
- "Unexpect part exception."
- + "\nURI: " + uri;
- IOException ioe = new IOException( error );
- ioe.initCause( e );
- throw ioe;
- }
- }
+ Part part = Part.load( uri );
+ return part.getContent( classes );
}
//
@@ -319,7 +250,7 @@
}
return null;
}
-
+
//
------------------------------------------------------------------------
// implementation
//
------------------------------------------------------------------------
Modified:
trunk/main/transit/core/src/main/net/dpml/transit/link/ArtifactLinkManager.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/link/ArtifactLinkManager.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/transit/core/src/main/net/dpml/transit/link/ArtifactLinkManager.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -19,7 +19,7 @@
package net.dpml.transit.link;
-import net.dpml.transit.util.StreamUtils;
+import net.dpml.util.StreamUtils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -34,7 +34,7 @@
import net.dpml.transit.NullArgumentException;
import net.dpml.transit.artifact.ArtifactNotFoundException;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.PropertyResolver;
/**
* A link manager that maintains persistent link information as a resource.
Modified:
trunk/main/transit/core/src/main/net/dpml/transit/link/LinkURLConnection.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/link/LinkURLConnection.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/transit/core/src/main/net/dpml/transit/link/LinkURLConnection.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -33,7 +33,7 @@
import net.dpml.transit.Transit;
import net.dpml.transit.Artifact;
import net.dpml.transit.UnsupportedSchemeException;
-import net.dpml.transit.util.MimeTypeHandler;
+import net.dpml.util.MimeTypeHandler;
/**
* link: URL protocol connection processor.
Copied: trunk/main/transit/core/src/main/net/dpml/util (from rev 1318,
trunk/main/transit/core/src/main/net/dpml/transit/util)
Modified:
trunk/main/transit/core/src/main/net/dpml/util/ConfigurationHandler.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/util/ConfigurationHandler.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/util/ConfigurationHandler.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package net.dpml.transit.util;
+package net.dpml.util;
import java.net.URL;
import java.io.InputStream;
@@ -94,7 +94,7 @@
"java.util.logging.ConsoleHandler" );
setProperty( properties,
"java.util.logging.ConsoleHandler.formatter",
- "net.dpml.transit.util.StandardFormatter" );
+ "net.dpml.util.StandardFormatter" );
setProperty( properties,
"java.util.logging.ConsoleHandler.level", "ALL" );
}
Modified: trunk/main/transit/core/src/main/net/dpml/util/ElementHelper.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/util/ElementHelper.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/util/ElementHelper.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package net.dpml.transit.util;
+package net.dpml.util;
import java.io.File;
import java.io.FileNotFoundException;
Modified: trunk/main/transit/core/src/main/net/dpml/util/ExceptionHelper.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/util/ExceptionHelper.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/util/ExceptionHelper.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package net.dpml.transit.util;
+package net.dpml.util;
import java.io.PrintWriter;
import java.io.StringWriter;
Modified: trunk/main/transit/core/src/main/net/dpml/util/MimeTypeHandler.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/util/MimeTypeHandler.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/util/MimeTypeHandler.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package net.dpml.transit.util;
+package net.dpml.util;
import java.util.HashMap;
Modified: trunk/main/transit/core/src/main/net/dpml/util/PropertyResolver.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/util/PropertyResolver.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/util/PropertyResolver.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.transit.util;
+package net.dpml.util;
import java.util.Enumeration;
import java.util.Properties;
Modified:
trunk/main/transit/core/src/main/net/dpml/util/StandardFormatter.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/util/StandardFormatter.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/util/StandardFormatter.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package net.dpml.transit.util;
+package net.dpml.util;
import net.dpml.lang.PID;
Modified: trunk/main/transit/core/src/main/net/dpml/util/StreamUtils.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/util/StreamUtils.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/util/StreamUtils.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package net.dpml.transit.util;
+package net.dpml.util;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Modified: trunk/main/transit/core/src/main/net/dpml/util/Util.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/util/Util.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/util/Util.java 2006-04-05
20:33:36 UTC (rev 1320)
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package net.dpml.transit.util;
+package net.dpml.util;
import net.dpml.transit.Transit;
Modified:
trunk/main/transit/core/src/test/net/dpml/transit/test/LinkTestCase.java
===================================================================
--- trunk/main/transit/core/src/test/net/dpml/transit/test/LinkTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/core/src/test/net/dpml/transit/test/LinkTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -28,7 +28,7 @@
import net.dpml.transit.artifact.ArtifactNotFoundException;
import net.dpml.transit.link.Link;
-import net.dpml.transit.util.StreamUtils;
+import net.dpml.util.StreamUtils;
import net.dpml.transit.info.CacheDirective;
import net.dpml.transit.info.TransitDirective;
import net.dpml.transit.info.LayoutDirective;
Modified:
trunk/main/transit/core/src/test/net/dpml/transit/test/MimeHandlerTestCase.java
===================================================================
---
trunk/main/transit/core/src/test/net/dpml/transit/test/MimeHandlerTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/transit/core/src/test/net/dpml/transit/test/MimeHandlerTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -23,7 +23,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import net.dpml.transit.util.MimeTypeHandler;
+import net.dpml.util.MimeTypeHandler;
/**
* MimeHandlerTestCase.
Modified:
trunk/main/transit/core/src/test/net/dpml/transit/test/PropertyResolverTestCase.java
===================================================================
---
trunk/main/transit/core/src/test/net/dpml/transit/test/PropertyResolverTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/transit/core/src/test/net/dpml/transit/test/PropertyResolverTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -23,7 +23,7 @@
import java.util.Properties;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.PropertyResolver;
/**
* Testcases for the PropertyResolver
Modified:
trunk/main/transit/tools/src/main/net/dpml/transit/tools/AntAdapter.java
===================================================================
--- trunk/main/transit/tools/src/main/net/dpml/transit/tools/AntAdapter.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/tools/src/main/net/dpml/transit/tools/AntAdapter.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -21,7 +21,7 @@
import java.net.URL;
import net.dpml.transit.monitor.Adapter;
-import net.dpml.transit.util.ExceptionHelper;
+import net.dpml.util.ExceptionHelper;
import net.dpml.lang.Logger;
import org.apache.tools.ant.Task;
Modified:
trunk/main/transit/tools/src/main/net/dpml/transit/tools/ImportArtifactTask.java
===================================================================
---
trunk/main/transit/tools/src/main/net/dpml/transit/tools/ImportArtifactTask.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/transit/tools/src/main/net/dpml/transit/tools/ImportArtifactTask.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -27,7 +27,7 @@
import org.apache.tools.ant.taskdefs.ImportTask;
import net.dpml.transit.Artifact;
-import net.dpml.transit.util.PropertyResolver;
+import net.dpml.util.PropertyResolver;
/**
* Ant task that provides support for the import of build file templates
Modified:
trunk/main/transit/tools/src/main/net/dpml/transit/tools/PluginTask.java
===================================================================
--- trunk/main/transit/tools/src/main/net/dpml/transit/tools/PluginTask.java
2006-04-05 19:00:01 UTC (rev 1319)
+++ trunk/main/transit/tools/src/main/net/dpml/transit/tools/PluginTask.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -28,7 +28,7 @@
import java.util.List;
import java.util.ArrayList;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import net.dpml.part.Part;
import net.dpml.part.Resource;
Modified:
trunk/main/transit/tools/src/main/net/dpml/transit/tools/TransitComponentHelper.java
===================================================================
---
trunk/main/transit/tools/src/main/net/dpml/transit/tools/TransitComponentHelper.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/transit/tools/src/main/net/dpml/transit/tools/TransitComponentHelper.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -27,7 +27,7 @@
import net.dpml.part.Plugin;
import net.dpml.part.Resource;
-import net.dpml.transit.util.ElementHelper;
+import net.dpml.util.ElementHelper;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.BuildException;
Modified:
trunk/main/util/job/impl/src/test/net/dpml/job/test/DefaultCommissionerTestCase.java
===================================================================
---
trunk/main/util/job/impl/src/test/net/dpml/job/test/DefaultCommissionerTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
+++
trunk/main/util/job/impl/src/test/net/dpml/job/test/DefaultCommissionerTestCase.java
2006-04-05 20:33:36 UTC (rev 1320)
@@ -47,7 +47,7 @@
{
System.setProperty(
"java.util.logging.config.class",
- "net.dpml.transit.util.ConfigurationHandler" );
+ "net.dpml.util.ConfigurationHandler" );
System.setProperty(
"dpml.logging.config",
"file:" + System.getProperty( "project.test.dir" ) +
"/logging.properties" );
- r1320 - in trunk/main: . central/src/docs/transit/concepts depot/core/src/main/net/dpml/depot depot/install/src/main/net/dpml/depot/install depot/library/src/main/net/dpml/library/impl depot/library/src/test/net/dpml/library/impl depot/tools/builder/src/main/net/dpml/tools/info depot/tools/builder/src/main/net/dpml/tools/process metro/component/src/main/net/dpml/component metro/runtime/src/main/net/dpml/metro/builder metro/state/impl/src/main/net/dpml/state/impl metro/test/src/test/net/dpml/test/part metro/test/src/test/net/dpml/test/runtime planet/http/impl/src/main/net/dpml/http planet/http/test/src/test/net/dpml/http/test station/api/src/test/net/dpml/station/info station/builder/src/main/net/dpml/station/builder station/console/src/main/net/dpml/station/console station/exec/src/main/net/dpml/station/exec station/server/etc/prefs/propertiess station/server/src/main/net/dpml/station/server transit/console/src/main/net/dpml/transit/console transit/core/src/main/net! /dpml transit/core/src/main/net/dpml/lang transit/core/src/main/net/dpml/part transit/core/src/main/net/dpml/transit transit/core/src/main/net/dpml/transit/artifact transit/core/src/main/net/dpml/transit/link transit/core/src/main/net/dpml/util transit/core/src/test/net/dpml/transit/test transit/tools/src/main/net/dpml/transit/tools util/job/impl/src/test/net/dpml/job/test, mcconnell at BerliOS, 04/05/2006
Archive powered by MHonArc 2.6.24.