Skip to Content.
Sympa Menu

notify-dpml - r1319 - in trunk/main: depot depot/core/src/main/net/dpml/depot depot/library/src/main/net/dpml/library/impl depot/tools/builder/src/main/net/dpml/tools/tasks metro metro/component/src/main/net/dpml/component metro/test/src/test/net/dpml/test/part planet/http/test/src/test/net/dpml/http/test station/exec/src/main/net/dpml/station/exec transit transit/console/src/main/net/dpml/transit/console transit/core/src/main/net/dpml/part transit/core/src/main/net/dpml/transit transit/core/src/main/net/dpml/transit/artifact transit/tools/src/main/net/dpml/transit/tools

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: r1319 - in trunk/main: depot depot/core/src/main/net/dpml/depot depot/library/src/main/net/dpml/library/impl depot/tools/builder/src/main/net/dpml/tools/tasks metro metro/component/src/main/net/dpml/component metro/test/src/test/net/dpml/test/part planet/http/test/src/test/net/dpml/http/test station/exec/src/main/net/dpml/station/exec transit transit/console/src/main/net/dpml/transit/console transit/core/src/main/net/dpml/part transit/core/src/main/net/dpml/transit transit/core/src/main/net/dpml/transit/artifact transit/tools/src/main/net/dpml/transit/tools
  • Date: Wed, 5 Apr 2006 21:00:29 +0200

Author: mcconnell
Date: 2006-04-05 21:00:01 +0200 (Wed, 05 Apr 2006)
New Revision: 1319

Added:
trunk/main/transit/core/src/main/net/dpml/part/PartException.java
Removed:
trunk/main/depot/DEPOT_README.TXT
trunk/main/metro/METRO_README.TXT
trunk/main/metro/content/
trunk/main/metro/install/
trunk/main/transit/TRANSIT_README.TXT
trunk/main/transit/core/src/main/net/dpml/part/PartHandlerException.java
trunk/main/transit/core/src/main/net/dpml/transit/Repository.java
trunk/main/transit/core/src/main/net/dpml/transit/StandardLoader.java
Modified:
trunk/main/depot/core/src/main/net/dpml/depot/Main.java
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java

trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/InitializationTask.java
trunk/main/metro/component/src/main/net/dpml/component/InitialContext.java
trunk/main/metro/module.xml
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java

trunk/main/station/exec/src/main/net/dpml/station/exec/ComponentAdapter.java

trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
trunk/main/transit/core/src/main/net/dpml/part/DecoderFactory.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/transit/DefaultContentRegistry.java

trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistry.java

trunk/main/transit/core/src/main/net/dpml/transit/SecuredTransitContext.java
trunk/main/transit/core/src/main/net/dpml/transit/Transit.java

trunk/main/transit/core/src/main/net/dpml/transit/artifact/ArtifactURLConnection.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
Log:
1. remove Repository interface (functionality now available via Part)
2. move all code over to Part.load( uri ) or Part.load( uri ).instantiate(
args )
3. remove redundant content handler
4. remove metro install project
5. remove old readme files

Deleted: trunk/main/depot/DEPOT_README.TXT
===================================================================
--- trunk/main/depot/DEPOT_README.TXT 2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/depot/DEPOT_README.TXT 2006-04-05 19:00:01 UTC (rev 1319)
@@ -1,77 +0,0 @@
-
-Product: Depot
-Description: DPML Build System
-Publisher: The Digital Product Meta Library
-Revision: @PROJECT-VERSION@
-
-Release Notes: Version @PROJECT-VERSION@
--------------------------------
-
-Resolves bugs identified following the 005124 release.
-
- 1. Resolve bug concerning checkstyle plugin reference.
- 2. Improve project invalid reference error reporting.
- 3. Resolve bug concerning undefined default filter values.
- 4. Resolve bug concerning checkstyle rules property evaluation.
- 5. Resolve packaging bug (missing lib directory content)
-
-Updates to the replicate task allowing for the selection of a target
-repository layout scheme.
-
-Release Notes: Version 20051224
--------------------------------
-
-Incorporated Janel distribution under ASL 2.0 and added project and
-copyright attribution to NOTICE.TXT. Upgrade to Janel 2.5.0 (resolving
-issues with working directory resolution). Updates to DPML Station with
-support for multi-JVM deployment and teardown. Added a remote logging
-services that handles message aggregation from multiple JVMs to the central
-station and support for JVM process identity within the default log message
-formatter. Major cleanup of the profile API and implementation with
-consolidation around the ApplicationProfile class. Updated Depot icons
-based on content from CrystalXP.net and inclusion of credits in
-NOTICE.TXT. Improvements to Depot Preferences when running on JRE 5.0
-under Windows and general enhancements to Preferences table information.
-
-Enhanced the console to support deployment of plugin handlers that add
-supplimentary content to the system classloader.
-
-Added support for dynamic loading of a part editor to ensure that different
-versions of parts can supply their own editors based on the underlying
-controller declared by the part instance.
-
-Release Notes: Version 20050809
--------------------------------
-
-Revision: 191
-Improvements to the install task relating to the removal of cached
-links during the bundle expansion process - which in turn resolves issue
-related to version downgrading. This milestone now properly supports setup
-version arguments greater then or less than the current version. Also
-includes upgrades to download logging info and general feedback provided
-during the setup process.
-
-Release Notes: Version 20050806
--------------------------------
-
-Revision: 176
-
-Release Notes: Version 20050803
--------------------------------
-
-Revision: 155
-
-Separation of profile API.
-Replacement of depot.bat with depot.exe.
-Support for -D[name]=[value] under depot console
-Separation of application handling as a plugin.
-Replacement of -install option with -setup option.
-Cleaner and safer setup process (such to validation unde nix).
-Support for native Win32 setup subprocess and java for nix.
-
-Release Notes: Version 20050726
--------------------------------
-
-Revision: 119
-
-

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
17:18:27 UTC (rev 1318)
+++ trunk/main/depot/core/src/main/net/dpml/depot/Main.java 2006-04-05
19:00:01 UTC (rev 1319)
@@ -28,8 +28,6 @@
import net.dpml.transit.Disposable;
import net.dpml.transit.Transit;
import net.dpml.transit.TransitError;
-import net.dpml.transit.Repository;
-import net.dpml.transit.RepositoryException;
import net.dpml.transit.DefaultTransitModel;
import net.dpml.transit.model.TransitModel;
import net.dpml.transit.monitor.Adapter;
@@ -42,6 +40,8 @@
import net.dpml.lang.PID;
import net.dpml.lang.Logger;

