Skip to Content.
Sympa Menu

notify-dpml - r979 - trunk/main/metro/station/console/src/main/net/dpml/station/console

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: r979 - trunk/main/metro/station/console/src/main/net/dpml/station/console
  • Date: Thu, 26 Jan 2006 08:33:19 +0100

Author: mcconnell
Date: 2006-01-26 08:33:15 +0100 (Thu, 26 Jan 2006)
New Revision: 979

Modified:

trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
Log:
fix non-return status in station server during off-line mode

Modified:
trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
===================================================================
---
trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
2006-01-26 05:55:27 UTC (rev 978)
+++
trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
2006-01-26 07:33:15 UTC (rev 979)
@@ -28,6 +28,7 @@
import java.rmi.ConnectException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
+import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;
@@ -52,6 +53,7 @@
import net.dpml.transit.Artifact;
import net.dpml.transit.Logger;
import net.dpml.transit.PID;
+import net.dpml.transit.Disposable;
import net.dpml.transit.info.ValueDirective;
import net.dpml.transit.util.ExceptionHelper;

@@ -81,7 +83,7 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public class StationPlugin
+public class StationPlugin implements Disposable
{
//
------------------------------------------------------------------------
// state
@@ -89,6 +91,10 @@

private final Logger m_logger;

+ private boolean m_flag = false; // true if we have to take down the
registry on exit
+
+ private ApplicationRegistry m_registry; // contains the ref to the
registry used during disposal
+
//
------------------------------------------------------------------------
// constructor
//
------------------------------------------------------------------------
@@ -208,6 +214,25 @@
}

//
------------------------------------------------------------------------
+ // Disposable
+ //
------------------------------------------------------------------------
+
+ public void dispose()
+ {
+ if( m_flag && ( null != m_registry ) )
+ {
+ try
+ {
+ UnicastRemoteObject.unexportObject( m_registry, true );
+ }
+ catch( Throwable e )
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ //
------------------------------------------------------------------------
// commandline interegation
//
------------------------------------------------------------------------

@@ -1194,13 +1219,22 @@
}
}

+ /**
+ * Create a new local application registry using the supplied uri.
+ * As a side effect the internal state of this class is updated to
reflect
+ * the fact that this class is responsible for RMI cleanup.
+ * @param uri the registry stoarage uri
+ * @return the aplication registry
+ */
private ApplicationRegistry getLocalApplicationRegistry( URI uri )
{
try
{
Logger logger = getLogger();
URL url = getStorageURL( uri );
- return new RemoteApplicationRegistry( logger, url );
+ m_flag = true;
+ m_registry = new RemoteApplicationRegistry( logger, url );
+ return m_registry;
}
catch( Exception e )
{




  • r979 - trunk/main/metro/station/console/src/main/net/dpml/station/console, mcconnell at BerliOS, 01/26/2006

Archive powered by MHonArc 2.6.24.

Top of Page