notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r958 - trunk/main/depot/core/console/src/main/net/dpml/depot
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r958 - trunk/main/depot/core/console/src/main/net/dpml/depot
- Date: Tue, 24 Jan 2006 05:51:52 +0100
Author: mcconnell
Date: 2006-01-24 05:51:48 +0100 (Tue, 24 Jan 2006)
New Revision: 958
Modified:
trunk/main/depot/core/console/src/main/net/dpml/depot/Main.java
Log:
update depot to handle termination of the transit model on completion of
build and transit plugin deployment
Modified: trunk/main/depot/core/console/src/main/net/dpml/depot/Main.java
===================================================================
--- trunk/main/depot/core/console/src/main/net/dpml/depot/Main.java
2006-01-24 03:56:40 UTC (rev 957)
+++ trunk/main/depot/core/console/src/main/net/dpml/depot/Main.java
2006-01-24 04:51:48 UTC (rev 958)
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.Enumeration;
+import net.dpml.transit.Disposable;
import net.dpml.transit.Transit;
import net.dpml.transit.TransitError;
import net.dpml.transit.Repository;
@@ -174,16 +175,27 @@
private void handlePlugin( String name, String spec, String[] args,
boolean wait )
{
System.setSecurityManager( new RMISecurityManager() );
- boolean waitForCompletion = deployHandler( name, spec, args, wait );
+ TransitModel model = getTransitModel( args );
+ boolean waitForCompletion = deployHandler( model, name, spec, args,
wait );
if( !waitForCompletion )
{
- System.exit( 0 );
+ if( m_plugin instanceof Disposable )
+ {
+ Disposable disposable = (Disposable) m_plugin;
+ disposable.dispose();
+ }
+ if( model instanceof DefaultTransitModel )
+ {
+ DefaultTransitModel disposable = (DefaultTransitModel) model;
+ disposable.dispose();
+ }
}
}
-
+
private boolean deployHandler(
- String command, String path, String[] args, boolean waitFor )
+ TransitModel model, String command, String path, String[] args,
boolean waitFor )
{
+
Logger logger = getLogger().getChildLogger( command );
if( m_debug )
{
@@ -197,7 +209,6 @@
}
try
{
- TransitModel model = getTransitModel( args );
URI uri = new URI( path );
Transit transit = Transit.getInstance( model );
setupMonitors( transit, (Adapter) getLogger() );
@@ -251,7 +262,7 @@
}
}
- private TransitModel getTransitModel( String[] args ) throws Exception
+ private TransitModel getTransitModel( String[] args )
{
final String key = "dpml.transit.model";
String property = null;
@@ -296,8 +307,17 @@
// otherwise let Transit handle model creation
//
- Logger logger = getLogger();
- return DefaultTransitModel.getDefaultModel( logger );
+ try
+ {
+ Logger logger = getLogger();
+ return DefaultTransitModel.getDefaultModel( logger );
+ }
+ catch( Exception e )
+ {
+ final String error =
+ "Transit model establishment failure.";
+ throw new TransitError( error, e );
+ }
}
private static Logger getLogger()
- r958 - trunk/main/depot/core/console/src/main/net/dpml/depot, mcconnell at BerliOS, 01/23/2006
Archive powered by MHonArc 2.6.24.