+import net.dpml.part.Part;
+
/**
* CLI hander for the depot package.
*
@@ -230,10 +230,10 @@
URI uri = new URI( path );
Transit transit = Transit.getInstance( model );
setupMonitors( transit, (Adapter) logger );
- Repository repository = transit.getRepository();
+
+ Part part = Part.load( uri );
m_plugin =
- repository.getPlugin(
- uri,
+ part.instantiate(
new Object[]
{
model,
@@ -242,8 +242,13 @@
}
);
}
- catch( RepositoryException e )
+ catch( GeneralException e )
{
+ getLogger().error( e.getMessage() );
+ System.exit( 1 );
+ }
+ catch( Exception e )
+ {
Throwable cause = e.getCause();
if( ( null != cause ) && ( cause instanceof GeneralException ) )
{
@@ -256,11 +261,6 @@
System.exit( 1 );
}
}
- catch( GeneralException e )
- {
- getLogger().error( e.getMessage() );
- System.exit( 1 );
- }
catch( Throwable e )
{
final String error =

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 17:18:27 UTC (rev 1318)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -37,12 +37,11 @@
import net.dpml.library.info.TypeDirective;
import net.dpml.library.info.Scope;

-import net.dpml.transit.Repository;
-import net.dpml.transit.Transit;
import net.dpml.transit.util.ElementHelper;

import net.dpml.lang.Category;
import net.dpml.part.DecodingException;
+import net.dpml.part.Part;

import net.dpml.part.DOM3DocumentBuilder;

@@ -744,9 +743,9 @@
private TypeBuilder loadTypeBuilder( URI uri ) throws Exception
{
ClassLoader classloader = TypeBuilder.class.getClassLoader();
- Repository repository = Transit.getInstance().getRepository();
Object[] args = new Object[0];
- Object handler = repository.getPlugin( uri, args );
+ Part part = Part.load( uri );
+ Object handler = part.instantiate( args );
if( handler instanceof TypeBuilder )
{
return (TypeBuilder) handler;

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/InitializationTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/InitializationTask.java
2006-04-05 17:18:27 UTC (rev 1318)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/InitializationTask.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -31,9 +31,6 @@
import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.BuildException;

-import net.dpml.transit.Transit;
-import net.dpml.transit.Repository;
-
import net.dpml.part.Part;
import net.dpml.part.Plugin;

@@ -82,7 +79,6 @@
private BuildListener[] getBuildListeners( Processor[] processors )
throws ProcessorInstantiationException
{
- Repository repository = Transit.getInstance().getRepository();
BuildListener[] listeners = new BuildListener[ processors.length ];
for( int i=0; i<processors.length; i++ )
{
@@ -127,14 +123,13 @@
String classname = processor.getClassname();
Object[] params = new Object[]{processor};

+ Part part = Part.load( uri );
if( null == classname )
{
- listeners[i] =
- (BuildListener)
Transit.getInstance().getRepository().getPlugin( uri, params );
+ listeners[i] = (BuildListener) part.instantiate(
params );
}
else
{
- Part part = repository.getPart( uri );
ClassLoader loader = part.getClassLoader();
Class c = loader.loadClass( classname );
listeners[i] = (BuildListener) Plugin.instantiate(
c, params );

Deleted: trunk/main/metro/METRO_README.TXT
===================================================================
--- trunk/main/metro/METRO_README.TXT 2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/metro/METRO_README.TXT 2006-04-05 19:00:01 UTC (rev 1319)
@@ -1,56 +0,0 @@
-
-Product: Metro
-Description: Component Management Platform
-Publisher: The Digital Product Meta Library
-Revision: @PROJECT-VERSION@
-
-Release Notes: Version @PROJECT-VERSION@
--------------------------------
-
-Added part content handler plugin.
-Add support for implicit stop of an application when deleting the profile.
-
-Release Notes: Version 20051224
--------------------------------
-
-General enhancements to the Part contract model including improvements
-in the way top-level versus composite parts and handled. Separation of
-state related aspects into a new package 'net.dpml.state' supported by a
-cleaner implementation. Introduced support for long-term storage of
-descriptors and directivies compliant with JSR-57. Added definition and
-implemetnation of a remote component model and context model suitable
-for deployment independently of a component runtime (i.e. management
-occurs on machine 'a' and deployment occurs on machine 'b'). Moved all
-enumerations to formally typed enumerations (e.g. CollectionPolicy,
-LifestylePolicy, etc.).
-
-Release Notes: Version 20050809
--------------------------------
-
-Revision: 184
-
-Internal changes to classloader construction arising from tests using
-different controller implementations within a single composite component.
-These changes enable the concurrent execution of different controller
-implementations handling components models at different nodes in a component
-model hierarchy. In practice this means that a component build with control
-system A can deploy parts built with control system B which in turn can
-deploy parts using system X - the common factor being the part API (which
-is independent of lifecycle interfaces such as Configuration, Parameters,
-Logging, etc.).
-
-Release Notes: Version 20050806
--------------------------------
-
-Revision: 176
-
-Release Notes: Version 20050803
--------------------------------
-
-Revision: 155
-
-Release Notes: Version 20050726
--------------------------------
-
-Revision: 118
-

Modified:
trunk/main/metro/component/src/main/net/dpml/component/InitialContext.java
===================================================================
---
trunk/main/metro/component/src/main/net/dpml/component/InitialContext.java
2006-04-05 17:18:27 UTC (rev 1318)
+++
trunk/main/metro/component/src/main/net/dpml/component/InitialContext.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -27,10 +27,11 @@
import java.util.EventObject;
import java.util.EventListener;

-import net.dpml.transit.Transit;
-import net.dpml.transit.Repository;
-import net.dpml.transit.monitor.LoggingAdapter;
+import net.dpml.lang.DefaultLogger;

+import net.dpml.part.Part;
+import net.dpml.part.Plugin;
+
/**
* The CompositionControllerContext class wraps a ContentModel and supplies
convinience
* operations that translate ContentModel properties and events to type-safe
values used
@@ -146,11 +147,18 @@
{
Thread.currentThread().setContextClassLoader(
InitialContext.class.getClassLoader() );
URI uri = getControllerURI();
- Repository repository = Transit.getInstance().getRepository();
- Class c = repository.getPluginClass( uri );
- Constructor constructor = c.getConstructor( new
Class[]{ControllerContext.class} );
- Controller controller = (Controller) constructor.newInstance(
new Object[]{control} );
- return controller;
+ Part part = Part.load( uri );
+ if( part instanceof Plugin )
+ {
+ Plugin plugin = (Plugin) part;
+ Class c = plugin.getPluginClass();
+ Constructor constructor = c.getConstructor( new
Class[]{ControllerContext.class} );
+ return (Controller) constructor.newInstance( new
Object[]{control} );
+ }
+ else
+ {
+ return (Controller) part.instantiate( new Object[]{control}
);
+ }
}
catch( Throwable e )
{
@@ -212,7 +220,7 @@
*/
public InitialContext( String partition, File work, File temp )
{
- super( new LoggingAdapter( partition ) );
+ super( new DefaultLogger( partition ) );

m_partition = partition;


Modified: trunk/main/metro/module.xml
===================================================================
--- trunk/main/metro/module.xml 2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/metro/module.xml 2006-04-05 19:00:01 UTC (rev 1319)
@@ -37,23 +37,6 @@
</dependencies>
</project>

- <project name="dpml-metro-content" basedir="content">
- <types>
- <type id="jar"/>
- <part:plugin alias="true"
class="net.dpml.metro.content.PartContentHandler"/>
- </types>
- <dependencies scope="build">
- <include key="dpml-metro-runtime"/>
- </dependencies>
- <dependencies>
- <include key="dpml-metro-component"/>
- <include ref="dpml/util/dpml-logging-api"/>
- </dependencies>
- <dependencies scope="test">
- <include ref="ant/ant-junit"/>
- </dependencies>
- </project>
-
<project name="dpml-metro-model" basedir="model">
<types>
<type id="jar"/>

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 17:18:27 UTC (rev 1318)
+++
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -65,7 +65,7 @@

// initialize the controller

- Part part = Transit.getInstance().getRepository().getPart( m_uri );
+ Part part = Part.load( m_uri );

// do stuff


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 17:18:27 UTC (rev 1318)
+++
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -22,7 +22,7 @@

import junit.framework.TestCase;

-import net.dpml.transit.Transit;
+import net.dpml.part.Part;

/**
* Server component testcase.
@@ -39,7 +39,8 @@
public void testServerDeployment() throws Exception
{
URI uri = new URI( "link:part:dpml/planet/http/dpml-http-server" );
- Object object = Transit.getInstance().getRepository().getPlugin(
uri, new Object[0] );
+ Part part = Part.load( uri );
+ Object object = part.instantiate( new Object[0] );
assertEquals( "class", "net.dpml.http.Server",
object.getClass().getName() );
}

@@ -56,10 +57,3 @@
"local:properties:dpml/transit/default" );
}
}
-
-
-//PartsManager parts = component.getPartsManager();
-//ComponentHandler webapp = parts.getComponentHandler( "webapp" );
-//File temp = new File( "target/test/temp" );
-//webapp.getContextMap().put( "tempDirectory", temp );
-//component.getProvider().getValue( false );

Modified:
trunk/main/station/exec/src/main/net/dpml/station/exec/ComponentAdapter.java
===================================================================
---
trunk/main/station/exec/src/main/net/dpml/station/exec/ComponentAdapter.java
2006-04-05 17:18:27 UTC (rev 1318)
+++
trunk/main/station/exec/src/main/net/dpml/station/exec/ComponentAdapter.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -51,8 +51,8 @@

import net.dpml.lang.Logger;

-import net.dpml.transit.Repository;
-import net.dpml.transit.Transit;
+import net.dpml.part.Part;
+import net.dpml.part.Plugin;

/**
* The ComponentAdapter provides support for the establishment of a part
@@ -107,11 +107,19 @@
{
ClassLoader classloader = Controller.class.getClassLoader();
URI uri = new URI( "@COMPOSITION-CONTROLLER-URI@" );
- Repository repository = Transit.getInstance().getRepository();
- Class c = repository.getPluginClass( uri );
+ Part part = Part.load( uri );
InitialContext context = new InitialContext( partition );
- Constructor constructor = c.getConstructor( new
Class[]{ControllerContext.class} );
- m_controller = (Controller) constructor.newInstance( new
Object[]{context} );
+ if( part instanceof Plugin )
+ {
+ Plugin plugin = (Plugin) part;
+ Class c = plugin.getPluginClass();
+ Constructor constructor = c.getConstructor( new
Class[]{ControllerContext.class} );
+ m_controller = (Controller) constructor.newInstance( new
Object[]{context} );
+ }
+ else
+ {
+ m_controller = (Controller) part.instantiate( new
Object[]{context} );
+ }
}
catch( Exception e )
{

Deleted: trunk/main/transit/TRANSIT_README.TXT
===================================================================
--- trunk/main/transit/TRANSIT_README.TXT 2006-04-05 17:18:27 UTC (rev
1318)
+++ trunk/main/transit/TRANSIT_README.TXT 2006-04-05 19:00:01 UTC (rev
1319)
@@ -1,81 +0,0 @@
-
-Product: Transit
-Description: Resource Management Framework
-Publisher: The Digital Product Meta Library
-Home: http://www.dpml.net
-Revision: @PROJECT-VERSION@
-
-Installation Instructions
-=========================
-
-Release Notes: Version @PROJECT-VERSION@
--------------------------------
-
-Moved ${dpml.data}/lib to ${dpml.system}/lib.
-Resolve bug in modern layout handler.
-Updated transit to provide access to named layouts.
-Changed the local system repository default layout from 'classic' to
'modern'.
-
-
-Release Notes: Version 20051224
--------------------------------
-
-Added a registry protocol handler enabling publication of references to an
-RMI registry in the form registry://[host]:[port]/[path] or the shortform
-registry:/[path]. Updates to the standard log message formatter to include
-the JVM process identifier. Updates to the ContentModel implementation to
-include the declaration of constructed types used as plugin parameters.
-Improvement to the plugin loader preventing the assignment of an argument
-to more than one constructor parameter value. Addition of support for
-primitive arguments in plugin constructors (such as int, boolean, etc.).
-Upgrade of plugin model to include support for system level jar files
-(e.g. protocol handlers or L&F implementations that need to exist in the
-system classloader). Added Enum and ValuedEnum to util package. Extended
-the Construct class to alow references to static member variables. Add
-a prefs task to Transit tools supporting the generation of XML based
-preferences info in preparation for replacement of configuration and
-parameters. Consolidated all configuration options down to a single strategy
-based on the net.dpml.transit.info immutable datatypes. Added support for
-the 'modern' layout strategy which add compatibility with the recent Maven2
-repository layout. Added the transit commandline configuration tool.
-
-Release Notes: Version 20050809
--------------------------------
-
-Revision: 191
-Implementation improvements to transit management of dynamic content
-handlers concerning supply of the current logging channel to the handler.
-Addition of isWarnEnabled to Translit Logger. Improvements to debug info
-generated from the transit classloader.
-
-Release Notes: Version 20050806
--------------------------------
-
-Revision: 176
-Complete checkstyle cleanup.
-Javadoc improvements.
-
-Release Notes: Version 20050803
--------------------------------
-
-Revision: 155
-
-Running RMID with Transit
-
- The following example commandline demonstrates the execution
- of the RMID process with Transit enabled on sub-processes.
- The [DPML] symbol should be replaced by the the absolute file
- path to respective directories.
-
- $ rmid -J-Xrs -log [DPML]\logs\rmid
- -J-Djava.security.policy=[DPML]\Shared\bin\security.policy
- -C-Xbootclasspath/a:[DPML]\Data\lib\dpml-transit-main.jar
- -C-Djava.security.policy=[DPML]\Shared\bin\security.policy
- -C-Djava.protocol.handler.pkgs=net.dpml.transit
-
-Release Notes: Version 20050726
--------------------------------
-
-Revision: 118
-
-

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 17:18:27 UTC (rev 1318)
+++
trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -48,10 +48,12 @@
import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.ValueDirective;

+import net.dpml.part.Part;
+import net.dpml.part.PartException;
+
import net.dpml.transit.Artifact;
import net.dpml.transit.Transit;
import net.dpml.transit.TransitBuilder;
-import net.dpml.transit.RepositoryException;
import net.dpml.transit.DefaultTransitModel;
import net.dpml.transit.info.TransitDirective;
import net.dpml.transit.info.ProxyDirective;
@@ -170,15 +172,15 @@
URI uri = (URI) line.getValue( LOAD_COMMAND, null );
List list = line.getValues( ARGUMENTS );
String[] args = (String[]) list.toArray( new String[ list.size()
] );
- Object instance =
- Transit.getInstance().getRepository().getPlugin( uri, new
Object[]{args} );
+ Part part = Part.load( uri );
+ Object instance = part.instantiate( new Object[]{args} );
if( instance instanceof Runnable )
{
Runnable runnable = (Runnable) instance;
runnable.run();
}
}
- catch( RepositoryException e )
+ catch( PartException e )
{
boolean stack = isDebugEnabled();
String message = ExceptionHelper.packException( e, stack );
@@ -201,7 +203,7 @@
else
{
final String error =
- "Plugin exception.";
+ "Part exception.";
String message = ExceptionHelper.packException( error, e, true
);
System.out.println( message );
}

Modified: trunk/main/transit/core/src/main/net/dpml/part/DecoderFactory.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/DecoderFactory.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/part/DecoderFactory.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -24,8 +24,6 @@
import java.util.Hashtable;

import net.dpml.transit.Artifact;
-import net.dpml.transit.Transit;
-import net.dpml.transit.Repository;

import org.w3c.dom.Element;
import org.w3c.dom.TypeInfo;
@@ -190,9 +188,9 @@
{
try
{
- Repository repository =
Transit.getInstance().getRepository();
Object[] args = new Object[]{m_factory};
- return repository.getPlugin( m_uri, args );
+ Part part = Part.load( m_uri );
+ return part.instantiate( args );
}
catch( Throwable e )
{

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 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/part/PartDecoder.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -94,9 +94,6 @@
{
getLogger().debug( "loading part [" + uri + "] from
cache." );
}
- //System.out.println( "CACHED PART: " + key );
- //Exception e = new Exception( "trace" );
- //e.printStackTrace();
return part;
}
}
@@ -106,9 +103,6 @@
{
getLogger().debug( "loading part [" + uri + "] from source."
);
}
- //System.out.println( "LOADING PART: " + key );
- //Exception e = new Exception( "trace" );
- //e.printStackTrace();
final Document document = DOCUMENT_BUILDER.parse( uri );
final Element root = document.getDocumentElement();
Part value = decodePart( uri, root );
@@ -178,7 +172,7 @@
* Resolve a part plugin or resource strategy.
* @param information the part info definition
* @param classpath the part classpath definition
- * @param element element part definition
+ * @param strategy part deployment strategy definition
* @return the resolved part
* @exception IOException if an error occurs during element evaluation
*/
@@ -289,7 +283,7 @@
+ " interface."
+ "\nURI: " + uri
+ "\nClass: " + object.getClass().getName();
- throw new PartHandlerException( error );
+ throw new PartException( error );
}
}
else
@@ -300,7 +294,7 @@
+ "."
+ "\nURI: " + uri
+ "\nPart Type: " + part.getClass().getName();
- throw new PartHandlerException( error );
+ throw new PartException( error );
}
}


