Skip to Content.
Sympa Menu

notify-dpml - r1263 - trunk/main/station/server/src/main/net/dpml/station/server

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: r1263 - trunk/main/station/server/src/main/net/dpml/station/server
  • Date: Fri, 24 Mar 2006 06:12:05 +0100

Author: mcconnell
Date: 2006-03-24 06:11:59 +0100 (Fri, 24 Mar 2006)
New Revision: 1263

Modified:

trunk/main/station/server/src/main/net/dpml/station/server/RemoteStation.java

trunk/main/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
Log:
make station shutdown even cleaner than before

Modified:
trunk/main/station/server/src/main/net/dpml/station/server/RemoteStation.java
===================================================================
---
trunk/main/station/server/src/main/net/dpml/station/server/RemoteStation.java
2006-03-24 04:45:43 UTC (rev 1262)
+++
trunk/main/station/server/src/main/net/dpml/station/server/RemoteStation.java
2006-03-24 05:11:59 UTC (rev 1263)
@@ -44,7 +44,9 @@
import net.dpml.lang.Logger;
import net.dpml.lang.LoggingService;
import net.dpml.lang.PID;
+import net.dpml.transit.Disposable;
import net.dpml.transit.monitor.LoggingAdapter;
+import net.dpml.transit.model.TransitModel;

import net.dpml.lang.UnknownKeyException;

@@ -57,6 +59,7 @@
*/
public class RemoteStation extends UnicastRemoteObject implements Station,
Manager, LoggingService
{
+ private final TransitModel m_model;
private final RemoteApplicationRegistry m_registry;
private final Map m_applications = new Hashtable();
private final Logger m_logger;
@@ -75,13 +78,14 @@
* @param registryStorageUrl uri defining the registry backing store
* @exception Exception if a exception occurs during establishment
*/
- public RemoteStation( Logger logger, int port, URL registryStorageUrl )
throws Exception
+ public RemoteStation( Logger logger, TransitModel model, int port, URL
registryStorageUrl ) throws Exception
{
super();

m_logger = logger;
m_port = port;
m_store = registryStorageUrl;
+ m_model = model;

m_rmiRegistry = getLocalRegistry( port );

@@ -232,6 +236,20 @@
{
// ignore
}
+
+ if( m_model instanceof Disposable )
+ {
+ try
+ {
+ Disposable disposable = (Disposable) m_model;
+ disposable.dispose();
+ }
+ catch( Throwable e )
+ {
+ e.printStackTrace();
+ }
+ }
+
try
{
m_rmiRegistry.unbind( LoggingService.LOGGING_KEY );
@@ -324,7 +342,6 @@
}
else
{
- //Logger logger = new LoggingAdapter( key );
Logger logger = getLogger().getChildLogger( key );
ApplicationDescriptor descriptor =
m_registry.getApplicationDescriptor( key );
RemoteApplication application =

Modified:
trunk/main/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
===================================================================
---
trunk/main/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
2006-03-24 04:45:43 UTC (rev 1262)
+++
trunk/main/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
2006-03-24 05:11:59 UTC (rev 1263)
@@ -37,6 +37,7 @@
import net.dpml.station.ApplicationRegistry;

import net.dpml.transit.Artifact;
+import net.dpml.transit.model.TransitModel;
import net.dpml.lang.Logger;

/**
@@ -51,19 +52,22 @@
{
private final Logger m_logger;
private final CommandLine m_line;
+ private final TransitModel m_model;

private RemoteStation m_station;

/**
* Creation of a new station server plugin for station commandline
* handling.
+ * @param model the transit model
* @param logger the assigned logging channel
* @param args the command line arguments array
* @exception Exception if an error occurs
*/
- public StationServerPlugin( Logger logger, String[] args ) throws
Exception
+ public StationServerPlugin( TransitModel model, Logger logger, String[]
args ) throws Exception
{
m_logger = logger;
+ m_model = model;

// parse the command group model

@@ -100,7 +104,7 @@
{
URL url = ApplicationRegistry.DEFAULT_STORAGE_URI.toURL();
m_logger.info( "starting station on port: " + port );
- m_station = new RemoteStation( m_logger, port, url );
+ m_station = new RemoteStation( m_logger, m_model, port, url
);
Thread.currentThread().setContextClassLoader(
ApplicationRegistry.class.getClassLoader() );
setShutdownHook( m_station );
}
@@ -114,7 +118,7 @@
+ port
+ " with registry "
+ url );
- m_station = new RemoteStation( m_logger, port, url );
+ m_station = new RemoteStation( m_logger, m_model, port,
url );
}
else
{
@@ -124,7 +128,7 @@
+ port
+ " with registry "
+ url );
- m_station = new RemoteStation( m_logger, port, url );
+ m_station = new RemoteStation( m_logger, m_model, port,
url );
}
}
}




  • r1263 - trunk/main/station/server/src/main/net/dpml/station/server, mcconnell at BerliOS, 03/24/2006

Archive powered by MHonArc 2.6.24.

Top of Page