diff options
author | Andrew M. Finkbeiner | 2014-05-15 14:49:19 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2014-08-28 23:58:37 +0000 |
commit | c2e834c69fedc0455c0cfe05c5f0eb9d97497810 (patch) | |
tree | 3d67e03f7b7b0456637036929738933d5305587f /plugins/org.eclipse.osee.ote.server | |
parent | 89532e418749e5e491dda3ac0ff809e8ecdd84a5 (diff) | |
download | org.eclipse.osee-c2e834c69fedc0455c0cfe05c5f0eb9d97497810.tar.gz org.eclipse.osee-c2e834c69fedc0455c0cfe05c5f0eb9d97497810.tar.xz org.eclipse.osee-c2e834c69fedc0455c0cfe05c5f0eb9d97497810.zip |
feature[ats_ATS46147]: Remove message system rmi
Diffstat (limited to 'plugins/org.eclipse.osee.ote.server')
4 files changed, 19 insertions, 111 deletions
diff --git a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/MessageToolExportCustomizer.java b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/MessageToolExportCustomizer.java deleted file mode 100644 index 6e6aea27f54..00000000000 --- a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/MessageToolExportCustomizer.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.server.internal; - -import java.rmi.server.ExportException; -import java.util.logging.Level; - -import org.eclipse.osee.connection.service.IServiceConnector; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.ote.message.interfaces.IRemoteMessageService; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTrackerCustomizer; - -public class MessageToolExportCustomizer implements ServiceTrackerCustomizer { - - private final IServiceConnector connector; - private IRemoteMessageService messageToolServiceInstance; - - public MessageToolExportCustomizer(IServiceConnector connector) { - this.connector = connector; - } - - @Override - public Object addingService(ServiceReference reference) { - messageToolServiceInstance = (IRemoteMessageService) FrameworkUtil.getBundle(getClass()).getBundleContext().getService(reference); - try { - return connector.export(messageToolServiceInstance); - } catch (ExportException e) { - OseeLog.log(MessageToolExportCustomizer.class, Level.SEVERE, "failed to export message tool service", e); - return null; - } finally { - OseeLog.log(getClass(), Level.INFO, "!!!message tool service exported"); - } - - } - - @Override - public void modifiedService(ServiceReference reference, Object service) { - // TODO Auto-generated method stub - - } - - @Override - public void removedService(ServiceReference reference, Object service) { - try { - connector.unexport(messageToolServiceInstance); - } catch (Exception e) { - OseeLog.log(MessageToolExportCustomizer.class, Level.WARNING, "failed to unexport message tool service", e); - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/MessageToolServiceTracker.java b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/MessageToolServiceTracker.java deleted file mode 100644 index d4d6f32a91c..00000000000 --- a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/MessageToolServiceTracker.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.server.internal; - -import org.eclipse.osee.ote.message.interfaces.IRemoteMessageService; -import org.osgi.framework.FrameworkUtil; -import org.osgi.util.tracker.ServiceTracker; -import org.osgi.util.tracker.ServiceTrackerCustomizer; - -public class MessageToolServiceTracker extends ServiceTracker { - - public MessageToolServiceTracker() { - super(FrameworkUtil.getBundle(MessageToolServiceTracker.class).getBundleContext(), IRemoteMessageService.class.getName(), null); - } - - public MessageToolServiceTracker(ServiceTrackerCustomizer customizer) { - super(FrameworkUtil.getBundle(MessageToolServiceTracker.class).getBundleContext(), IRemoteMessageService.class.getName(), customizer); - } - - @Override - public IRemoteMessageService waitForService(long timeout) throws InterruptedException { - return (IRemoteMessageService) super.waitForService(timeout); - } - -} diff --git a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/OteServiceStarterImpl.java b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/OteServiceStarterImpl.java index fb8358c2304..57dfa339767 100644 --- a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/OteServiceStarterImpl.java +++ b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/OteServiceStarterImpl.java @@ -304,9 +304,12 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu } } if(oteServerEntry != null) { - lookupRegistration.stop(); - taskToCancel.cancel(true); - masterServer.removeServer(masterURI, oteServerEntry); + try{ + lookupRegistration.stop(); + taskToCancel.cancel(true); + } finally { + masterServer.removeServer(masterURI, oteServerEntry); + } } brokerService = null; } @@ -370,11 +373,11 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu private static class LookupRegistration implements Runnable { - private OTEMasterServer masterServer; - private OTEServer server; - private URI uri; + private final OTEMasterServer masterServer; + private final OTEServer server; + private final URI uri; private volatile boolean run = true; - private OteService service; + private final OteService service; public LookupRegistration(URI uri, OTEMasterServer masterServer, OTEServer server, OteService service) { this.masterServer = masterServer; diff --git a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/RemoteTestEnvironment.java b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/RemoteTestEnvironment.java index 50c9d2ab969..93544192109 100644 --- a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/RemoteTestEnvironment.java +++ b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/RemoteTestEnvironment.java @@ -31,7 +31,6 @@ import org.eclipse.osee.ote.core.model.ModelKey; import org.eclipse.osee.ote.core.model.ModelState; import org.eclipse.osee.ote.message.IInstrumentationRegistrationListener; import org.eclipse.osee.ote.message.MessageSystemTestEnvironment; -import org.eclipse.osee.ote.message.interfaces.IRemoteMessageService; import org.eclipse.osee.ote.message.interfaces.ITestEnvironmentMessageSystem; import org.eclipse.osee.ote.server.RemoteShell; @@ -44,7 +43,7 @@ public class RemoteTestEnvironment implements ITestEnvironmentMessageSystem { new HashMap<IRemoteCommandConsole, RemoteShell>(32); private final ReentrantLock lock = new ReentrantLock(); - private IRemoteMessageService exportedRemoteMessageService; +// private IRemoteMessageService exportedRemoteMessageService; public RemoteTestEnvironment(MessageSystemTestEnvironment currentEnvironment, IServiceConnector serviceConnector, boolean keepEnvAliveWithNoUsers) { if (serviceConnector == null) { @@ -79,14 +78,14 @@ public class RemoteTestEnvironment implements ITestEnvironmentMessageSystem { env.removeInstrumentationRegistrationListener(listener); } - @Override - public IRemoteMessageService getMessageToolServiceProxy() throws RemoteException { - if(exportedRemoteMessageService == null){ - IRemoteMessageService service = ServiceUtility.getService(IRemoteMessageService.class, 30000); - exportedRemoteMessageService = (IRemoteMessageService)this.serviceConnector.export(service); - } - return exportedRemoteMessageService; - } +// @Override +// public IRemoteMessageService getMessageToolServiceProxy() throws RemoteException { +// if(exportedRemoteMessageService == null){ +// IRemoteMessageService service = ServiceUtility.getService(IRemoteMessageService.class, 30000); +// exportedRemoteMessageService = (IRemoteMessageService)this.serviceConnector.export(service); +// } +// return exportedRemoteMessageService; +// } @Override public IRemoteCommandConsole getCommandConsole() throws RemoteException { |