Copied: trunk/main/transit/core/src/main/net/dpml/part/PartException.java
(from rev 1304,
trunk/main/transit/core/src/main/net/dpml/part/PartHandlerException.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/PartHandlerException.java
2006-04-04 13:26:28 UTC (rev 1304)
+++ trunk/main/transit/core/src/main/net/dpml/part/PartException.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2004-2005 Stephen J. McConnell.
+ * Copyright 2004 Niclas Hedhman.
+ *
+ * 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 net.dpml.part;
+
+import java.io.IOException;
+
+/**
+ * Exception to indicate that there was a part handler related error.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class PartException extends IOException
+{
+ /**
+ * Serial version identifier.
+ */
+ static final long serialVersionUID = 1L;
+
+ /**
+ * Construct a new <code>PartException</code> instance.
+ *
+ * @param message The detail message for this exception.
+ */
+ public PartException( final String message )
+ {
+ this( message, null );
+ }
+
+ /**
+ * Construct a new <code>PartException</code> instance.
+ *
+ * @param message The detail message for this exception.
+ * @param cause the root cause of the exception
+ */
+ public PartException( final String message, final Throwable cause )
+ {
+ super( message );
+ super.initCause( cause );
+ }
+}
+
+

Deleted:
trunk/main/transit/core/src/main/net/dpml/part/PartHandlerException.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/PartHandlerException.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/part/PartHandlerException.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -1,60 +0,0 @@
-/*
- * Copyright 2004-2005 Stephen J. McConnell.
- * Copyright 2004 Niclas Hedhman.
- *
- * 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 net.dpml.part;
-
-import java.io.IOException;
-
-/**
- * Exception to indicate that there was a part handler related error.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class PartHandlerException extends IOException
-{
- /**
- * Serial version identifier.
- */
- static final long serialVersionUID = 1L;
-
- /**
- * Construct a new <code>PartHandlerException</code> instance.
- *
- * @param message The detail message for this exception.
- */
- public PartHandlerException( final String message )
- {
- this( message, null );
- }
-
- /**
- * Construct a new <code>PartHandlerException</code> instance.
- *
- * @param message The detail message for this exception.
- * @param cause the root cause of the exception
- */
- public PartHandlerException( final String message, final Throwable cause
)
- {
- super( message );
- super.initCause( cause );
- }
-}
-
-

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
17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/part/Plugin.java 2006-04-05
19:00:01 UTC (rev 1319)
@@ -260,7 +260,7 @@
{
throw e;
}
- catch( PartHandlerException e )
+ catch( PartException e )
{
throw e;
}
@@ -268,19 +268,19 @@
{
final String error =
"Class instantiation error [" + clazz.getName() + "]";
- throw new PartHandlerException( error, e );
+ throw new PartException( error, e );
}
}
}

