Permalink
Browse files

Review shut down of re (see #8157)

  • Loading branch information...
1 parent 8cffa12 commit 856b53cc9c0f4648b17ceb8f951b52945fb3ba2c @jburel committed Mar 1, 2012
@@ -701,10 +701,6 @@ void discard()
if (imageIcon != null) imageIcon.flush();
browser.discard();
if (image == null) return;
- //Shut down the service
- OmeroImageService svr = ImViewerAgent.getRegistry().getImageService();
- long pixelsID = getImage().getDefaultPixels().getId();
- svr.shutDown(ctx, pixelsID);
Iterator i = loaders.keySet().iterator();
Integer index;
while (i.hasNext()) {
@@ -717,6 +717,21 @@ void close(StatefulServiceInterfacePrx proxy)
}
/**
+ * Shuts downs the rendering engine.
+ *
+ * @param pixelsId The id of the pixels set.
+ */
+ void shutDownRenderingEngine(long pixelsId)
+ {
+ try {
+ StatefulServiceInterfacePrx proxy = reServices.get(pixelsId);
+ if (proxy != null) proxy.close();
+ reServices.remove(pixelsId);
+ } catch (Exception e) {
+ }
+ }
+
+ /**
* Returns <code>true</code> if it is the connector corresponding to the
* passed context, <code>false</code> otherwise.
*
@@ -54,6 +54,7 @@
import org.openmicroscopy.shoola.env.data.util.SecurityContext;
import org.openmicroscopy.shoola.env.data.views.DataViewsFactory;
import org.openmicroscopy.shoola.env.log.LogMessage;
+import org.openmicroscopy.shoola.env.rnd.PixelsServicesFactory;
import org.openmicroscopy.shoola.env.rnd.RenderingControl;
import org.openmicroscopy.shoola.env.ui.UserNotifier;
import org.openmicroscopy.shoola.svc.proxy.ProxyUtil;
@@ -605,7 +606,7 @@ public void shutdown(SecurityContext ctx)
ScreenLogin.registerGroup(names);
} else ScreenLogin.registerGroup(null);
CacheServiceFactory.shutdown(container);
- ((OmeroImageServiceImpl) is).shutDown(ctx);
+ PixelsServicesFactory.shutDownRenderingControls(container.getRegistry());
omeroGateway.logout();
if (executor != null) executor.shutdown();
executor = null;
@@ -3824,7 +3824,6 @@ private void closeService(SecurityContext ctx,
} catch (Exception e) {
// TODO: handle exception
}
-
}
/**
@@ -6349,7 +6348,7 @@ void removeREService(SecurityContext ctx, long pixelsID)
while (i.hasNext()) {
c = i.next();
if (c.isSame(ctx)) {
- //c.shutDownRendering(pixelsID);
+ c.shutDownRenderingEngine(pixelsID);
}
}
}
@@ -522,12 +522,6 @@ private IObject determineContainer(SecurityContext ctx, DatasetData dataset,
this.gateway = gateway;
}
- /** Shuts down all active rendering engines. */
- void shutDown(SecurityContext ctx)
- {
- PixelsServicesFactory.shutDownRenderingControls(context);
- }
-
/**
* Implemented as specified by {@link OmeroImageService}.
* @see OmeroImageService#loadRenderingControl(SecurityContext, long)

0 comments on commit 856b53c

Please sign in to comment.