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 | |
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')
34 files changed, 11 insertions, 1610 deletions
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/data/TestServiceNotification.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/data/TestServiceNotification.java deleted file mode 100644 index a41fd1be255..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/data/TestServiceNotification.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 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.framework.messaging.data; - -import org.eclipse.osee.framework.messaging.services.ServiceNotification; -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; - -/** - * @author Roberto E. Escobar - */ -public class TestServiceNotification implements ServiceNotification { - - private volatile int serviceUpdates; - private volatile int serviceAway; - private volatile boolean onServiceGoneReceived; - private volatile boolean onServiceUpdateReceived; - private volatile boolean serviceIsGone; - - public TestServiceNotification() { - super(); - reset(); - } - - public synchronized void setServiceGone(boolean isGone) { - serviceIsGone = isGone; - } - - public synchronized void reset() { - serviceIsGone = false; - serviceUpdates = 0; - serviceAway = 0; - onServiceGoneReceived = false; - onServiceUpdateReceived = false; - } - - @Override - public synchronized void onServiceGone(ServiceHealth serviceHealth) { - serviceAway++; - onServiceGoneReceived = true; - notify(); - } - - @Override - public synchronized void onServiceUpdate(ServiceHealth serviceHealth) { - serviceUpdates++; - onServiceUpdateReceived = true; - notify(); - } - - @Override - public boolean isServiceGone(ServiceHealth serviceHealth) { - return serviceIsGone; - } - - public int getServiceUpdatesCount() { - return serviceUpdates; - } - - public int getServiceAwayCount() { - return serviceAway; - } - - public boolean wasOnServiceGoneReceived() { - return onServiceGoneReceived; - } - - public boolean wasOnServiceUpdateReceived() { - return onServiceUpdateReceived; - } - -} diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/integration/TestEmbeddedBrokerSendReceive.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/integration/TestEmbeddedBrokerSendReceive.java index d73ff399d58..165c527207b 100644 --- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/integration/TestEmbeddedBrokerSendReceive.java +++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/integration/TestEmbeddedBrokerSendReceive.java @@ -10,18 +10,19 @@ *******************************************************************************/ package org.eclipse.osee.framework.messaging.integration; -import static junit.framework.Assert.*; -import static org.eclipse.osee.framework.messaging.data.DefaultNodeInfos.*; -import static org.eclipse.osee.framework.messaging.data.TestMessages.*; -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.*; +import static junit.framework.Assert.assertEquals; +import static org.eclipse.osee.framework.messaging.data.DefaultNodeInfos.OSEE_JMS_BROKER_URI; +import static org.eclipse.osee.framework.messaging.data.DefaultNodeInfos.OSEE_JMS_NODE; +import static org.eclipse.osee.framework.messaging.data.TestMessages.JMS_TOPIC; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; + import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.messaging.ConnectionNode; import org.eclipse.osee.framework.messaging.OseeMessagingListener; @@ -32,16 +33,12 @@ import org.eclipse.osee.framework.messaging.data.TestMessage; import org.eclipse.osee.framework.messaging.data.TestMessageListener; import org.eclipse.osee.framework.messaging.data.TestMessageListener.Data; import org.eclipse.osee.framework.messaging.data.TestMessages; -import org.eclipse.osee.framework.messaging.data.TestServiceNotification; import org.eclipse.osee.framework.messaging.internal.MessageServiceController.BrokerType; import org.eclipse.osee.framework.messaging.rules.MessageBroker; import org.eclipse.osee.framework.messaging.rules.MessageConnection; import org.eclipse.osee.framework.messaging.services.ServiceInfoPopulator; import org.eclipse.osee.framework.messaging.services.internal.OseeMessagingStatusImpl; -import org.eclipse.osee.framework.messaging.services.internal.RemoteServiceLookupImpl; -import org.eclipse.osee.framework.messaging.services.internal.RemoteServiceRegistrarImpl; import org.eclipse.osee.framework.messaging.services.messages.ServiceDescriptionPair; -import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; @@ -171,155 +168,6 @@ public class TestEmbeddedBrokerSendReceive { } } - @Ignore("Intermittent failures") - @Test - public void testServiceUpClientComesUp() throws Exception { - final int TIMEOUT_MONITOR = 4; // seconds - final int REFRESH_RATE = 1; // seconds - - ScheduledExecutorService executor = Executors.newScheduledThreadPool(3); - - RemoteServiceRegistrarImpl registrar = new RemoteServiceRegistrarImpl(connection, executor); - registrar.start(); - - RemoteServiceLookupImpl lookup = - new RemoteServiceLookupImpl(connection, executor, TIMEOUT_MONITOR, TimeUnit.SECONDS); - lookup.start(); - - registrar.registerService(SERVICE_NAME, SERVICE_VERSION, SERVICE_ID, asURI(SERVICE_URL), info(), REFRESH_RATE); - - TestServiceNotification notifier = new TestServiceNotification(); - - // Register - lookup.register(SERVICE_NAME, SERVICE_VERSION, notifier); - if (!notifier.wasOnServiceUpdateReceived()) { - synchronized (notifier) { - notifier.wait(toMillis(REFRESH_RATE)); - } - } - assertTrue(notifier.wasOnServiceUpdateReceived()); - assertFalse(notifier.wasOnServiceGoneReceived()); - assertEquals(0, notifier.getServiceAwayCount()); - assertTrue(notifier.getServiceUpdatesCount() >= 1); - - //Unregister - notifier.reset(); - boolean unregistered = registrar.unregisterService(SERVICE_NAME, SERVICE_VERSION, SERVICE_ID); - notifier.setServiceGone(true); - if (!notifier.wasOnServiceGoneReceived()) { - synchronized (notifier) { - notifier.wait(toMillis(REFRESH_RATE * 2)); - } - } - assertTrue(unregistered); - assertTrue(notifier.wasOnServiceGoneReceived()); - assertEquals(1, notifier.getServiceAwayCount()); - - // Time-out check - if (notifier.getServiceAwayCount() < 2) { - synchronized (notifier) { - notifier.wait(toMillis(TIMEOUT_MONITOR * 7)); - } - } - assertEquals(2, notifier.getServiceAwayCount()); //service renewal timeout - Assert.assertTrue(lookup.unregister(SERVICE_NAME, SERVICE_VERSION, notifier)); - registrar.stop(); - lookup.stop(); - } - - @Test - public void testClientUpServiceComesUp() throws Exception { - final int TIMEOUT_MONITOR = 4; // seconds - final int REFRESH_RATE = 1; // seconds - ScheduledExecutorService executor = Executors.newScheduledThreadPool(3); - - RemoteServiceRegistrarImpl registrar = new RemoteServiceRegistrarImpl(connection, executor); - registrar.start(); - - RemoteServiceLookupImpl lookup = - new RemoteServiceLookupImpl(connection, executor, TIMEOUT_MONITOR, TimeUnit.SECONDS); - lookup.start(); - - TestServiceNotification notifier = new TestServiceNotification(); - lookup.register(SERVICE_NAME, SERVICE_VERSION, notifier); - - // Register - - registrar.registerService(SERVICE_NAME, SERVICE_VERSION, SERVICE_ID, asURI(SERVICE_URL), info(), REFRESH_RATE); - if (!notifier.wasOnServiceUpdateReceived()) { - synchronized (notifier) { - notifier.wait(toMillis(REFRESH_RATE)); - } - } - assertTrue(notifier.wasOnServiceUpdateReceived()); - assertFalse(notifier.wasOnServiceGoneReceived()); - assertEquals(0, notifier.getServiceAwayCount()); - assertTrue(notifier.getServiceUpdatesCount() >= 1); - - // Wait for Updates - notifier.reset(); - if (!notifier.wasOnServiceUpdateReceived()) { - synchronized (notifier) { - notifier.wait(toMillis(REFRESH_RATE * 2)); - } - } - assertTrue(notifier.wasOnServiceUpdateReceived()); - assertFalse(notifier.wasOnServiceGoneReceived()); - assertTrue(notifier.getServiceUpdatesCount() >= 1); - assertEquals(0, notifier.getServiceAwayCount()); - - //Unregister - notifier.reset(); - notifier.setServiceGone(true); - registrar.unregisterService(SERVICE_NAME, SERVICE_VERSION, SERVICE_ID); - if (!notifier.wasOnServiceGoneReceived()) { - synchronized (notifier) { - notifier.wait(toMillis(REFRESH_RATE * 2)); - } - } - assertTrue(notifier.wasOnServiceGoneReceived()); - Assert.assertTrue(notifier.getServiceAwayCount() >= 1); - - Assert.assertTrue(lookup.unregister(SERVICE_NAME, SERVICE_VERSION, notifier)); - registrar.stop(); - lookup.stop(); - } - - @Test - public void testServiceComesUpClientGetsReply() throws Exception { - final int TIMEOUT_MONITOR = 4; // seconds - final int REFRESH_RATE = 1; // seconds - - ScheduledExecutorService executor = Executors.newScheduledThreadPool(3); - - RemoteServiceRegistrarImpl registrar = new RemoteServiceRegistrarImpl(connection, executor); - registrar.start(); - - registrar.registerService(SERVICE_NAME, SERVICE_VERSION, SERVICE_ID, asURI(SERVICE_URL), info(), REFRESH_RATE); - - RemoteServiceLookupImpl lookup = - new RemoteServiceLookupImpl(connection, executor, TIMEOUT_MONITOR, TimeUnit.SECONDS); - lookup.start(); - - TestServiceNotification notifier = new TestServiceNotification(); - lookup.register(SERVICE_NAME, SERVICE_VERSION, notifier); - if (!notifier.wasOnServiceUpdateReceived()) { - synchronized (notifier) { - notifier.wait(toMillis(REFRESH_RATE)); - } - } - assertTrue(notifier.wasOnServiceUpdateReceived()); - assertFalse(notifier.wasOnServiceGoneReceived()); - assertEquals(0, notifier.getServiceAwayCount()); - assertTrue(notifier.getServiceUpdatesCount() >= 1); - - assertTrue(lookup.unregister(SERVICE_NAME, SERVICE_VERSION, notifier)); - assertTrue(registrar.unregisterService(SERVICE_NAME, SERVICE_VERSION, SERVICE_ID)); - - registrar.stop(); - lookup.stop(); - } - @Test public void testReply() throws Exception { String initialMessage = "send a message"; diff --git a/plugins/org.eclipse.osee.framework.messaging/OSGI-INF/remove.message.service.lookup.xml b/plugins/org.eclipse.osee.framework.messaging/OSGI-INF/remove.message.service.lookup.xml deleted file mode 100644 index 70aaf39b4a8..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging/OSGI-INF/remove.message.service.lookup.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.framework.messaging.internal.RemoteServiceLookupProxy"> - <implementation class="org.eclipse.osee.framework.messaging.internal.RemoteServiceLookupProxy"/> - <reference bind="setMessageService" cardinality="1..1" interface="org.eclipse.osee.framework.messaging.MessageService" name="MessageService" policy="static"/> - <service> - <provide interface="org.eclipse.osee.framework.messaging.services.RemoteServiceLookup"/> - <provide interface="org.eclipse.osee.framework.messaging.services.RemoteServiceRegistrar"/> - </service> -</scr:component> diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/RemoteServiceLookupProxy.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/RemoteServiceLookupProxy.java deleted file mode 100644 index 759f950ea76..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/RemoteServiceLookupProxy.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 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.framework.messaging.internal; - -import java.net.URI; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.MessageService; -import org.eclipse.osee.framework.messaging.services.RegisteredServiceReference; -import org.eclipse.osee.framework.messaging.services.RemoteServiceLookup; -import org.eclipse.osee.framework.messaging.services.RemoteServiceRegistrar; -import org.eclipse.osee.framework.messaging.services.ServiceInfoPopulator; -import org.eclipse.osee.framework.messaging.services.ServiceNotification; -import org.eclipse.osee.framework.messaging.services.internal.RemoteServiceLookupImpl; -import org.eclipse.osee.framework.messaging.services.internal.RemoteServiceRegistrarImpl; -import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; - -/** - * @author Roberto E. Escobar - */ -public class RemoteServiceLookupProxy implements RemoteServiceLookup, RemoteServiceRegistrar { - - private static final long SERVICE_LOOKUP_TIMEOUT = 30; - - private ClassLoader contextClassLoader; - private RemoteServiceRegistrarImpl registrar; - private RemoteServiceLookupImpl lookup; - private ScheduledExecutorService executor; - - private MessageService messageService; - - public void setMessageService(MessageService messageService) { - this.messageService = messageService; - } - - public void start() throws OseeCoreException { - OseeLog.log(Activator.class, Level.INFO, "Remote Service Lookup - Starting"); - executor = Executors.newScheduledThreadPool(2); - - contextClassLoader = ExportClassLoader.getInstance(); - Thread.currentThread().setContextClassLoader(contextClassLoader); - - registrar = new RemoteServiceRegistrarImpl(messageService.getDefault(), executor); - registrar.start(); - - lookup = - new RemoteServiceLookupImpl(messageService.getDefault(), executor, SERVICE_LOOKUP_TIMEOUT, TimeUnit.SECONDS); - lookup.start(); - OseeLog.log(Activator.class, Level.INFO, "Remote Service Lookup - Started"); - } - - public void stop() { - OseeLog.log(Activator.class, Level.INFO, "Remote Service Lookup - Stopping"); - if (lookup != null) { - lookup.stop(); - lookup = null; - } - if (registrar != null) { - registrar.stop(); - registrar = null; - } - - if (executor != null) { - executor.shutdown(); - executor = null; - } - contextClassLoader = null; - OseeLog.log(Activator.class, Level.INFO, "Remote Service Lookup - Stopped"); - } - - @Override - public void sendOutRequestsForServiceHealth() { - lookup.sendOutRequestsForServiceHealth(); - } - - @Override - public void register(String serviceId, String serviceVersion, ServiceNotification notification) { - lookup.register(serviceId, serviceVersion, notification); - } - - @Override - public boolean unregister(String serviceId, String serviceVersion, ServiceNotification notification) { - return lookup.unregister(serviceId, serviceVersion, notification); - } - - @Override - public RegisteredServiceReference registerService(String serviceName, String serviceVersion, String serviceUniqueId, URI broker, ServiceInfoPopulator infoPopulator, int refreshRateInSeconds) { - return registrar.registerService(serviceName, serviceVersion, serviceUniqueId, broker, infoPopulator, - refreshRateInSeconds); - } - - @Override - public boolean unregisterService(String serviceName, String serviceVersion, String serviceUniqueId) { - return registrar.unregisterService(serviceName, serviceVersion, serviceUniqueId); - } - -} diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/RemoteServiceLookup.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/RemoteServiceLookup.java deleted file mode 100644 index dead81c9cce..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/RemoteServiceLookup.java +++ /dev/null @@ -1,23 +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.framework.messaging.services; - -/** - * @author Andrew M. Finkbeiner - */ -public interface RemoteServiceLookup { - - void sendOutRequestsForServiceHealth(); - - void register(String serviceId, String serviceVersion, ServiceNotification notification); - - boolean unregister(String serviceId, String serviceVersion, ServiceNotification notification); -} diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/RemoteServiceRegistrar.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/RemoteServiceRegistrar.java deleted file mode 100644 index 33fbed041fe..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/RemoteServiceRegistrar.java +++ /dev/null @@ -1,23 +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.framework.messaging.services; - -import java.net.URI; - -/** - * @author Andrew M. Finkbeiner - */ -public interface RemoteServiceRegistrar { - - RegisteredServiceReference registerService(String serviceName, String serviceVersion, String serviceUniqueId, URI broker, ServiceInfoPopulator infoPopulator, int refreshRateInSeconds); - - boolean unregisterService(String serviceName, String serviceVersion, String serviceUniqueId); -} diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/ServiceNotification.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/ServiceNotification.java deleted file mode 100644 index bbfda964bd0..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/ServiceNotification.java +++ /dev/null @@ -1,24 +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.framework.messaging.services; - -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; - -/** - * @author Andrew M. Finkbeiner - */ -public interface ServiceNotification { - void onServiceUpdate(ServiceHealth serviceHealth); - - void onServiceGone(ServiceHealth serviceHealth); - - boolean isServiceGone(ServiceHealth serviceHealth); -} diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/HealthServiceListener.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/HealthServiceListener.java deleted file mode 100644 index de7a9c8449d..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/HealthServiceListener.java +++ /dev/null @@ -1,68 +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.framework.messaging.services.internal; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap; -import org.eclipse.osee.framework.messaging.OseeMessagingListener; -import org.eclipse.osee.framework.messaging.ReplyConnection; -import org.eclipse.osee.framework.messaging.services.ServiceNotification; -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; - -/** - * @author Andrew M. Finkbeiner - */ -class HealthServiceListener extends OseeMessagingListener { - - private static final int WIGGLE_ROOM = 20000; - - private final CompositeKeyHashMap<String/* serviceName */, String /* serviceVersion */, Map<String /* serviceUniqueId */, ServiceHealthPlusTimeout>> map; - private final CompositeKeyHashMap<String/* serviceName */, String /* serviceVersion */, List<ServiceNotification>> callbacks; - - HealthServiceListener(CompositeKeyHashMap<String, String, Map<String, ServiceHealthPlusTimeout>> map, CompositeKeyHashMap<String, String, List<ServiceNotification>> callbacks) { - super(ServiceHealth.class); - this.map = map; - this.callbacks = callbacks; - } - - @Override - public void process(Object message, Map<String, Object> headers, ReplyConnection replyConnection) { - ServiceHealth health = (ServiceHealth) message; - - if (health.isStopping()) { - List<ServiceNotification> itemsToNotify = callbacks.get(health.getServiceName(), health.getServiceVersion()); - if (itemsToNotify != null) { - for (ServiceNotification notification : itemsToNotify) { - notification.onServiceGone(health); - } - } - } else { - Map<String, ServiceHealthPlusTimeout> idMap = map.get(health.getServiceName(), health.getServiceVersion()); - if (idMap == null) { - idMap = new ConcurrentHashMap<String, ServiceHealthPlusTimeout>(); - map.put(health.getServiceName(), health.getServiceVersion(), idMap); - } - long shouldHaveRenewedTime = - System.currentTimeMillis() + health.getRefreshRateInSeconds() * 1000 + WIGGLE_ROOM; - idMap.put(health.getServiceUniqueId(), new ServiceHealthPlusTimeout(health, shouldHaveRenewedTime)); - - List<ServiceNotification> itemsToNotify = callbacks.get(health.getServiceName(), health.getServiceVersion()); - if (itemsToNotify != null) { - for (ServiceNotification notification : itemsToNotify) { - notification.onServiceUpdate(health); - } - } - } - } - -} diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java deleted file mode 100644 index f7e4257a73a..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java +++ /dev/null @@ -1,86 +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.framework.messaging.services.internal; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap; -import org.eclipse.osee.framework.jdk.core.type.Pair; -import org.eclipse.osee.framework.messaging.services.ServiceNotification; -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; - -/** - * @author Andrew M. Finkbeiner - */ -class MonitorTimedOutServices implements Runnable { - - private final CompositeKeyHashMap<String, String, Map<String, ServiceHealthPlusTimeout>> map; - private final CompositeKeyHashMap<String, String, List<ServiceNotification>> callbacks; - - public MonitorTimedOutServices(CompositeKeyHashMap<String, String, Map<String, ServiceHealthPlusTimeout>> map, CompositeKeyHashMap<String, String, List<ServiceNotification>> callbacks) { - this.map = map; - this.callbacks = callbacks; - } - - @Override - public void run() { - List<ThreeItems> toRemove = new ArrayList<ThreeItems>(); - long currentSystemTime = System.currentTimeMillis(); - Set<Pair<String, String>> keySet = map.keySet(); - for (Pair<String, String> pair : keySet) { - Map<String, ServiceHealthPlusTimeout> items = map.get(pair.getFirst(), pair.getSecond()); - for (Entry<String, ServiceHealthPlusTimeout> key : items.entrySet()) { - if (key.getValue().isTimedOut(currentSystemTime)) { - List<ServiceNotification> list = callbacks.get(pair.getFirst(), pair.getSecond()); - if (isServiceReallyGone(list, key.getValue().getServiceHealth())) { - toRemove.add(new ThreeItems(pair.getFirst(), pair.getSecond(), key.getKey())); - for (ServiceNotification notify : list) { - notify.onServiceGone(key.getValue().getServiceHealth()); - } - } - } - } - } - for (ThreeItems item : toRemove) { - Map<String, ServiceHealthPlusTimeout> innerMap = map.get(item.first, item.second); - innerMap.remove(item.key); - if (innerMap.isEmpty()) { - map.remove(item.first, item.second); - } - } - } - - private boolean isServiceReallyGone(List<ServiceNotification> list, ServiceHealth serviceHealth) { - for (ServiceNotification notify : list) { - if (!notify.isServiceGone(serviceHealth)) { - return false; - } - } - return true; - } - - private static class ThreeItems { - - String first; - String second; - String key; - - ThreeItems(String first, String second, String key) { - this.first = first; - this.second = second; - this.key = key; - } - } - -} diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceLookupImpl.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceLookupImpl.java deleted file mode 100644 index 9198c5c308b..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceLookupImpl.java +++ /dev/null @@ -1,113 +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.framework.messaging.services.internal; - -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap; -import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; -import org.eclipse.osee.framework.jdk.core.type.Pair; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.ConnectionNode; -import org.eclipse.osee.framework.messaging.services.BaseMessages; -import org.eclipse.osee.framework.messaging.services.RemoteServiceLookup; -import org.eclipse.osee.framework.messaging.services.ServiceNotification; -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealthRequest; - -/** - * @author Andrew M. Finkbeiner - */ -public class RemoteServiceLookupImpl implements RemoteServiceLookup { - - private final ConnectionNode connectionNode; - private final CompositeKeyHashMap<String, String, Map<String, ServiceHealthPlusTimeout>> map; - private final CompositeKeyHashMap<String, String, List<ServiceNotification>> callbacks; - private final HealthServiceListener healthServiceListener; - - public RemoteServiceLookupImpl(ConnectionNode node, ScheduledExecutorService executor, long serviceTimeout, TimeUnit unit) { - this.connectionNode = node; - map = new CompositeKeyHashMap<String, String, Map<String, ServiceHealthPlusTimeout>>(25, true); - callbacks = new CompositeKeyHashMap<String, String, List<ServiceNotification>>(25, true); - healthServiceListener = new HealthServiceListener(map, callbacks); - connectionNode.subscribeToReply(BaseMessages.ServiceHealthRequest, healthServiceListener); - executor.scheduleAtFixedRate(new MonitorTimedOutServices(map, callbacks), serviceTimeout, serviceTimeout, unit); - } - - public void start() { - connectionNode.subscribe(BaseMessages.ServiceHealth, healthServiceListener, new OseeMessagingStatusImpl( - "Failed to subscribe to " + BaseMessages.ServiceHealth.getName(), RemoteServiceLookupImpl.class)); - - } - - public void stop() { - connectionNode.unsubscribe(BaseMessages.ServiceHealth, healthServiceListener, new OseeMessagingStatusImpl( - "Failed to subscribe to " + BaseMessages.ServiceHealth.getName(), RemoteServiceLookupImpl.class)); - } - - @Override - public void register(String serviceName, String serviceVersion, ServiceNotification notification) { - - addListener(serviceName, serviceVersion, notification); - sendOutRequest(serviceName, serviceVersion); - } - - @Override - public void sendOutRequestsForServiceHealth() { - Set<Pair<String, String>> pairs = callbacks.keySet(); - for (Pair<String, String> pair : pairs) { - sendOutRequest(pair.getFirst(), pair.getSecond()); - } - } - - private void sendOutRequest(String serviceName, String serviceVersion) { - ServiceHealthRequest request = new ServiceHealthRequest(); - request.setServiceName(serviceName); - request.setServiceVersion(serviceVersion); - try { - connectionNode.send( - BaseMessages.ServiceHealthRequest, - request, - new OseeMessagingStatusImpl(String.format("Failed to send Health Request for %s [%s]", serviceName, - serviceVersion), RemoteServiceLookup.class)); - } catch (OseeCoreException ex) { - OseeLog.log(RemoteServiceLookupImpl.class, Level.SEVERE, ex); - } - } - - private void addListener(String serviceName, String serviceVersion, ServiceNotification notification) { - List<ServiceNotification> itemsToNotify = callbacks.get(serviceName, serviceVersion); - if (itemsToNotify == null) { - itemsToNotify = new CopyOnWriteArrayList<ServiceNotification>(); - callbacks.put(serviceName, serviceVersion, itemsToNotify); - } - itemsToNotify.add(notification); - } - - @Override - public boolean unregister(String serviceName, String serviceVersion, ServiceNotification notification) { - return removeListener(serviceName, serviceVersion, notification); - } - - private boolean removeListener(String serviceName, String serviceVersion, ServiceNotification notification) { - List<ServiceNotification> itemsToNotify = callbacks.get(serviceName, serviceVersion); - boolean removed = false; - if (itemsToNotify != null) { - removed = itemsToNotify.remove(notification); - } - return removed; - } - -} diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceRegistrarImpl.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceRegistrarImpl.java deleted file mode 100644 index 61c23d1ef9b..00000000000 --- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceRegistrarImpl.java +++ /dev/null @@ -1,119 +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.framework.messaging.services.internal; - -import java.net.URI; -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap; -import org.eclipse.osee.framework.messaging.ConnectionNode; -import org.eclipse.osee.framework.messaging.services.BaseMessages; -import org.eclipse.osee.framework.messaging.services.RegisteredServiceReference; -import org.eclipse.osee.framework.messaging.services.RemoteServiceRegistrar; -import org.eclipse.osee.framework.messaging.services.ServiceInfoPopulator; - -/** - * @author Andrew M. Finkbeiner - */ -public class RemoteServiceRegistrarImpl implements RemoteServiceRegistrar { - - private final ConnectionNode connectionNode; - private final ConcurrentHashMap<String, ScheduledFuture<?>> map; - private final ConcurrentHashMap<String, UpdateStatus> mapOfUpdateStatus; - private final CompositeKeyHashMap<String, String, List<UpdateStatus>> mapForReplys; - private final ScheduledExecutorService executor; - private final HealthRequestListener healthRequestListener; - - public RemoteServiceRegistrarImpl(ConnectionNode node, ScheduledExecutorService executor) { - this.connectionNode = node; - this.executor = executor; - mapOfUpdateStatus = new ConcurrentHashMap<String, UpdateStatus>(); - map = new ConcurrentHashMap<String, ScheduledFuture<?>>(); - mapForReplys = new CompositeKeyHashMap<String, String, List<UpdateStatus>>(8, true); - healthRequestListener = new HealthRequestListener(mapForReplys); - } - - public void start() { - connectionNode.subscribe(BaseMessages.ServiceHealthRequest, healthRequestListener, new OseeMessagingStatusImpl( - "Failed to subscribe to " + BaseMessages.ServiceHealthRequest.getName(), RemoteServiceRegistrarImpl.class)); - } - - public void stop() { - connectionNode.unsubscribe(BaseMessages.ServiceHealthRequest, healthRequestListener, new OseeMessagingStatusImpl( - "Failed to subscribe to " + BaseMessages.ServiceHealthRequest.getName(), RemoteServiceRegistrarImpl.class)); - } - - @Override - public RegisteredServiceReference registerService(String serviceName, String serviceVersion, String serviceUniqueId, URI broker, ServiceInfoPopulator infoPopulator, int refreshRateInSeconds) { - String key = getKey(serviceName, serviceVersion, serviceUniqueId); - if (!mapOfUpdateStatus.containsKey(key)) { - UpdateStatus updateStatus = - new UpdateStatus(this.connectionNode, serviceName, serviceVersion, serviceUniqueId, broker, - refreshRateInSeconds, infoPopulator); - ScheduledFuture<?> scheduled = - executor.scheduleAtFixedRate(updateStatus, 0, refreshRateInSeconds, TimeUnit.SECONDS); - map.put(key, scheduled); - mapOfUpdateStatus.put(key, updateStatus); - addToReplyMap(serviceName, serviceVersion, updateStatus); - } - return new ServiceReferenceImp(mapOfUpdateStatus.get(key)); - } - - private String getKey(String serviceName, String serviceVersion, String serviceUniqueId) { - return serviceName + serviceVersion + serviceUniqueId; - } - - @Override - public boolean unregisterService(String serviceName, String serviceVersion, String serviceUniqueId) { - String key = getKey(serviceName, serviceVersion, serviceUniqueId); - - UpdateStatus updateStatus = mapOfUpdateStatus.remove(key); - if (updateStatus != null) { - updateStatus.close(); - removeFromReplyMap(serviceName, serviceVersion, updateStatus); - } - - ScheduledFuture<?> scheduled = map.remove(key); - if (scheduled == null) { - return false; - } else { - return scheduled.cancel(false); - } - } - - public void addToReplyMap(String serviceName, String serviceVersion, UpdateStatus updateForReply) { - List<UpdateStatus> list = mapForReplys.get(serviceName, serviceVersion); - if (list == null) { - list = new CopyOnWriteArrayList<UpdateStatus>(); - mapForReplys.put(serviceName, serviceVersion, list); - } - list.add(updateForReply); - } - - public boolean removeFromReplyMap(String serviceName, String serviceVersion, UpdateStatus updateForReply) { - List<UpdateStatus> list = mapForReplys.get(serviceName, serviceVersion); - if (list != null) { - return list.remove(updateForReply); - } - return false; - } - - void updateService(String key) { - UpdateStatus update = mapOfUpdateStatus.get(key); - if (update != null) { - update.run(); - } - } -} 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); - } - -} diff --git a/plugins/org.eclipse.osee.ote.discovery/.classpath b/plugins/org.eclipse.osee.ote.discovery/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.osee.ote.discovery/.project b/plugins/org.eclipse.osee.ote.discovery/.project deleted file mode 100644 index 968b3107fca..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.osee.ote.discovery</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ds.core.builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.osee.ote.discovery/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.discovery/META-INF/MANIFEST.MF deleted file mode 100644 index 3de5eb8751c..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OTE Server Discovery (Incubation) -Bundle-SymbolicName: org.eclipse.osee.ote.discovery -Bundle-Version: 0.17.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Service-Component: OSGI-INF/ote.discovery.xml -Import-Package: org.eclipse.osee.framework.logging, - org.eclipse.osee.framework.messaging, - org.eclipse.osee.framework.messaging.services, - org.eclipse.osee.framework.messaging.services.messages -Export-Package: org.eclipse.osee.ote.discovery -Bundle-Vendor: Eclipse Open System Engineering Environment diff --git a/plugins/org.eclipse.osee.ote.discovery/OSGI-INF/ote.discovery.xml b/plugins/org.eclipse.osee.ote.discovery/OSGI-INF/ote.discovery.xml deleted file mode 100644 index 0b364d3ff5f..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/OSGI-INF/ote.discovery.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.osee.ote.discovery"> - <implementation class="org.eclipse.osee.ote.discovery.internal.OTEServerDiscoveryImpl"/> - <reference bind="bindRemoteServiceLookup" cardinality="1..1" interface="org.eclipse.osee.framework.messaging.services.RemoteServiceLookup" name="RemoteServiceLookup" policy="static" unbind="unbindRemoteServiceLookup"/> - <service> - <provide interface="org.eclipse.osee.ote.discovery.OTEServerDiscovery"/> - </service> -</scr:component> diff --git a/plugins/org.eclipse.osee.ote.discovery/build.properties b/plugins/org.eclipse.osee.ote.discovery/build.properties deleted file mode 100644 index 6210e849b59..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ -source.. = src/ diff --git a/plugins/org.eclipse.osee.ote.discovery/pom.xml b/plugins/org.eclipse.osee.ote.discovery/pom.xml deleted file mode 100644 index 1438bdfe253..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.eclipse.osee</groupId> - <artifactId>org.eclipse.osee.ote.parent</artifactId> - <version>0.17.0-SNAPSHOT</version> - <relativePath>../../plugins/org.eclipse.osee.ote.parent</relativePath> - </parent> - - <artifactId>org.eclipse.osee.ote.discovery</artifactId> - <packaging>eclipse-plugin</packaging> - <name>OTE Discovery(Incubation)</name> - - <build> - <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 --> - <resources> - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.eclipse.tycho</groupId> - <artifactId>tycho-source-plugin</artifactId> - </plugin> - </plugins> - </build> - -</project>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerDiscovery.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerDiscovery.java deleted file mode 100644 index 3b50be627c3..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerDiscovery.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.osee.ote.discovery; - -import java.net.URISyntaxException; -import java.util.List; - -public interface OTEServerDiscovery { - - List<OTEServerLocation> findServerByTitle(String regex) throws URISyntaxException; - List<OTEServerLocation> findServerByMachine(String regex) throws URISyntaxException; - List<OTEServerLocation> findServerByMachineAndTitle(String regexMachine, String regexTitle) throws URISyntaxException; - List<OTEServerLocation> getAll() throws URISyntaxException; - List<OTEServerLocation> findServerByTitle(String regex, long timeoutMs) throws URISyntaxException; - List<OTEServerLocation> findServerByMachine(String string, long timeoutMs) throws URISyntaxException; - List<OTEServerLocation> findServerByMachineAndTitle(String regexMachine, String regexTitle, long timeoutMs) throws URISyntaxException; - -} diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerLocation.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerLocation.java deleted file mode 100644 index 78b8132aa6e..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerLocation.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.eclipse.osee.ote.discovery; - -import java.net.URI; -import java.net.URISyntaxException; - -public interface OTEServerLocation { - - URI getBrokerURI() throws URISyntaxException; - URI getApplicationServerURI(); - String getTitle(); - String getMachineName(); - -} diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerDiscoveryImpl.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerDiscoveryImpl.java deleted file mode 100644 index 8f83979301e..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerDiscoveryImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -package org.eclipse.osee.ote.discovery.internal; - -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantLock; - -import org.eclipse.osee.framework.messaging.services.RemoteServiceLookup; -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; -import org.eclipse.osee.ote.discovery.OTEServerDiscovery; -import org.eclipse.osee.ote.discovery.OTEServerLocation; - -public class OTEServerDiscoveryImpl implements OTEServerDiscovery { - - private RemoteServiceLookup remoteMessageServiceLookup; - private OTEServerStore store; - private OteServerNotification notification; - private ReentrantLock lock; - private Condition condition; - - public OTEServerDiscoveryImpl(){ - lock = new ReentrantLock(); - condition = lock.newCondition(); - store = new OTEServerStoreImpl(lock, condition); - notification = new OteServerNotification(store); - } - - public void start(){ - new Thread(new Runnable() { - @Override - public void run() { - remoteMessageServiceLookup.register("osee.ote.server", "1.0", notification); - remoteMessageServiceLookup.sendOutRequestsForServiceHealth(); - } - }).start(); - } - - public void stop(){ - new Thread(new Runnable() { - @Override - public void run() { - remoteMessageServiceLookup.unregister("osee.ote.server", "1.0", notification); - } - }).start(); - } - - public void bindRemoteServiceLookup(RemoteServiceLookup remoteMessageServiceLookup){ - this.remoteMessageServiceLookup = remoteMessageServiceLookup; - } - - public void unbindRemoteServiceLookup(RemoteServiceLookup remoteMessageServiceLookup){ - this.remoteMessageServiceLookup = null; - } - - @Override - public List<OTEServerLocation> findServerByTitle(String regex, long timeoutMs) throws URISyntaxException { - lock.lock(); - List<OTEServerLocation> locations = findServerByTitle(regex); - try{ - long nanos = TimeUnit.MILLISECONDS.toNanos(timeoutMs); - while(nanos > 0 && locations.size() == 0) { - try { - nanos = condition.awaitNanos(nanos); - locations = findServerByTitle(regex); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } finally { - lock.unlock(); - } - return locations; - } - - @Override - public List<OTEServerLocation> findServerByMachine(String regex, long timeoutMs) throws URISyntaxException { - lock.lock(); - List<OTEServerLocation> locations = findServerByMachine(regex); - try{ - long nanos = TimeUnit.MILLISECONDS.toNanos(timeoutMs); - while(nanos > 0 && locations.size() == 0) { - try { - nanos = condition.awaitNanos(nanos); - locations = findServerByMachine(regex); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } finally { - lock.unlock(); - } - return locations; - } - - @Override - public List<OTEServerLocation> findServerByTitle(String regex) throws URISyntaxException { - Collection<ServiceHealth> healths = store.getAll(); - List<OTEServerLocation> locations = new ArrayList<OTEServerLocation>(); - for(ServiceHealth health:healths){ - OTEServerLocationServiceHealth item = new OTEServerLocationServiceHealth(health); - if(item.isValid() && item.getTitle().matches(regex)){ - locations.add(item); - } - } - return locations; - } - - @Override - public List<OTEServerLocation> findServerByMachine(String regex) throws URISyntaxException { - Collection<ServiceHealth> healths = store.getAll(); - List<OTEServerLocation> locations = new ArrayList<OTEServerLocation>(); - for(ServiceHealth health:healths){ - OTEServerLocationServiceHealth item = new OTEServerLocationServiceHealth(health); - if(item.isValid() && item.getMachineName().matches(regex)){ - locations.add(item); - } - } - return locations; - } - - @Override - public List<OTEServerLocation> findServerByMachineAndTitle(String regexMachine, String regexTitle) throws URISyntaxException { - Collection<ServiceHealth> healths = store.getAll(); - List<OTEServerLocation> locations = new ArrayList<OTEServerLocation>(); - for(ServiceHealth health:healths){ - OTEServerLocationServiceHealth item = new OTEServerLocationServiceHealth(health); - if(item.isValid() && item.getTitle().matches(regexTitle) && item.getMachineName().matches(regexMachine)){ - locations.add(item); - } - } - return locations; - } - - @Override - public List<OTEServerLocation> getAll() throws URISyntaxException { - Collection<ServiceHealth> healths = store.getAll(); - List<OTEServerLocation> locations = new ArrayList<OTEServerLocation>(); - for(ServiceHealth health:healths){ - OTEServerLocationServiceHealth item = new OTEServerLocationServiceHealth(health); - if(item.isValid()){ - locations.add(item); - } - } - return locations; - } - - @Override - public List<OTEServerLocation> findServerByMachineAndTitle(String regexMachine, String regexTitle, long timeoutMs) throws URISyntaxException { - lock.lock(); - List<OTEServerLocation> locations = findServerByMachineAndTitle(regexMachine, regexTitle); - try{ - long nanos = TimeUnit.MILLISECONDS.toNanos(timeoutMs); - while(nanos > 0 && locations.size() == 0) { - try { - nanos = condition.awaitNanos(nanos); - locations = findServerByMachineAndTitle(regexMachine, regexTitle); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } finally { - lock.unlock(); - } - return locations; - } - -} diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerLocationServiceHealth.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerLocationServiceHealth.java deleted file mode 100644 index ba7184b7186..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerLocationServiceHealth.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.osee.ote.discovery.internal; - -import java.net.URI; -import java.net.URISyntaxException; - -import org.eclipse.osee.framework.messaging.services.messages.ServiceDescriptionPair; -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; -import org.eclipse.osee.ote.discovery.OTEServerLocation; - -public class OTEServerLocationServiceHealth implements OTEServerLocation { - - private URI brokerURI; - private URI appServerURI; - private String title; - private String machineName; - - public OTEServerLocationServiceHealth(ServiceHealth health) throws URISyntaxException{ - this.brokerURI = new URI(health.getBrokerURI()); - for(ServiceDescriptionPair pair:health.getServiceDescription()){ - if("station".equals(pair.getName())){ - machineName = pair.getValue(); - } else if("name".equals(pair.getName())){ - title = pair.getValue(); - } else if ("appServerURI".equals(pair.getName())){ - appServerURI = new URI(pair.getValue()); - } - } - } - - public boolean isValid(){ - return brokerURI!=null && appServerURI != null && title != null && machineName != null; - } - - @Override - public URI getBrokerURI() throws URISyntaxException { - return brokerURI; - } - - @Override - public URI getApplicationServerURI() { - return appServerURI; - } - - @Override - public String getTitle() { - return title; - } - - @Override - public String getMachineName() { - return machineName; - } -} diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStore.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStore.java deleted file mode 100644 index 0f6ef9c7c85..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStore.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.eclipse.osee.ote.discovery.internal; - -import java.util.Collection; - -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; - -public interface OTEServerStore { - - void add(ServiceHealth serviceHealth); - void remove(ServiceHealth serviceHealth); - public Collection<ServiceHealth> getAll(); -} diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStoreImpl.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStoreImpl.java deleted file mode 100644 index cd5c9472334..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStoreImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.osee.ote.discovery.internal; - -import java.util.Collection; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantLock; - -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; - -public class OTEServerStoreImpl implements OTEServerStore { - - private ConcurrentHashMap<String, ServiceHealth> data; - - private Condition condition; - - private ReentrantLock lock; - - public OTEServerStoreImpl(ReentrantLock lock, Condition condition){ - data = new ConcurrentHashMap<String, ServiceHealth>(); - this.condition = condition; - this.lock = lock; - } - - @Override - public void add(ServiceHealth serviceHealth) { - data.put(serviceHealth.getServiceUniqueId(), serviceHealth); - lock.lock(); - try{ - condition.signalAll(); - } finally { - lock.unlock(); - } - } - - @Override - public void remove(ServiceHealth serviceHealth) { - data.remove(serviceHealth.getServiceUniqueId()); - lock.lock(); - try{ - condition.signalAll(); - } finally { - lock.unlock(); - } - } - - @Override - public Collection<ServiceHealth> getAll(){ - return data.values(); - } -} diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OteServerNotification.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OteServerNotification.java deleted file mode 100644 index 67ed1f71ada..00000000000 --- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OteServerNotification.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.osee.ote.discovery.internal; - -import org.eclipse.osee.framework.messaging.services.ServiceNotification; -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; - -public class OteServerNotification implements ServiceNotification{ - - private OTEServerStore store; - - public OteServerNotification(OTEServerStore store) { - this.store = store; - } - - @Override - public void onServiceUpdate(ServiceHealth serviceHealth) { - store.add(serviceHealth); - } - - @Override - public void onServiceGone(ServiceHealth serviceHealth) { - store.remove(serviceHealth); - } - - @Override - public boolean isServiceGone(ServiceHealth serviceHealth) { - return true; - } - -} diff --git a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/bridge/EventToJmsComponent.java b/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/bridge/EventToJmsComponent.java index df0715ce978..84f0c590ccf 100644 --- a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/bridge/EventToJmsComponent.java +++ b/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/bridge/EventToJmsComponent.java @@ -16,6 +16,7 @@ import java.util.Map; import java.util.UUID; import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; + import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.messaging.OseeMessagingListener; @@ -43,10 +44,6 @@ public class EventToJmsComponent extends OseeMessagingListener implements EventH } - void stop(){ - - } - public synchronized void bindConnectionNode(OteServerJmsNodeProvider connectionNode){ this.connecitonNode = connectionNode; connecitonNode.getConnectionNode().subscribe(BridgeMessages.BYTE_MESSAGE, this); diff --git a/plugins/org.eclipse.osee.ote.parent/pom.xml b/plugins/org.eclipse.osee.ote.parent/pom.xml index 576d72b7225..39446687306 100644 --- a/plugins/org.eclipse.osee.ote.parent/pom.xml +++ b/plugins/org.eclipse.osee.ote.parent/pom.xml @@ -29,7 +29,6 @@ <module>../../plugins/org.eclipse.osee.ote.rest</module> <module>../../plugins/org.eclipse.osee.ote.rest.client</module> <module>../../plugins/org.eclipse.osee.ote.rest.model</module> - <module>../../plugins/org.eclipse.osee.ote.discovery</module> <module>../../plugins/org.eclipse.osee.ote.client</module> <module>../../plugins/org.eclipse.osee.ote.client.msg</module> <module>../../plugins/org.eclipse.osee.ote.connection.jini</module> diff --git a/plugins/org.eclipse.osee.ote.server/OSGI-INF/ote.service.starter.xml b/plugins/org.eclipse.osee.ote.server/OSGI-INF/ote.service.starter.xml index 693734b9064..1055ac4893a 100644 --- a/plugins/org.eclipse.osee.ote.server/OSGI-INF/ote.service.starter.xml +++ b/plugins/org.eclipse.osee.ote.server/OSGI-INF/ote.service.starter.xml @@ -5,7 +5,6 @@ <provide interface="org.eclipse.osee.ote.server.OteServiceStarter"/> </service> <reference unbind="unbindIRuntimeLibraryManager" bind="bindIRuntimeLibraryManager" cardinality="1..1" interface="org.eclipse.osee.ote.core.environment.interfaces.IRuntimeLibraryManager" name="IRuntimeLibraryManager" policy="static"/> - <reference unbind="unbindRemoteServiceRegistrar" bind="bindRemoteServiceRegistrar" cardinality="1..1" interface="org.eclipse.osee.framework.messaging.services.RemoteServiceRegistrar" name="RemoteServiceRegistrar" policy="static"/> <reference unbind="unbindMessageService" bind="bindMessageService" cardinality="1..1" interface="org.eclipse.osee.framework.messaging.MessageService" name="MessageService" policy="static"/> <reference unbind="unbindIConnectionService" bind="bindIConnectionService" cardinality="1..1" interface="org.eclipse.osee.connection.service.IConnectionService" name="IConnectionService" policy="static"/> <reference unbind="unbindPackageAdmin" bind="bindPackageAdmin" cardinality="1..1" interface="org.osgi.service.packageadmin.PackageAdmin" name="PackageAdmin" policy="static"/> 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 85312458449..3ea6a4966f1 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 @@ -42,8 +42,6 @@ import org.eclipse.osee.framework.messaging.NodeInfo; import org.eclipse.osee.framework.messaging.OseeMessagingListener; import org.eclipse.osee.framework.messaging.OseeMessagingStatusCallback; import org.eclipse.osee.framework.messaging.ReplyConnection; -import org.eclipse.osee.framework.messaging.services.RegisteredServiceReference; -import org.eclipse.osee.framework.messaging.services.RemoteServiceRegistrar; import org.eclipse.osee.framework.messaging.services.ServiceInfoPopulator; import org.eclipse.osee.framework.messaging.services.messages.ServiceDescriptionPair; import org.eclipse.osee.ote.core.OTESessionManager; @@ -67,7 +65,6 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu private PackageAdmin packageAdmin; private IRuntimeLibraryManager runtimeLibraryManager; private IConnectionService connectionService; - private RemoteServiceRegistrar remoteServiceRegistrar; private MessageService messageService; private BrokerService brokerService; @@ -117,14 +114,6 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu this.runtimeLibraryManager = null; } - public void bindRemoteServiceRegistrar(RemoteServiceRegistrar remoteServiceRegistrar){ - this.remoteServiceRegistrar = remoteServiceRegistrar; - } - - public void unbindRemoteServiceRegistrar(RemoteServiceRegistrar remoteServiceRegistrar){ - this.remoteServiceRegistrar = null; - } - public void bindMessageService(MessageService messageService){ this.messageService = messageService; } @@ -233,9 +222,7 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu OseeLog.log(getClass(), Level.SEVERE, th); } } else { //user old lookup - messageService.get(nodeInfo).subscribe(OteBaseMessages.RequestOteHost, listenForHostRequest, this); - RegisteredServiceReference ref = remoteServiceRegistrar.registerService("osee.ote.server", "1.0", service.getServiceID().toString(), uri, this, 60 * 3); - service.set(ref); + OseeLog.log(getClass(), Level.SEVERE, "'ote.master.uri' was not set. You must use direct connect from the client."); } } else { @@ -291,7 +278,6 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu if (service != null) { try { service.updateDynamicInfo(); - remoteServiceRegistrar.unregisterService("osee.ote.server", "1.0", service.getServiceID().toString()); service.kill(); service = null; } catch (Exception ex) { |