private static Object instantiate( Constructor constructor, Object[]
args )
- throws PartHandlerException, InvocationTargetException
+ throws PartException, InvocationTargetException
{
Object[] arguments = populate( constructor, args );
return newInstance( constructor, arguments );
}

- private static Object[] populate( Constructor constructor, Object[] args
) throws PartHandlerException
+ private static Object[] populate( Constructor constructor, Object[] args
) throws PartException
{
if( null == constructor )
{
@@ -342,7 +342,7 @@
+ "\nConstructor class: " +
constructor.getDeclaringClass().getName()
+ "\nParameter class: " + c.getName()
+ "\nParameter position: " + ( i + 1 );
- throw new PartHandlerException( error );
+ throw new PartException( error );
}
}
}
@@ -397,7 +397,7 @@
}

private static Object newInstance( Constructor constructor, Object[]
arguments )
- throws PartHandlerException, InvocationTargetException
+ throws PartException, InvocationTargetException
{
try
{
@@ -415,11 +415,11 @@
"Cannot create an instance of ["
+ constructor.getDeclaringClass().getName()
+ "] due to an instantiation failure.";
- throw new PartHandlerException( error, e );
+ throw new PartException( error, e );
}
}

- private static Constructor getSingleConstructor( Class clazz ) throws
PartHandlerException
+ private static Constructor getSingleConstructor( Class clazz ) throws
PartException
{
if( null == clazz )
{
@@ -432,7 +432,7 @@
"Target class ["
+ clazz.getName()
+ "] does not declare a public constructor.";
- throw new PartHandlerException( error );
+ throw new PartException( error );
}
else if( constructors.length > 1 )
{
@@ -440,7 +440,7 @@
"Target class ["
+ clazz.getName()
+ "] declares multiple public constructors.";
- throw new PartHandlerException( error );
+ throw new PartException( error );
}
else
{
@@ -454,7 +454,7 @@
* @return the empty array instance
* @exception RepositoryException if an error occurs
*/
- private static Object[] getEmptyArrayInstance( Class clazz ) throws
PartHandlerException
+ private static Object[] getEmptyArrayInstance( Class clazz ) throws
PartException
{
try
{
@@ -465,7 +465,7 @@
final String error =
"Internal error while attempting to construct an empty array
for the class: "
+ clazz.getName();
- throw new PartHandlerException( error, e );
+ throw new PartException( error, e );
}
}
}

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistry.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistry.java
2006-04-05 17:18:27 UTC (rev 1318)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistry.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -37,6 +37,7 @@
import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.Logger;

+import net.dpml.part.Part;
import net.dpml.part.Plugin;

/**
@@ -232,8 +233,19 @@
try
{
m_logger.debug( "loading content handler plugin: " + uri );
- Repository loader = Transit.getInstance().getRepository();
- clazz = loader.getPluginClass( uri );
+ Part part = Part.load( uri );
+ if( part instanceof Plugin )
+ {
+ Plugin plugin = (Plugin) part;
+ clazz = plugin.getPluginClass();
+ }
+ else
+ {
+ final String error =
+ "Impementation assumes plugin strategy. Cannot load
non-plugin part."
+ + "\nURI: " + uri;
+ throw new IOException( error );
+ }
}
catch( Exception e )
{

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistry.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistry.java
2006-04-05 17:18:27 UTC (rev 1318)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistry.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -33,6 +33,7 @@
import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.Logger;

+import net.dpml.part.Part;
import net.dpml.part.Plugin;

/**
@@ -151,8 +152,19 @@
try
{
m_logger.debug( "loading resolver plugin: " + uri );
- Repository loader = Transit.getInstance().getRepository();
- clazz = loader.getPluginClass( uri );
+ Part part = Part.load( uri );
+ if( part instanceof Plugin )
+ {
+ Plugin plugin = (Plugin) part;
+ clazz = plugin.getPluginClass();
+ }
+ else
+ {
+ final String error =
+ "Cannot load non-plugin part (impementation assumes
plugin strategy)."
+ + "\nURI: " + uri;
+ throw new IOException( error );
+ }
}
catch( Exception e )
{

Deleted: trunk/main/transit/core/src/main/net/dpml/transit/Repository.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Repository.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Repository.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -1,73 +0,0 @@
-/*
- * Copyright 2004-2005 Stephen J. McConnell.
- * Copyright 2004 Niclas Hedhman.
- *
- * 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 net.dpml.transit;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-
-import java.net.URI;
-
-import net.dpml.part.Part;
-
-/**
- * A service that provides support for the establishment of classloaders and
plugin
- * instances based on plugin descriptor describing a classloader chain.
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public interface Repository
-{
- /**
- * Creates a plugin descriptor from an artifact.
- *
- * @param uri the artifact reference to the plugin descriptor
- * @return the plugin descriptor
- * @exception IOException if a factory creation error occurs
- */
- Part getPart( URI uri ) throws IOException;
-
- /**
- * Get a part classloader relative to a supplied uri.
- *
- * @param uri the part uri
- * @return the plugin classloader
- * @exception IOException if plugin loading exception occurs
- */
- ClassLoader getPluginClassLoader( URI uri ) throws IOException;
-
- /**
- * Get a plugin class relative to a supplied uri.
- *
- * @param uri the part uri
- * @return the part class
- * @exception IOException if plugin loading exception occurs
- */
- Class getPluginClass( URI uri ) throws IOException;
-
- /**
- * Creates an object from a uri reference.
- *
- * @param uri the reference to the application
- * @param args instantiation arguments
- * @return the plugin instance
- * @exception IOException if plugin loading exception occurs
- * @exception InvocationTargetException if the plugin constructor
invocation error occurs
- */
- Object getPlugin( URI uri, Object[] args ) throws IOException,
InvocationTargetException;
-}

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/SecuredTransitContext.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/SecuredTransitContext.java
2006-04-05 17:18:27 UTC (rev 1318)
+++
trunk/main/transit/core/src/main/net/dpml/transit/SecuredTransitContext.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -43,6 +43,7 @@
import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.Logger;

