diff options
author | Andrew M. Finkbeiner | 2014-03-05 19:21:51 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2014-03-05 19:21:51 +0000 |
commit | 3ec9542e81df9f21dec36d064edc8d7892c4fa3b (patch) | |
tree | 56298748296a8ef3538cd6496fe3b234af81aca6 /plugins/org.eclipse.osee.ote.client | |
parent | 8b86cde4ef9211a8ca511dacc5d49425abc9ff44 (diff) | |
download | org.eclipse.osee-3ec9542e81df9f21dec36d064edc8d7892c4fa3b.tar.gz org.eclipse.osee-3ec9542e81df9f21dec36d064edc8d7892c4fa3b.tar.xz org.eclipse.osee-3ec9542e81df9f21dec36d064edc8d7892c4fa3b.zip |
feature[ats_ATS27250]: Remove unnecessary JMS code
Diffstat (limited to 'plugins/org.eclipse.osee.ote.client')
6 files changed, 0 insertions, 331 deletions
diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/Activator.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/Activator.java index 3cc40a4e4b3..9da6206e3f9 100644 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/Activator.java +++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/Activator.java @@ -20,15 +20,11 @@ import org.osgi.framework.BundleContext; public class Activator implements BundleActivator { private ConnectionServiceTracker connectionServiceTracker; - private ExportClassLoaderCreationTracker exportClassLoaderCreationTracker; @Override public void start(BundleContext context) throws Exception { connectionServiceTracker = new ConnectionServiceTracker(context); connectionServiceTracker.open(true); - - exportClassLoaderCreationTracker = new ExportClassLoaderCreationTracker(context); - exportClassLoaderCreationTracker.open(true); } @Override @@ -36,7 +32,6 @@ public class Activator implements BundleActivator { // close the service tracker connectionServiceTracker.close(); - exportClassLoaderCreationTracker.close(); connectionServiceTracker = null; } diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/ExportClassLoaderCreationTracker.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/ExportClassLoaderCreationTracker.java deleted file mode 100644 index 096b9835449..00000000000 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/ExportClassLoaderCreationTracker.java +++ /dev/null @@ -1,52 +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.service; - -import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; -import org.osgi.util.tracker.ServiceTracker; - -/** - * @author Andrew M. Finkbeiner - */ -class ExportClassLoaderCreationTracker extends ServiceTracker { - - private ExportClassLoader exportClassLoader; - private JmsJiniBridgeConnectionServiceTracker jmsJiniBridgeConnectionServiceTracker; - - ExportClassLoaderCreationTracker(BundleContext context) { - super(context, PackageAdmin.class.getName(), null); - } - - @Override - public Object addingService(ServiceReference reference) { - PackageAdmin pa = (PackageAdmin) context.getService(reference); - exportClassLoader = new ExportClassLoader(pa); - jmsJiniBridgeConnectionServiceTracker = new JmsJiniBridgeConnectionServiceTracker(context, exportClassLoader); - jmsJiniBridgeConnectionServiceTracker.open(true); - return super.addingService(reference); - } - - @Override - public void close() { - jmsJiniBridgeConnectionServiceTracker.close(); - super.close(); - } - - @Override - public void removedService(ServiceReference reference, Object service) { - jmsJiniBridgeConnectionServiceTracker.close(); - super.removedService(reference, service); - } - -} diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/JmsJiniBridgeConnectionServiceTracker.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/JmsJiniBridgeConnectionServiceTracker.java deleted file mode 100644 index 78c7e5f18e2..00000000000 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/JmsJiniBridgeConnectionServiceTracker.java +++ /dev/null @@ -1,53 +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.service; - -import org.eclipse.osee.connection.service.IConnectionService; -import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; - -/** - * @author Andrew M. Finkbeiner - */ -class JmsJiniBridgeConnectionServiceTracker extends ServiceTracker { - - private IConnectionService connectionService; - private final ExportClassLoader exportClassLoader; - private MessageingServiceToLookupTracker messageingServiceToLookupTracker; - - JmsJiniBridgeConnectionServiceTracker(BundleContext context, ExportClassLoader exportClassLoader) { - super(context, IConnectionService.class.getName(), null); - this.exportClassLoader = exportClassLoader; - } - - @Override - public Object addingService(ServiceReference reference) { - connectionService = (IConnectionService) context.getService(reference); - messageingServiceToLookupTracker = - new MessageingServiceToLookupTracker(context, connectionService, exportClassLoader); - messageingServiceToLookupTracker.open(true); - return super.addingService(reference); - } - - @Override - public void close() { - messageingServiceToLookupTracker.close(); - super.close(); - } - - @Override - public void removedService(ServiceReference reference, Object service) { - messageingServiceToLookupTracker.close(); - super.removedService(reference, service); - } -} diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/MessageingServiceToLookupTracker.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/MessageingServiceToLookupTracker.java deleted file mode 100644 index 0ac733a193c..00000000000 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/MessageingServiceToLookupTracker.java +++ /dev/null @@ -1,57 +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.service; - -import org.eclipse.osee.connection.service.IConnectionService; -import org.eclipse.osee.framework.messaging.MessageService; -import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; - -/** - * @author Andrew M. Finkbeiner - */ -class MessageingServiceToLookupTracker extends ServiceTracker { - - private final IConnectionService connectionService; - private final ExportClassLoader exportClassLoader; - private MessageService messageService; - private RemoteLookupServiceTracker remoteLookupServiceTracker; - - MessageingServiceToLookupTracker(BundleContext context, IConnectionService connectionService, ExportClassLoader exportClassLoader) { - super(context, MessageService.class.getName(), null); - this.connectionService = connectionService; - this.exportClassLoader = exportClassLoader; - } - - @Override - public Object addingService(ServiceReference reference) { - messageService = (MessageService) context.getService(reference); - remoteLookupServiceTracker = - new RemoteLookupServiceTracker(context, messageService, connectionService, exportClassLoader); - remoteLookupServiceTracker.open(true); - return super.addingService(reference); - } - - @Override - public void close() { - remoteLookupServiceTracker.close(); - super.close(); - } - - @Override - public void removedService(ServiceReference reference, Object service) { - remoteLookupServiceTracker.close(); - super.removedService(reference, service); - } - -} diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/OteJmsServiceConnector.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/OteJmsServiceConnector.java deleted file mode 100644 index 9041a42a49b..00000000000 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/OteJmsServiceConnector.java +++ /dev/null @@ -1,101 +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.service; - -import java.util.concurrent.ConcurrentHashMap; -import java.util.logging.Level; - -import org.eclipse.osee.connection.service.IConnectionService; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.MessageService; -import org.eclipse.osee.framework.messaging.OseeMessagingStatusCallback; -import org.eclipse.osee.framework.messaging.services.RemoteServiceLookup; -import org.eclipse.osee.framework.messaging.services.ServiceNotification; -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; - -/** - * @author Andrew M. Finkbeiner - */ -class OteJmsServiceConnector implements ServiceNotification, OseeMessagingStatusCallback { - - private final ConcurrentHashMap<String, JmsToJiniBridgeConnectorLite> connectors; - private final ConcurrentHashMap<String, ServiceHealth> serviceHealthMap; - private final RemoteServiceLookup remoteServiceLookup; - private final MessageService messageService; - private final IConnectionService connectionService; - - OteJmsServiceConnector(RemoteServiceLookup remoteServiceLookup, MessageService messageService, IConnectionService connectionService) { - this.remoteServiceLookup = remoteServiceLookup; - this.messageService = messageService; - this.connectionService = connectionService; - connectors = new ConcurrentHashMap<String, JmsToJiniBridgeConnectorLite>(); - serviceHealthMap = new ConcurrentHashMap<String, ServiceHealth>(); - } - - public void start() { - remoteServiceLookup.register("osee.ote.server", "1.0", this); - } - - public void stop() { - remoteServiceLookup.unregister("osee.ote.server", "1.0", this); - } - - @Override - public synchronized void onServiceGone(ServiceHealth serviceHealth) { - JmsToJiniBridgeConnectorLite connector = removeExistingConnector(serviceHealth); - if (connector != null) { - try { - connectionService.removeConnector(connector); - } catch (Exception ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } - } - } - - @Override - public boolean isServiceGone(ServiceHealth serviceHealth) { - return serviceConfirmedGone(serviceHealth); - } - - private boolean serviceConfirmedGone(ServiceHealth serviceHealth) { - JmsToJiniBridgeConnectorLite connector = connectors.get(serviceHealth.getServiceUniqueId()); - if (connector == null) { - return true; - } - return !connector.ping(); - } - - private JmsToJiniBridgeConnectorLite removeExistingConnector(ServiceHealth serviceHealth) { - return connectors.remove(serviceHealth.getServiceUniqueId()); - } - - @Override - public synchronized void onServiceUpdate(final ServiceHealth serviceHealth) { - serviceHealthMap.put(serviceHealth.getServiceUniqueId(), serviceHealth); - JmsToJiniBridgeConnectorLite oldConnector = connectors.get(serviceHealth.getServiceUniqueId()); - if (oldConnector == null){ - JmsToJiniBridgeConnectorLite lite = new JmsToJiniBridgeConnectorLite(serviceHealth, messageService); - connectors.put(serviceHealth.getServiceUniqueId(), lite); - connectionService.addConnector(lite); - } else { - oldConnector.setServiceHealth(serviceHealth); - } - } - - @Override - public void fail(Throwable th) { - OseeLog.log(Activator.class, Level.SEVERE, th); - } - - @Override - public void success() { - } -} diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/RemoteLookupServiceTracker.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/RemoteLookupServiceTracker.java deleted file mode 100644 index e6fb5cbe3fb..00000000000 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/RemoteLookupServiceTracker.java +++ /dev/null @@ -1,63 +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.service; - -import org.eclipse.osee.connection.service.IConnectionService; -import org.eclipse.osee.framework.messaging.MessageService; -import org.eclipse.osee.framework.messaging.services.RemoteServiceLookup; -import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; - -/** - * @author Andrew M. Finkbeiner - */ -class RemoteLookupServiceTracker extends ServiceTracker { - private final MessageService messageService; - private final IConnectionService connectionService; - private final ExportClassLoader exportClassLoader; - private OteJmsServiceConnector oteJmsServiceConnector; - - RemoteLookupServiceTracker(BundleContext context, MessageService messageService, IConnectionService connectionService, ExportClassLoader exportClassLoader) { - super(context, RemoteServiceLookup.class.getName(), null); - this.messageService = messageService; - this.connectionService = connectionService; - this.exportClassLoader = exportClassLoader; - } - - @Override - public Object addingService(ServiceReference reference) { - RemoteServiceLookup remoteServiceLookup = (RemoteServiceLookup) context.getService(reference); - oteJmsServiceConnector = - new OteJmsServiceConnector(remoteServiceLookup, messageService, connectionService); - oteJmsServiceConnector.start(); - return super.addingService(reference); - } - - @Override - public void close() { - if (oteJmsServiceConnector != null) { - oteJmsServiceConnector.stop(); - oteJmsServiceConnector = null; - } - super.close(); - } - - @Override - public void removedService(ServiceReference reference, Object service) { - if (oteJmsServiceConnector != null) { - oteJmsServiceConnector.stop(); - } - super.removedService(reference, service); - } - -} |