Skip to Content.
Sympa Menu

notify-dpml - r1055 - in trunk/main/transit: console/src/main/net/dpml/transit/console core/src/main/net/dpml/transit/artifact

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: r1055 - in trunk/main/transit: console/src/main/net/dpml/transit/console core/src/main/net/dpml/transit/artifact
  • Date: Wed, 8 Feb 2006 15:05:07 +0100

Author: mcconnell
Date: 2006-02-08 15:04:57 +0100 (Wed, 08 Feb 2006)
New Revision: 1055

Modified:

trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java

trunk/main/transit/core/src/main/net/dpml/transit/artifact/ArtifactURLConnection.java
Log:
1. add possibility to supply a collection of arguments when loading a transit
plugin
2. fix bug in connection handler related to processing of plugin sourced
errors

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-02-08 08:12:10 UTC (rev 1054)
+++
trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
2006-02-08 14:04:57 UTC (rev 1055)
@@ -173,8 +173,10 @@
{
URI uri = (URI) line.getValue( LOAD_COMMAND, null );
ClassLoader loader = ClassLoader.getSystemClassLoader();
+ List list = line.getValues( ARGUMENTS );
+ String[] args = (String[]) list.toArray( new String[ list.size()
] );
Object instance =
- Transit.getInstance().getRepository().getPlugin( loader, uri,
new Object[0] );
+ Transit.getInstance().getRepository().getPlugin( loader, uri,
new Object[]{ args } );
if( instance instanceof Runnable )
{
Runnable runnable = (Runnable) instance;
@@ -1499,6 +1501,11 @@
.create() )
.create();

+ private static final Option ARGUMENTS =
+ ARGUMENT_BUILDER
+ .withName( "args" )
+ .create();
+
private static final Group COMMAND_GROUP =
GROUP_BUILDER
.withOption( INFO_COMMAND )
@@ -1517,6 +1524,7 @@
.withName( "command" )
.withOption( PROFILE_URI_OPTION )
.withOption( COMMAND_GROUP )
+ .withOption( ARGUMENTS )
.withMinimum( 0 )
.create();


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-02-08 08:12:10 UTC (rev 1054)
+++
trunk/main/transit/core/src/main/net/dpml/transit/artifact/ArtifactURLConnection.java
2006-02-08 14:04:57 UTC (rev 1055)
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.File;
+import java.lang.reflect.InvocationTargetException;
import java.net.ContentHandler;
import java.net.UnknownServiceException;
import java.net.URI;
@@ -204,8 +205,20 @@
ClassLoader classloader =
Thread.currentThread().getContextClassLoader();
URI uri = m_artifact.toURI();
if( classes.length == 0 )
- {
- return loader.getPlugin( classloader, uri, new Object[0] );
+ {
+ try
+ {
+ return loader.getPlugin( classloader, uri, 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;
+ }
}
else
{




  • r1055 - in trunk/main/transit: console/src/main/net/dpml/transit/console core/src/main/net/dpml/transit/artifact, mcconnell at BerliOS, 02/08/2006

Archive powered by MHonArc 2.6.24.

Top of Page