+
/**
* The initial context of the transit system.
*
@@ -163,7 +164,7 @@
/**
* The repository service provider.
*/
- private Repository m_repository;
+ //private Repository m_repository;

private ProxyController m_proxyController;

@@ -239,10 +240,10 @@
* Return the Transit repository service.
* @return the repository service
*/
- public Repository getRepository()
- {
- return m_repository;
- }
+ //public Repository getRepository()
+ //{
+ // return m_repository;
+ //}

/**
* Return the cache handler.
@@ -310,8 +311,8 @@
protected void initialize() throws IOException
{
m_linkManager = new ArtifactLinkManager();
- Logger logger = getLogger().getChildLogger( "cache" );
- m_repository = new StandardLoader( logger ); // this needs to be
configured
+ //Logger logger = getLogger().getChildLogger( "cache" );
+ //m_repository = new StandardLoader( logger ); // this needs to be
configured
initializeCache();
}


Deleted: trunk/main/transit/core/src/main/net/dpml/transit/StandardLoader.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/StandardLoader.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/transit/StandardLoader.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -1,176 +0,0 @@
-/*
- * Copyright 2004-2005 Stephen J. McConnell.
- * Copyright 2004 Niclas Hedhman.
- *
- * 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 net.dpml.transit;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URI;
-
-import net.dpml.lang.Logger;
-
-import net.dpml.part.Part;
-import net.dpml.part.Plugin;
-
-import net.dpml.transit.monitor.RepositoryMonitorRouter;
-
-/**
- * Utility class supporting downloading of resources based on
- * artifact references.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-class StandardLoader implements Repository
-{
- private final Logger m_logger;
-
- /**
- * Creation of a new repository handler.
- * @param logger the assigned logging channel
- */
- StandardLoader( Logger logger )
- {
- m_logger = logger;
- }
-
- //
------------------------------------------------------------------------
- // Repository
- //
------------------------------------------------------------------------
-
- /**
- * Creates a plugin descriptor from an artifact.
- *
- * @param uri the artifact reference to the plugin descriptor
- * @return the plugin descriptor
- * @exception IOException if a factory creation error occurs
- */
- public Part getPart( URI uri ) throws IOException
- {
- try
- {
- return Part.load( uri );
- }
- catch( Exception e )
- {
- final String error =
- "Unexpected error during part resolve."
- + "\nURI: " + uri;
- throw new RepositoryException( error, e );
- }
- }
-
- /**
- * Get a plugin classloader relative to a supplied uri.
- *
- * @param uri the plugin uri
- * @return the plugin classloader.
- * @exception IOException if plugin loading exception occurs.
- * @exception NullArgumentException if the supplied uri or parent
classloader
- * is null.
- */
- public ClassLoader getPluginClassLoader( URI uri )
- throws IOException, NullArgumentException
- {
- Part part = getPart( uri );
- return part.getClassLoader();
- }
-
- /**
- * Get a plugin class relative to a supplied artifact. The artifact uri
- * must refer to a plugin descriptor (i.e. the artifact type is "plugin").
- * The class returned will be the class named in the plugin descriptor.
- *
- * @param uri the plugin artifact
- * @return the plugin class
- * @exception IOException if a class resolution error occurs
- */
- public Class getPluginClass( URI uri )
- throws IOException
- {
- Part part = Part.load( uri );
- if( part instanceof Plugin )
- {
- try
- {
- Plugin plugin = (Plugin) part;
- return plugin.getPluginClass();
- }
- catch( Exception e )
- {
- final String error =
- "Internal error while attempting to load plugin class.";
- throw new RepositoryException( error, e );
- }
- }
- else
- {
- final String error =
- "Part uri is not a plugin."
- + "\nPart: " + part.getClass().getName()
- + "\nURI: " + uri;
- throw new RepositoryException( error );
- }
- }
-
- /**
- * Instantiate an object using a plugin uri, parent classloader and
- * a supplied argument array. The plugin uri is used to resolve a plugin
- * descriptor. A classloader stack will be constructed using the supplied
- * classloader as the anchor for stack construction. A classname declared
- * in the plugin descriptor must has a single public constructor. The
- * implementation will resolve constructor parameters relative to the
- * supplied argument array and return an instance of the class.
- *
- * @param uri the reference to the application
- * @param args commandline arguments
- * @return the plugin instance
- * @exception IOException if a plugin creation error occurs
- * @exception InvocationTargetException if the plugin constructor
invocation error occurs
- */
- public Object getPlugin( URI uri, Object[] args )
- throws IOException, InvocationTargetException
- {
- Part part = Part.load( uri );
- try
- {
- return part.instantiate( args );
- }
- catch( Exception e )
- {
- final String error =
- "Internal error while attempting to load plugin instance.";
- throw new RepositoryException( error, e );
- }
- }
-
- //---------------------------------------------------------------------
- // implementation
- //---------------------------------------------------------------------
-
- private RepositoryMonitorRouter getMonitor()
- {
- return Transit.getInstance().getRepositoryMonitorRouter();
- }
-
- private Logger getLogger()
- {
- return m_logger;
- }
-}

Modified: trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
2006-04-05 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -346,10 +346,10 @@
* @return the repository service
* @exception IllegalStateException if Transit has not been initialized
*/
- public Repository getRepository() throws IllegalStateException
- {
- return getTransitContext().getRepository();
- }
+ //public Repository getRepository() throws IllegalStateException
+ //{
+ // return getTransitContext().getRepository();
+ //}

/**
* Returns a reference to the repository monitor router. Client
application

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 17:18:27 UTC (rev 1318)
+++
trunk/main/transit/core/src/main/net/dpml/transit/artifact/ArtifactURLConnection.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -33,13 +33,12 @@

import net.dpml.transit.Artifact;
import net.dpml.transit.Transit;
-import net.dpml.transit.Repository;
import net.dpml.transit.SecuredTransitContext;
import net.dpml.transit.ContentRegistry;
import net.dpml.transit.CacheHandler;
import net.dpml.transit.util.MimeTypeHandler;

-//import net.dpml.lang.Plugin;
+import net.dpml.part.Plugin;
import net.dpml.part.Part;

/**
@@ -201,16 +200,15 @@
// if the type is a plugin then handle this directly
//

- //if( "plugin".equals( type ) )
if( "part".equals( type ) )
{
- Repository loader = Transit.getInstance().getRepository();
URI uri = m_artifact.toURI();
if( classes.length == 0 )
{
try
{
- return loader.getPlugin( uri, new Object[0] );
+ Part part = Part.load( uri );
+ return part.instantiate( new Object[0] );
}
catch( InvocationTargetException e )
{
@@ -221,29 +219,63 @@
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
{
- for( int i=0; i < classes.length; i++ )
+ try
{
- Class c = classes[i];
- if( ClassLoader.class.equals( c ) )
+ for( int i=0; i < classes.length; i++ )
{
- Part part = loader.getPart( uri );
- return part.getClassLoader();
+ 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();
+ }
+ }
}
- else if( Class.class.equals( c ) )
- {
- return loader.getPluginClass( uri );
- }
- else if( Part.class.equals( c ) )
- {
- return loader.getPart( uri );
- }
}
+ 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;
+ }
}
}
-
+
//
// check to see if we have a content handler plugin declared for the
artifact type
//

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 17:18:27 UTC (rev 1318)
+++ trunk/main/transit/tools/src/main/net/dpml/transit/tools/PluginTask.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -28,8 +28,6 @@
import java.util.List;
import java.util.ArrayList;

-import net.dpml.transit.Transit;
-import net.dpml.transit.Repository;
import net.dpml.transit.util.ElementHelper;

import net.dpml.part.Part;
@@ -50,9 +48,7 @@
* @version @PROJECT-VERSION@
*/
public class PluginTask extends TransitTask
-{
- private static Repository m_REPOSITORY;
-
+{
private Map m_map = new Hashtable();

/**
@@ -278,18 +274,7 @@

private Part getPart( URI uri ) throws IOException
{
- return (Part) getRepository().getPart( uri );
- //Part part = (Part) m_map.get( uri );
- //if( null != part )
- //{
- // return part;
- //}
- //else
- //{
- // part = (Part) getRepository().getPart( uri );
- // m_map.put( uri, part );
- // return part;
- //}
+ return Part.load( uri );
}

/**
@@ -302,7 +287,6 @@
private void loadAntlib(
URI uri, ClassLoader classloader, ComponentHelper helper, Antlib
antlib ) throws Exception
{
- //Plugin plugin = getRepository().getPluginDescriptor( uri );
Part part = getPart( uri );

String resource = antlib.getPath();
@@ -313,7 +297,6 @@
Resource res = (Resource) part;
resource = res.getPath();
}
- //resource = plugin.getStrategy().getProperties().getProperty(
"project.plugin.resource" );
}
if( null == resource )
{
@@ -616,27 +599,4 @@
return m_path;
}
}
-
- private Repository getRepository()
- {
- if( null == m_REPOSITORY )
- {
- m_REPOSITORY = setupRepository();
- }
- return m_REPOSITORY;
- }
-
- private Repository setupRepository()
- {
- try
- {
- return Transit.getInstance().getRepository();
- }
- catch( Throwable e )
- {
- final String error =
- "Internal error while attemting to resolve Transit
repository.";
- throw new BuildException( error, e, getLocation() );
- }
- }
}

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 17:18:27 UTC (rev 1318)
+++
trunk/main/transit/tools/src/main/net/dpml/transit/tools/TransitComponentHelper.java
2006-04-05 19:00:01 UTC (rev 1319)
@@ -27,8 +27,6 @@
import net.dpml.part.Plugin;
import net.dpml.part.Resource;

-import net.dpml.transit.Repository;
-import net.dpml.transit.Transit;
import net.dpml.transit.util.ElementHelper;

import org.apache.tools.ant.Project;
@@ -337,8 +335,7 @@
{
m_project.log( "installing: " + uri + " as " + urn );

- Repository loader = Transit.getInstance().getRepository();
- Part part = loader.getPart( uri );
+ Part part = Part.load( uri );

ClassLoader current =
Thread.currentThread().getContextClassLoader();





  • r1319 - in trunk/main: depot depot/core/src/main/net/dpml/depot depot/library/src/main/net/dpml/library/impl depot/tools/builder/src/main/net/dpml/tools/tasks metro metro/component/src/main/net/dpml/component metro/test/src/test/net/dpml/test/part planet/http/test/src/test/net/dpml/http/test station/exec/src/main/net/dpml/station/exec transit transit/console/src/main/net/dpml/transit/console transit/core/src/main/net/dpml/part transit/core/src/main/net/dpml/transit transit/core/src/main/net/dpml/transit/artifact transit/tools/src/main/net/dpml/transit/tools, mcconnell at BerliOS, 04/05/2006

Archive powered by MHonArc 2.6.24.

Top of Page