diff options
author | Andrew M. Finkbeiner | 2016-02-12 13:44:26 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2016-02-12 13:44:26 +0000 |
commit | 5832c61360f157dd9a23fc85a7db9c03d4dfe294 (patch) | |
tree | 9ee17e92fb40e87290a7865b2077efb81f06965d /plugins | |
parent | 1236948ce11e639bff4ed6096909a10974016290 (diff) | |
download | org.eclipse.osee-5832c61360f157dd9a23fc85a7db9c03d4dfe294.tar.gz org.eclipse.osee-5832c61360f157dd9a23fc85a7db9c03d4dfe294.tar.xz org.eclipse.osee-5832c61360f157dd9a23fc85a7db9c03d4dfe294.zip |
feature[ats_ATS272148]: Remove activemq
Diffstat (limited to 'plugins')
41 files changed, 247 insertions, 1486 deletions
diff --git a/plugins/org.eclipse.osee.ote.client/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.client/META-INF/MANIFEST.MF index 02593122831..7526f71f678 100644 --- a/plugins/org.eclipse.osee.ote.client/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.ote.client/META-INF/MANIFEST.MF @@ -50,8 +50,6 @@ Import-Package: net.jini.activation, org.eclipse.osee.framework.core.exception, org.eclipse.osee.framework.jdk.core.type, org.eclipse.osee.framework.jdk.core.util, - org.eclipse.osee.framework.messaging, - org.eclipse.osee.framework.messaging.id, org.eclipse.osee.framework.plugin.core.util, org.eclipse.osee.ote, org.eclipse.osee.ote.connection.jini, @@ -69,5 +67,4 @@ Import-Package: net.jini.activation, Export-Package: org.eclipse.osee.ote.service, org.eclipse.osee.ote.service.core Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.eclipse.osee.framework.logging, - org.eclipse.osee.framework.messaging +Require-Bundle: org.eclipse.osee.framework.logging diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/JmsToJiniBridgeConnectorLite.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/JmsToJiniBridgeConnectorLite.java deleted file mode 100644 index 270e0b722b0..00000000000 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/JmsToJiniBridgeConnectorLite.java +++ /dev/null @@ -1,278 +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.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.Serializable; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.UnknownHostException; -import java.rmi.Remote; -import java.rmi.server.ExportException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.logging.Level; -import net.jini.export.Exporter; -import net.jini.jeri.BasicILFactory; -import net.jini.jeri.BasicJeriExporter; -import net.jini.jeri.tcp.TcpServerEndpoint; -import org.eclipse.osee.connection.service.IServiceConnector; -import org.eclipse.osee.connection.service.IServicePropertyChangeListener; -import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; -import org.eclipse.osee.framework.jdk.core.util.EnhancedProperties; -import org.eclipse.osee.framework.jdk.core.util.Network; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.ConnectionNode; -import org.eclipse.osee.framework.messaging.MessageService; -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.messages.ServiceDescriptionPair; -import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth; -import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; -import org.eclipse.osee.ote.core.OteBaseMessages; -import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment; - -/** - * @author Andrew M. Finkbeiner - */ -public class JmsToJiniBridgeConnectorLite implements IServiceConnector, OseeMessagingStatusCallback { - public static final String TYPE = "jmstojini"; - public static final String OTE_EMBEDDED_BROKER_PROP = "OTEEmbeddedBroker"; - private static final class ExportInfo { - private final Exporter exporter; - private final Object exportedObject; - - private ExportInfo(Exporter exporter, Object exportedObject) { - this.exportedObject = exportedObject; - this.exporter = exporter; - } - } - - private MessageService messageService; - private OteServiceRequestHandler myOteServiceRequestHandler = new OteServiceRequestHandler(); - private EnhancedProperties properties; - private final HashMap<Object, ExportInfo> exports = new HashMap<>(); - private final ExportClassLoader exportClassLoader; - private final List<IServicePropertyChangeListener> propertyChangeListeners = - new CopyOnWriteArrayList<IServicePropertyChangeListener>(); - private final String uniqueServerId; - private ServiceHealth serviceHealth; - public Object service; - - Object myLock = new Object(); - private boolean connected = false; - - public JmsToJiniBridgeConnectorLite(ServiceHealth serviceHealth, MessageService messageService) { - this.serviceHealth = serviceHealth; - this.uniqueServerId = serviceHealth.getServiceUniqueId(); - this.exportClassLoader = ExportClassLoader.getInstance(); - this.messageService = messageService; - } - - public void setServiceHealth(ServiceHealth serviceHealth){ - this.serviceHealth = serviceHealth; - for(IServicePropertyChangeListener change: propertyChangeListeners){ - change.propertyChanged(this, "user_list", getProperty("user_list", "N/A")); - } - } - -@Override - public Object export(Object callback) throws ExportException { - try { - Exporter exporter = createExporter(); - Object exportedObject = exporter.export((Remote) callback); - exports.put(callback, new ExportInfo(exporter, exportedObject)); - return exportedObject; - } catch (UnknownHostException e) { - throw new ExportException("failed to export", e); - } - } - - @Override - public void unexport(Object callback) throws Exception { - ExportInfo info = exports.remove(callback); - if (info != null) { - info.exporter.unexport(false); - } - } - - @Override - public Object findExport(Object callback) { - ExportInfo info = exports.get(callback); - if (info != null) { - return info.exportedObject; - } - return null; - } - - @Override - public void stop() throws Exception { - for (ExportInfo info : exports.values()) { - info.exporter.unexport(false); - } - exports.clear(); - } - - private Exporter createExporter() throws UnknownHostException { - return new BasicJeriExporter(TcpServerEndpoint.getInstance(Network.getValidIP().getHostAddress(), 0), - new BasicILFactory(null, null, exportClassLoader), false, false); - } - - @Override - public String getConnectorType() { - return TYPE; - } - - @Override - public Serializable getProperty(String property, Serializable defaultValue) { - for(ServiceDescriptionPair pair:serviceHealth.getServiceDescription()){ - if(pair.getName().equals(property)){ - return pair.getValue(); - } - } - if(property.equals(OTE_EMBEDDED_BROKER_PROP)){ - try { - return new NodeInfo(OTE_EMBEDDED_BROKER_PROP, new URI(serviceHealth.getBrokerURI())); - } catch (URISyntaxException e) { - OseeLog.log(Activator.class, Level.SEVERE, e); - } - } - return defaultValue; - } - - @Override - public Object getService() { - if(this.service == null){ - ConnectionNode connectionNode; - try { - connectionNode = messageService.get(new NodeInfo("oteserver", new URI(serviceHealth.getBrokerURI()))); - connectionNode.subscribeToReply(OteBaseMessages.RequestOteHost, myOteServiceRequestHandler); - connectionNode.send(OteBaseMessages.RequestOteHost, serviceHealth.getServiceUniqueId(), this); - synchronized(myLock){ - myLock.wait(30*1000); - } - } catch (OseeCoreException e) { - OseeLog.log(Activator.class, Level.SEVERE, e); - } catch (URISyntaxException e) { - OseeLog.log(Activator.class, Level.SEVERE, e); - } catch (InterruptedException e) { - OseeLog.log(Activator.class, Level.SEVERE, e); - } - } - return service; - } - - @Override - public boolean ping() { - if(this.service == null){ - return false; - } else { - try{ - ((IHostTestEnvironment)this.service).getProperties(); - } catch (Throwable th){ - return false; - } - } - return true; - } - - @Override - public void addPropertyChangeListener(IServicePropertyChangeListener listener) { - propertyChangeListeners.add(listener); - } - - @Override - public void removePropertyChangeListener(IServicePropertyChangeListener listener) { - propertyChangeListeners.remove(listener); - } - - @Override - public void setProperty(String key, Serializable value) { -// properties.setProperty(key, value); -// for (IServicePropertyChangeListener listener : propertyChangeListeners) { -// listener.propertyChanged(this, key, value); -// } - System.out.println("no"); - } - - @Override - public URI upload(File file) throws Exception { - return null; - } - - @Override - public String getUniqueServerId() { - return uniqueServerId; - } - - @Override - public EnhancedProperties getProperties() { - return properties; - } - - @Override - public void init(Object service) throws UnknownHostException, ExportException { - - } - - class OteServiceRequestHandler extends OseeMessagingListener { - @Override - public void process(Object message, Map<String, Object> headers, ReplyConnection replyConnection) { - try { - ByteArrayInputStream bais = new ByteArrayInputStream((byte[]) message); - ObjectInputStream ois = new ObjectInputStream(bais); - Object msg = ois.readObject(); - msg.toString(); - Object obj = ois.readObject(); - IHostTestEnvironment hostEnv = (IHostTestEnvironment) obj; - - String id = hostEnv.getProperties().getProperty("id").toString(); - if (serviceHealth.getServiceUniqueId().equals(id)){ - JmsToJiniBridgeConnectorLite.this.service = hostEnv; - synchronized(myLock){ - myLock.notifyAll(); - } - } - } catch (IOException ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } catch (ClassNotFoundException ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } catch (Exception ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } - } - } - - @Override - public void success() { - } - - @Override - public void fail(Throwable th) { - OseeLog.log(Activator.class, Level.SEVERE, th); - } - - public void setConnected(boolean connected){ - this.connected = connected; - } - - public boolean isConnected() { - return this.connected; - } - -} diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/MessagingGatewayBindTracker.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/MessagingGatewayBindTracker.java deleted file mode 100644 index 86247564953..00000000000 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/MessagingGatewayBindTracker.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.logging.Level; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.EndpointReceive; -import org.eclipse.osee.framework.messaging.EndpointSend; -import org.eclipse.osee.framework.messaging.MessagingGateway; -import org.eclipse.osee.ote.service.core.OteClientEndpointSend; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; - -/** - * @author Andrew M. Finkbeiner - */ -public class MessagingGatewayBindTracker extends ServiceTracker { - - private final EndpointSend send; - private final EndpointReceive receive; - - public MessagingGatewayBindTracker(BundleContext context, EndpointSend send, EndpointReceive receive) { - super(context, MessagingGateway.class.getName(), null); - this.send = send; - this.receive = receive; - } - - @Override - public Object addingService(ServiceReference reference) { - Object obj = context.getService(reference); - MessagingGateway messagingGateway = (MessagingGateway) obj; - if (!messagingGateway.bind(send)) { - OseeLog.logf(Activator.class, Level.SEVERE, - "Unable to bind %s to the MessagingGateway.", send.toString()); - } - if (!messagingGateway.bind(receive)) { - OseeLog.logf(Activator.class, Level.SEVERE, - "Unable to bind %s to the MessagingGateway.", receive.toString()); - } - if (!messagingGateway.bindSendProtocol(OteClientEndpointSend.OTE_CLIENT_SEND_PROTOCOL, send)) { - OseeLog.logf(Activator.class, Level.SEVERE, - "Unable to bind %s to %s through the MessagingGateway.", - OteClientEndpointSend.OTE_CLIENT_SEND_PROTOCOL.toString(), send.toString()); - } - return super.addingService(reference); - } - - @Override - public void removedService(ServiceReference reference, Object service) { - Object obj = context.getService(reference); - MessagingGateway messagingGateway = (MessagingGateway) obj; - if (!messagingGateway.unbindSendProtocol(OteClientEndpointSend.OTE_CLIENT_SEND_PROTOCOL, send)) { - OseeLog.logf(Activator.class, Level.SEVERE, - "Unable to bind %s to %s through the MessagingGateway.", - OteClientEndpointSend.OTE_CLIENT_SEND_PROTOCOL.toString(), send.toString()); - } - if (!messagingGateway.unbind(send)) { - OseeLog.logf(Activator.class, Level.SEVERE, - "Unable to unbind %s to the MessagingGateway.", send.toString()); - } - if (!messagingGateway.unbind(receive)) { - OseeLog.logf(Activator.class, Level.SEVERE, - "Unable to bind %s to the MessagingGateway.", receive.toString()); - } - super.removedService(reference, service); - } - -} diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ClientSession.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ClientSession.java index 7d25b9694f2..c850a25d84f 100644 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ClientSession.java +++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ClientSession.java @@ -20,7 +20,6 @@ import java.util.logging.Level; import org.eclipse.osee.connection.service.IServiceConnector; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.Message; import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; import org.eclipse.osee.ote.core.AbstractRemoteSession; import org.eclipse.osee.ote.core.ConnectionRequestResult; @@ -44,13 +43,13 @@ public class ClientSession extends AbstractRemoteSession { private final InetAddress address; private SessionDelegate sessionDelegate = null; private final ReentrantLock lock = new ReentrantLock(); - private final OteClientEndpointReceive receive; +// private final OteClientEndpointReceive receive; private UUID id; - public ClientSession(OSEEPerson1_4 user, InetAddress address, OteClientEndpointReceive receive) { + public ClientSession(OSEEPerson1_4 user, InetAddress address) { super(user); this.address = address; - this.receive = receive; +// this.receive = receive; this.id = UUID.randomUUID(); Activator.log(Level.INFO, String.format("Created OTE session for %s. Address=%s\n ", user.getName(), address.toString())); @@ -205,11 +204,6 @@ public class ClientSession extends AbstractRemoteSession { } @Override - public void sendMessageToClient(Message message) throws RemoteException { - receive.receivedMessage(message); - } - - @Override public void initiateYesNoPrompt(IYesNoPromptResponse prompt) throws Exception { assert sessionDelegate != null : "delegate is null"; try { diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ConnectionServiceTracker.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ConnectionServiceTracker.java index 31d7a7623d9..7a82a8b370c 100644 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ConnectionServiceTracker.java +++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ConnectionServiceTracker.java @@ -15,7 +15,6 @@ import java.util.logging.Level; import org.eclipse.osee.connection.service.IConnectionService; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.ote.service.IOteClientService; -import org.eclipse.osee.ote.service.MessagingGatewayBindTracker; import org.eclipse.osee.ote.service.TestSessionException; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; @@ -24,23 +23,23 @@ import org.osgi.util.tracker.ServiceTracker; public class ConnectionServiceTracker extends ServiceTracker { - private final OteClientEndpointReceive endpointReceive = new OteClientEndpointReceive(); - private final OteClientEndpointSend endpointSend = new OteClientEndpointSend(); - private final MessagingGatewayBindTracker messagingGatewayTracker; +// private final OteClientEndpointReceive endpointReceive = new OteClientEndpointReceive(); +// private final OteClientEndpointSend endpointSend = new OteClientEndpointSend(); +// private final MessagingGatewayBindTracker messagingGatewayTracker; private ServiceRegistration registration; private TestClientServiceImpl testClientService; public ConnectionServiceTracker(BundleContext context) { super(context, IConnectionService.class.getName(), null); - messagingGatewayTracker = new MessagingGatewayBindTracker(context, endpointSend, endpointReceive); - messagingGatewayTracker.open(true); +// messagingGatewayTracker = new MessagingGatewayBindTracker(context, endpointSend, endpointReceive); +// messagingGatewayTracker.open(true); } @Override public Object addingService(ServiceReference reference) { IConnectionService connectionService = (IConnectionService) super.addingService(reference); - testClientService = new TestClientServiceImpl(connectionService, endpointSend, endpointReceive); + testClientService = new TestClientServiceImpl(connectionService); testClientService.init(); // register the service registration = context.registerService(IOteClientService.class.getName(), testClientService, null); @@ -71,7 +70,7 @@ public class ConnectionServiceTracker extends ServiceTracker { @Override public void close() { shutdownClientService(); - messagingGatewayTracker.close(); +// messagingGatewayTracker.close(); super.close(); } diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ListenerNotifier.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ListenerNotifier.java index 442e17f4b34..61490b51cb3 100644 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ListenerNotifier.java +++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ListenerNotifier.java @@ -13,7 +13,9 @@ package org.eclipse.osee.ote.service.core; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; import java.util.logging.Level; + import org.eclipse.osee.connection.service.IServiceConnector; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.ote.service.Activator; @@ -24,7 +26,15 @@ import org.eclipse.osee.ote.service.ITestConnectionListener; * @author Ken J. Aguilar */ class ListenerNotifier { - private final ExecutorService executor = Executors.newCachedThreadPool(); + private final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { + private int count = 0; + @Override + public Thread newThread(Runnable r) { + Thread th = new Thread(r); + th.setName(String.format("OTE listener notifier [%d]", count++)); + return th; + } + }); private final CopyOnWriteArraySet<ITestConnectionListener> testConnectionListeners = new CopyOnWriteArraySet<ITestConnectionListener>(); diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/OteClientEndpointReceive.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/OteClientEndpointReceive.java deleted file mode 100644 index d206970611f..00000000000 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/OteClientEndpointReceive.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.core; - -import java.util.Properties; -import org.eclipse.osee.framework.messaging.EndpointReceive; -import org.eclipse.osee.framework.messaging.Message; - -/** - * @author Andrew M. Finkbeiner - */ -public class OteClientEndpointReceive extends EndpointReceive { - - @Override - public void dispose() { - } - - @Override - public void start(Properties properties) { - } - - public void receivedMessage(Message message) { - onReceive(message); - } - -} diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/OteClientEndpointSend.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/OteClientEndpointSend.java deleted file mode 100644 index 3afef7d35da..00000000000 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/OteClientEndpointSend.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.core; - -import java.util.Properties; -import org.eclipse.osee.framework.messaging.EndpointSend; -import org.eclipse.osee.framework.messaging.ExceptionHandler; -import org.eclipse.osee.framework.messaging.Message; -import org.eclipse.osee.framework.messaging.id.ProtocolId; -import org.eclipse.osee.framework.messaging.id.StringName; -import org.eclipse.osee.framework.messaging.id.StringNamespace; -import org.eclipse.osee.framework.messaging.id.StringProtocolId; -import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment; -import org.eclipse.osee.ote.service.IOteClientService; - -/** - * @author Andrew M. Finkbeiner - */ -public class OteClientEndpointSend implements EndpointSend { - - public static ProtocolId OTE_CLIENT_SEND_PROTOCOL = new StringProtocolId(new StringNamespace( - "org.eclipse.osee.ote.service.core"), new StringName("OteClientEndpointSend")); - private IOteClientService clientService; - - @Override - public void send(Message message, ExceptionHandler exceptionHandler) { - if (clientService == null) { - exceptionHandler.handleException(new Exception(String.format( - "Unable to send message [%s], no client service is available.", message.toString()))); - } else { - ITestEnvironment env = clientService.getConnectedEnvironment(); - if (env == null) { - exceptionHandler.handleException(new Exception(String.format( - "Unable to send message [%s], there is not a connected environment.", message.toString()))); - } else { - try { - env.sendMessage(message); - } catch (Throwable th) { - exceptionHandler.handleException(new Exception(String.format("Unable to send message [%s]", - message.toString()), th)); - } - } - } - } - - @Override - public void start(Properties properties) { - } - - public void setTestClientService(IOteClientService testClientServiceImpl) { - this.clientService = testClientServiceImpl; - } - -} diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java index 917f7029946..eaf5c696bcb 100644 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java +++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java @@ -55,14 +55,14 @@ public class TestClientServiceImpl implements IOteClientService, IConnectorListe private volatile boolean stopped = false; private TestHostConnection testConnection; - private final OteClientEndpointSend endpointSend; - private final OteClientEndpointReceive endpointReceive; +// private final OteClientEndpointSend endpointSend; +// private final OteClientEndpointReceive endpointReceive; - public TestClientServiceImpl(IConnectionService connectionService, OteClientEndpointSend endpointSend, OteClientEndpointReceive endpointReceive) { + public TestClientServiceImpl(IConnectionService connectionService) { this.connectionService = connectionService; - this.endpointReceive = endpointReceive; - this.endpointSend = endpointSend; - endpointSend.setTestClientService(this); +// this.endpointReceive = endpointReceive; +// this.endpointSend = endpointSend; +// endpointSend.setTestClientService(this); } public void init() { @@ -253,7 +253,7 @@ public class TestClientServiceImpl implements IOteClientService, IConnectorListe if (session != null) { session.close(); } - session = new ClientSession(user, address, endpointReceive); + session = new ClientSession(user, address); } @Override diff --git a/plugins/org.eclipse.osee.ote.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.core/META-INF/MANIFEST.MF index f7dbc7fc2f2..5a3c3ad4db3 100644 --- a/plugins/org.eclipse.osee.ote.core/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.ote.core/META-INF/MANIFEST.MF @@ -73,8 +73,6 @@ Import-Package: javax.xml.parsers, org.eclipse.osee.framework.core.data, org.eclipse.osee.framework.core.exception, org.eclipse.osee.framework.core.util, - org.eclipse.osee.framework.messaging, - org.eclipse.osee.framework.messaging.id, org.eclipse.osee.framework.plugin.core.util, org.eclipse.osee.ote.connection.jini, org.eclipse.osee.ote.io, diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/NonRemoteUserSession.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/NonRemoteUserSession.java index ef879e987c4..0c5090bcd1f 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/NonRemoteUserSession.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/NonRemoteUserSession.java @@ -1,7 +1,6 @@ package org.eclipse.osee.ote; import java.io.Serializable; -import java.rmi.RemoteException; import java.util.UUID; import org.eclipse.osee.ote.core.IRemoteUserSession; @@ -96,10 +95,4 @@ public class NonRemoteUserSession implements IRemoteUserSession, Serializable { return null; } - @Override - public void sendMessageToClient(org.eclipse.osee.framework.messaging.Message message) throws RemoteException { - // TODO Auto-generated method stub - - } - }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/IRemoteUserSession.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/IRemoteUserSession.java index 82f55f7c5b4..cd179ec1241 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/IRemoteUserSession.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/IRemoteUserSession.java @@ -13,7 +13,6 @@ package org.eclipse.osee.ote.core; import java.rmi.Remote; import java.rmi.RemoteException; -import org.eclipse.osee.framework.messaging.Message; import org.eclipse.osee.ote.core.framework.prompt.IPassFailPromptResponse; import org.eclipse.osee.ote.core.framework.prompt.IResumeResponse; import org.eclipse.osee.ote.core.framework.prompt.IUserInputPromptResponse; @@ -49,7 +48,7 @@ public interface IRemoteUserSession extends Remote, IUserSession { @Override public boolean isAlive() throws RemoteException; - @Override - public void sendMessageToClient(Message message) throws RemoteException; +// @Override +// public void sendMessageToClient(Message message) throws RemoteException; } diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/IUserSession.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/IUserSession.java index 90d18e28122..7919f1ab375 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/IUserSession.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/IUserSession.java @@ -12,7 +12,6 @@ package org.eclipse.osee.ote.core; import java.util.UUID; -import org.eclipse.osee.framework.messaging.Message; import org.eclipse.osee.ote.core.framework.prompt.IPassFailPromptResponse; import org.eclipse.osee.ote.core.framework.prompt.IResumeResponse; import org.eclipse.osee.ote.core.framework.prompt.IUserInputPromptResponse; @@ -43,7 +42,7 @@ public interface IUserSession { public void initiateResumePrompt(IResumeResponse prompt) throws Exception; - public void sendMessageToClient(Message message) throws Exception; +// public void sendMessageToClient(Message message) throws Exception; public void cancelPrompts() throws Exception; diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/OteBaseMessages.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/OteBaseMessages.java deleted file mode 100644 index 75fb5beccfb..00000000000 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/OteBaseMessages.java +++ /dev/null @@ -1,64 +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.core; - -import org.eclipse.osee.framework.messaging.MessageID; - -/** - * @author Andrew M. Finkbeiner - */ -public enum OteBaseMessages implements MessageID { - RequestOteHost(true, "ABjyjamBQRvvgsdgwers", "topic:lba.ote.get.host", null, true), - OteHostShutdown(true, "topic:lba.ote.host.shutdown", "topic:lba.ote.host.shutdown", null, false); - - private String name; - private Class<?> clazz; - boolean isReplyRequired; - private String guid; - private String destination; - - OteBaseMessages(boolean isTopic, String guid, String name, Class<?> clazz, boolean isReplyRequired) { - this.guid = guid; - this.name = name; - this.clazz = clazz; - this.isReplyRequired = isReplyRequired; - if (isTopic) { - destination = "topic:" + guid; - } else { - destination = guid; - } - } - - @Override - public String getName() { - return name; - } - - @Override - public Class<?> getSerializationClass() { - return clazz; - } - - @Override - public boolean isReplyRequired() { - return isReplyRequired; - } - - @Override - public String getId() { - return guid; - } - - @Override - public boolean isTopic() { - return true; - } -} diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/OteEnvironmentTrackerCustomizer.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/OteEnvironmentTrackerCustomizer.java deleted file mode 100644 index 6e4b4f6052b..00000000000 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/OteEnvironmentTrackerCustomizer.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.core.environment; - -import org.eclipse.osee.framework.messaging.EndpointReceive; -import org.eclipse.osee.framework.messaging.EndpointSend; -import org.eclipse.osee.framework.messaging.MessagingGateway; -import org.eclipse.osee.framework.messaging.id.ProtocolId; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTrackerCustomizer; - -/** - * @author Andrew M. Finkbeiner - */ -public class OteEnvironmentTrackerCustomizer implements ServiceTrackerCustomizer { - - private final EndpointReceive receive; - private final EndpointSend send; - private final BundleContext context; - private final ProtocolId protocolId; - - public OteEnvironmentTrackerCustomizer(BundleContext context, EndpointReceive receive, EndpointSend send, ProtocolId protocolId) { - this.context = context; - this.receive = receive; - this.send = send; - this.protocolId = protocolId; - } - - @Override - public Object addingService(ServiceReference reference) { - MessagingGateway gateway = (MessagingGateway) context.getService(reference); - gateway.bind(receive); - gateway.bind(send); - gateway.bindSendProtocol(protocolId, send); - return null; - } - - @Override - public void modifiedService(ServiceReference reference, Object service) { - } - - @Override - public void removedService(ServiceReference reference, Object service) { - MessagingGateway gateway = (MessagingGateway) context.getService(reference); - gateway.unbind(receive); - gateway.unbindSendProtocol(protocolId, send); - gateway.unbind(send); - } -} diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/OteServerSideEndpointSender.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/OteServerSideEndpointSender.java deleted file mode 100644 index 464316e6087..00000000000 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/OteServerSideEndpointSender.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.core.environment; - -import java.util.Properties; -import java.util.UUID; - -import org.eclipse.osee.framework.messaging.EndpointSend; -import org.eclipse.osee.framework.messaging.ExceptionHandler; -import org.eclipse.osee.framework.messaging.Message; -import org.eclipse.osee.framework.messaging.id.ProtocolId; -import org.eclipse.osee.framework.messaging.id.StringName; -import org.eclipse.osee.framework.messaging.id.StringNamespace; -import org.eclipse.osee.framework.messaging.id.StringProtocolId; -import org.eclipse.osee.ote.core.OTESessionManager; -import org.eclipse.osee.ote.core.ServiceUtility; - -/** - * @author Andrew M. Finkbeiner - */ -public class OteServerSideEndpointSender implements EndpointSend { - - public static final ProtocolId OTE_SERVER_SIDE_SEND_PROTOCOL = new StringProtocolId(new StringNamespace( - "org.eclipse.osee.ote.core.environment"), new StringName("OteServerSideEndpointSender")); - - private final TestEnvironment testEnvironment; - - public OteServerSideEndpointSender(TestEnvironment testEnvironment) { - this.testEnvironment = testEnvironment; - } - - @Override - public void send(Message message, ExceptionHandler exceptionHandler) { - try { - OTESessionManager sessionManager = ServiceUtility.getService(OTESessionManager.class); - for(UUID id:sessionManager.get()){ - sessionManager.get(id).sendMessageToClient(message); - } - } catch (Throwable th) { - exceptionHandler.handleException(th); - } - } - - @Override - public void start(Properties properties) { - } - -} diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/OteServerSideEndprointRecieve.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/OteServerSideEndprointRecieve.java deleted file mode 100644 index 4e5d1567532..00000000000 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/OteServerSideEndprointRecieve.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.core.environment; - -import java.util.Properties; -import org.eclipse.osee.framework.messaging.EndpointReceive; -import org.eclipse.osee.framework.messaging.Message; - -/** - * @author Andrew M. Finkbeiner - */ -public class OteServerSideEndprointRecieve extends EndpointReceive { - - @Override - public void start(Properties properties) { - } - - public void recievedMessage(Message message) { - onReceive(message); - } - - @Override - public void dispose() { - } - -} diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironment.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironment.java index 6ed89e0afce..2d68ba2228a 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironment.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironment.java @@ -15,7 +15,6 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.InetAddress; -import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.UnknownHostException; @@ -30,7 +29,6 @@ import java.util.List; import java.util.Set; import java.util.logging.Level; -import org.eclipse.core.runtime.Platform; import org.eclipse.osee.connection.service.IServiceConnector; import org.eclipse.osee.connection.service.LocalConnector; import org.eclipse.osee.framework.jdk.core.reportdata.ReportDataListener; @@ -38,9 +36,6 @@ import org.eclipse.osee.framework.jdk.core.util.EnhancedProperties; import org.eclipse.osee.framework.jdk.core.util.Lib; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.Message; -import org.eclipse.osee.framework.messaging.MessagingGateway; -import org.eclipse.osee.framework.messaging.NodeInfo; import org.eclipse.osee.ote.OseeLogStatusCallback; import org.eclipse.osee.ote.core.GCHelper; import org.eclipse.osee.ote.core.OseeTestThread; @@ -65,7 +60,6 @@ import org.eclipse.osee.ote.core.framework.command.ITestContext; import org.eclipse.osee.ote.core.framework.command.ITestServerCommand; import org.eclipse.osee.ote.core.internal.Activator; import org.eclipse.osee.ote.properties.OtePropertiesCore; -import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceRegistration; import org.osgi.util.tracker.ServiceTracker; @@ -98,21 +92,21 @@ public abstract class TestEnvironment implements TestEnvironmentInterface, ITest @Deprecated private final List<IScriptSetupEvent> scriptSetupListeners = new ArrayList<>(); - private OteServerSideEndprointRecieve oteServerSideEndpointRecieve; - private OteServerSideEndpointSender oteServerSideEndpointSender; - private final ServiceTracker messagingServiceTracker; +// private OteServerSideEndprointRecieve oteServerSideEndpointRecieve; +// private OteServerSideEndpointSender oteServerSideEndpointSender; +// private final ServiceTracker messagingServiceTracker; private volatile boolean isShutdown = false; - private NodeInfo oteEmbeddedBroker; +// private NodeInfo oteEmbeddedBroker; private ServiceRegistration<TestEnvironmentInterface> myRegistration; protected TestEnvironment(IEnvironmentFactory factory) { GCHelper.getGCHelper().addRefWatch(this); - try { - oteEmbeddedBroker = new NodeInfo("OTEEmbeddedBroker", new URI("vm://localhost?broker.persistent=false")); - } catch (URISyntaxException ex) { - OseeLog.log(TestEnvironment.class, Level.SEVERE, ex); - } +// try { +// oteEmbeddedBroker = new NodeInfo("OTEEmbeddedBroker", new URI("vm://localhost?broker.persistent=false")); +// } catch (URISyntaxException ex) { +// OseeLog.log(TestEnvironment.class, Level.SEVERE, ex); +// } this.factory = factory; this.testStation = factory.getTestStation(); this.runtimeManager = factory.getRuntimeManager(); @@ -121,7 +115,7 @@ public abstract class TestEnvironment implements TestEnvironmentInterface, ITest this.associatedObjects = new HashMap<>(100); this.batchMode = OteProperties.isOseeOteInBatchModeEnabled(); - messagingServiceTracker = setupOteMessagingSenderAndReceiver(); +// messagingServiceTracker = setupOteMessagingSenderAndReceiver(); } public void init(IServiceConnector connector) { @@ -141,18 +135,18 @@ public abstract class TestEnvironment implements TestEnvironmentInterface, ITest connector = new LocalConnector(this, Integer.toString(this.getUniqueId()), props); } - private ServiceTracker setupOteMessagingSenderAndReceiver() { - oteServerSideEndpointRecieve = new OteServerSideEndprointRecieve(); - oteServerSideEndpointSender = new OteServerSideEndpointSender(this); - BundleContext context = Platform.getBundle("org.eclipse.osee.ote.core").getBundleContext(); - return getServiceTracker(MessagingGateway.class.getName(), new OteEnvironmentTrackerCustomizer(context, - oteServerSideEndpointRecieve, oteServerSideEndpointSender, - OteServerSideEndpointSender.OTE_SERVER_SIDE_SEND_PROTOCOL)); - } - - public void sendMessageToServer(Message message) { - oteServerSideEndpointRecieve.recievedMessage(message); - } +// private ServiceTracker setupOteMessagingSenderAndReceiver() { +// oteServerSideEndpointRecieve = new OteServerSideEndprointRecieve(); +// oteServerSideEndpointSender = new OteServerSideEndpointSender(this); +// BundleContext context = Platform.getBundle("org.eclipse.osee.ote.core").getBundleContext(); +// return getServiceTracker(MessagingGateway.class.getName(), new OteEnvironmentTrackerCustomizer(context, +// oteServerSideEndpointRecieve, oteServerSideEndpointSender, +// OteServerSideEndpointSender.OTE_SERVER_SIDE_SEND_PROTOCOL)); +// } +// +// public void sendMessageToServer(Message message) { +// oteServerSideEndpointRecieve.recievedMessage(message); +// } public ServiceTracker getServiceTracker(String clazz, ServiceTrackerCustomizer customizer) { return Activator.getInstance().getServiceTracker(clazz, customizer); @@ -335,7 +329,7 @@ public abstract class TestEnvironment implements TestEnvironmentInterface, ITest this.associatedObjects.clear();// get rid of all models and support } - messagingServiceTracker.close(); +// messagingServiceTracker.close(); OseeLog.log(TestEnvironment.class, Level.FINE, "shutting down environment"); factory.getTimerControl().cancelTimers(); @@ -590,11 +584,11 @@ public abstract class TestEnvironment implements TestEnvironmentInterface, ITest getRunManager().abort(t, false); } - public void setOteNodeInfo(NodeInfo oteEmbeddedBroker) { - this.oteEmbeddedBroker = oteEmbeddedBroker; - } - - public NodeInfo getOteNodeInfo() { - return oteEmbeddedBroker; - } +// public void setOteNodeInfo(NodeInfo oteEmbeddedBroker) { +// this.oteEmbeddedBroker = oteEmbeddedBroker; +// } +// +// public NodeInfo getOteNodeInfo() { +// return oteEmbeddedBroker; +// } } diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/IHostTestEnvironment.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/IHostTestEnvironment.java index 69074b91a77..9faa3bd01cb 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/IHostTestEnvironment.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/IHostTestEnvironment.java @@ -15,7 +15,6 @@ import java.rmi.RemoteException; import java.util.UUID; import org.eclipse.osee.framework.jdk.core.util.EnhancedProperties; -import org.eclipse.osee.framework.messaging.NodeInfo; import org.eclipse.osee.ote.core.ConnectionRequestResult; import org.eclipse.osee.ote.core.IRemoteUserSession; import org.eclipse.osee.ote.core.environment.TestEnvironmentConfig; @@ -29,7 +28,7 @@ public interface IHostTestEnvironment extends Remote { ConnectionRequestResult requestEnvironment(IRemoteUserSession session, UUID id, TestEnvironmentConfig config) throws RemoteException; void disconnect(UUID sessionId) throws RemoteException; - public NodeInfo getBroker() throws RemoteException; +// public NodeInfo getBroker() throws RemoteException; public String getHttpURL() throws RemoteException; diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/ITestEnvironment.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/ITestEnvironment.java index c4886f71476..b20870af5be 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/ITestEnvironment.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/ITestEnvironment.java @@ -13,7 +13,6 @@ package org.eclipse.osee.ote.core.environment.interfaces; import java.rmi.Remote; import java.rmi.RemoteException; -import org.eclipse.osee.framework.messaging.Message; import org.eclipse.osee.ote.core.model.IModelManagerRemote; import org.eclipse.osee.ote.message.IInstrumentationRegistrationListener; @@ -35,7 +34,7 @@ public interface ITestEnvironment extends Remote { public void setBatchMode(boolean isBatched) throws RemoteException; - public void sendMessage(Message message) throws RemoteException; +// public void sendMessage(Message message) throws RemoteException; void addInstrumentationRegistrationListener(IInstrumentationRegistrationListener listener) throws RemoteException; diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointReceiveRunnable.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointReceiveRunnable.java index 61eb3a2a65e..514e276c438 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointReceiveRunnable.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointReceiveRunnable.java @@ -59,6 +59,8 @@ public class OteEndpointReceiveRunnable implements Runnable { channel.receive(buffer); buffer.flip(); processBuffer(buffer); + } catch(ClosedByInterruptException ex){ + stop(); } catch (Throwable th){ th.printStackTrace(); } diff --git a/plugins/org.eclipse.osee.ote.jms/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.jms/META-INF/MANIFEST.MF index 83236c6e0a5..140fea325aa 100644 --- a/plugins/org.eclipse.osee.ote.jms/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.ote.jms/META-INF/MANIFEST.MF @@ -10,7 +10,6 @@ Import-Package: org.eclipse.osee.connection.service, org.eclipse.osee.framework.jdk.core.type, org.eclipse.osee.framework.jdk.core.util;resolution:=optional, org.eclipse.osee.framework.logging, - org.eclipse.osee.framework.messaging, org.eclipse.osee.ote, org.eclipse.osee.ote.core, org.eclipse.osee.ote.core.environment, @@ -21,7 +20,6 @@ Import-Package: org.eclipse.osee.connection.service, org.eclipse.osee.ote.message.event, org.eclipse.osee.ote.service;resolution:=optional, org.osgi.service.event;version="1.3.0" -Export-Package: org.eclipse.osee.ote.jms Require-Bundle: org.eclipse.core.runtime Service-Component: OSGI-INF/*.xml Bundle-ActivationPolicy: lazy diff --git a/plugins/org.eclipse.osee.ote.jms/OSGI-INF/ClientSideConnectionNodeLifecycleController.xml b/plugins/org.eclipse.osee.ote.jms/OSGI-INF/ClientSideConnectionNodeLifecycleController.xml deleted file mode 100644 index 12952fd82f2..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/OSGI-INF/ClientSideConnectionNodeLifecycleController.xml +++ /dev/null @@ -1,15 +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.ote.jms.ClientSideConnectionNodeLifecycleController"> - <implementation class="org.eclipse.osee.ote.jms.internal.ClientSideConnectionNodeLifecycleController"/> - <reference bind="setClientService" - cardinality="1..1" - interface="org.eclipse.osee.ote.service.IOteClientService" - name="IOteClientService" - policy="dynamic"/> - <reference bind="setMessageService" - cardinality="1..1" - interface="org.eclipse.osee.framework.messaging.MessageService" - name="MessageService" - policy="dynamic"/> - <reference bind="bindOteUdpEndpoint" cardinality="1..1" interface="org.eclipse.osee.ote.endpoint.OteUdpEndpoint" name="OteUdpEndpoint" policy="dynamic"/> -</scr:component> diff --git a/plugins/org.eclipse.osee.ote.jms/OSGI-INF/EventToJmsComponent.xml b/plugins/org.eclipse.osee.ote.jms/OSGI-INF/EventToJmsComponent.xml deleted file mode 100644 index 0fbf31fcb2e..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/OSGI-INF/EventToJmsComponent.xml +++ /dev/null @@ -1,10 +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" immediate="true" name="org.eclpise.osee.ote.jms.EventToJms"> - <implementation class="org.eclipse.osee.ote.jms.bridge.EventToJmsComponent"/> - <property name="event.topics" type="String" value="ote/*"/> - <reference bind="bindConnectionNode" cardinality="0..1" interface="org.eclipse.osee.ote.jms.OteServerJmsNodeProvider" name="JmsConnectionNodeProvider" policy="dynamic" unbind="unbindConnectionNode"/> - <reference bind="bindEventAdmin" cardinality="1..1" interface="org.osgi.service.event.EventAdmin" name="EventAdmin" policy="static" unbind="unbindEventAdmin"/> - <service> - <provide interface="org.osgi.service.event.EventHandler"/> - </service> -</scr:component> diff --git a/plugins/org.eclipse.osee.ote.jms/OSGI-INF/ServerSideConnectionNodeProvider.xml b/plugins/org.eclipse.osee.ote.jms/OSGI-INF/ServerSideConnectionNodeProvider.xml deleted file mode 100644 index cfdc3ca1111..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/OSGI-INF/ServerSideConnectionNodeProvider.xml +++ /dev/null @@ -1,17 +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" immediate="true" name="org.eclipse.osee.ote.jms.ServerSideConnectionNodeProvider"> - <implementation class="org.eclipse.osee.ote.jms.internal.ServerSideConnectionNodeProviderImpl"/> - <reference bind="setTestEnvironmentInterface" - cardinality="1..1" - interface="org.eclipse.osee.ote.core.environment.TestEnvironmentInterface" - name="TestEnvironmentInterface" - policy="static" - unbind="unsetTestEnvironmentInterface"/> - <reference - cardinality="1..1" - interface="org.eclipse.osee.framework.messaging.MessageService" - name="MessageService" - policy="static" - bind="setMessageService" - unbind="unsetMessageService"/> -</scr:component> diff --git a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/OteConnectedEndpointNodeProvider.java b/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/OteConnectedEndpointNodeProvider.java deleted file mode 100644 index 2b41a7ba7a1..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/OteConnectedEndpointNodeProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.jms; - -import org.eclipse.osee.framework.messaging.ConnectionNode; - -public interface OteConnectedEndpointNodeProvider { - ConnectionNode getConnectionNode(); -} diff --git a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/OteServerJmsNodeProvider.java b/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/OteServerJmsNodeProvider.java deleted file mode 100644 index f68c89826b1..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/OteServerJmsNodeProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.jms; - -import org.eclipse.osee.framework.messaging.ConnectionNode; - -public interface OteServerJmsNodeProvider { - ConnectionNode getConnectionNode(); -} diff --git a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/bridge/BridgeMessages.java b/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/bridge/BridgeMessages.java deleted file mode 100644 index fcb4ff1984a..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/bridge/BridgeMessages.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.jms.bridge; - -import org.eclipse.osee.framework.messaging.MessageID; - - -public enum BridgeMessages implements MessageID { - - BYTE_MESSAGE("OTE_EVENT_MESSAGE"); - - private String id; - - BridgeMessages(String id){ - this.id = id; - } - - @Override - public Class<?> getSerializationClass() { - return null; - } - - @Override - public boolean isReplyRequired() { - return false; - } - - @Override - public boolean isTopic() { - return true; - } - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return id; - } - -} 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 deleted file mode 100644 index 7e629e90f7a..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/bridge/EventToJmsComponent.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.jms.bridge; - -import java.util.HashMap; -import java.util.List; -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; -import org.eclipse.osee.framework.messaging.ReplyConnection; -import org.eclipse.osee.ote.jms.OteServerJmsNodeProvider; -import org.eclipse.osee.ote.message.event.OteEventMessage; -import org.eclipse.osee.ote.message.event.OteEventMessageUtil; -import org.osgi.service.event.Event; -import org.osgi.service.event.EventAdmin; -import org.osgi.service.event.EventHandler; - -public class EventToJmsComponent extends OseeMessagingListener implements EventHandler { - - private OteServerJmsNodeProvider connecitonNode; - private EventAdmin eventAdmin; - private final List<Event> eventQueue; - private final UUID MYID; - - public EventToJmsComponent(){ - eventQueue = new CopyOnWriteArrayList<>(); - MYID = UUID.randomUUID(); - } - - public void start(){ - - } - - public void stop(){ - - } - - public synchronized void bindConnectionNode(OteServerJmsNodeProvider connectionNode){ - this.connecitonNode = connectionNode; - connecitonNode.getConnectionNode().subscribe(BridgeMessages.BYTE_MESSAGE, this); - for(Event event:eventQueue){ - sendEvent(event); - } - eventQueue.clear(); - } - - public synchronized void unbindConnectionNode(OteServerJmsNodeProvider connectionNode){ - connecitonNode.getConnectionNode().unsubscribe(BridgeMessages.BYTE_MESSAGE, this); - this.connecitonNode = null; - } - - public void bindEventAdmin(EventAdmin eventAdmin){ - this.eventAdmin = eventAdmin; - } - - public void unbindEventAdmin(EventAdmin eventAdmin){ - this.eventAdmin = null; - } - - @Override - public synchronized void handleEvent(Event event) { - if(connecitonNode != null){ - sendEvent(event); - } else { - eventQueue.add(event); - } - } - - private void sendEvent(Event event){ - OteEventMessage message = OteEventMessageUtil.getOteEventMessage(event); - if(message != null){ - try { - UUID id = OteEventMessageUtil.getUUID(message); - if(!id.equals(MYID)){ - OteEventMessageUtil.setUUID(message, MYID); - connecitonNode.getConnectionNode().send(BridgeMessages.BYTE_MESSAGE, message.getData()); - } - } catch (OseeCoreException e) { - e.printStackTrace(); - } - } - } - - @Override - public void process(Object message, Map<String, Object> headers, ReplyConnection replyConnection) { - if(message instanceof byte[]){ - OteEventMessage msg = new OteEventMessage((byte[])message); - UUID id = OteEventMessageUtil.getUUID(msg); - if(!id.equals(MYID)){ - OteEventMessageUtil.setUUID(msg, MYID); - Map<String, Object> data = new HashMap<>(); - data.put(OteEventMessageUtil.BYTE_KEY, msg.getData()); - Event newevent = new Event(msg.getHeader().TOPIC.getValue(), data); - eventAdmin.sendEvent(newevent); - } - } else { - OseeLog.log(EventToJmsComponent.class, Level.SEVERE, "not a recognized message" + message.getClass()); - } - } -} diff --git a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/internal/ClientSideConnectionNodeLifecycleController.java b/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/internal/ClientSideConnectionNodeLifecycleController.java deleted file mode 100644 index a814f830b79..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/internal/ClientSideConnectionNodeLifecycleController.java +++ /dev/null @@ -1,186 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.jms.internal; - -import java.io.Serializable; -import java.net.InetSocketAddress; -import java.util.Map.Entry; -import java.util.logging.Level; - -import org.eclipse.osee.connection.service.IServiceConnector; -import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; -import org.eclipse.osee.framework.jdk.core.util.EnhancedProperties; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.ConnectionNode; -import org.eclipse.osee.framework.messaging.MessageService; -import org.eclipse.osee.framework.messaging.NodeInfo; -import org.eclipse.osee.ote.OTEException; -import org.eclipse.osee.ote.endpoint.OteEndpointUtil; -import org.eclipse.osee.ote.endpoint.OteUdpEndpoint; -import org.eclipse.osee.ote.endpoint.OteUdpEndpointSender; -import org.eclipse.osee.ote.jms.OteServerJmsNodeProvider; -import org.eclipse.osee.ote.service.ConnectionEvent; -import org.eclipse.osee.ote.service.IOteClientService; -import org.eclipse.osee.ote.service.ITestConnectionListener; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - - - -/** - * @author Michael P. Masterson - */ -public final class ClientSideConnectionNodeLifecycleController implements ITestConnectionListener { - - private MessageService messageService; - private IOteClientService clientService; - private BundleContext context; - private ServiceRegistration<?> registration; - private OteUdpEndpointSender oteEndpointSender; - private OteUdpEndpoint oteEndpoint; - - public void start(BundleContext context) { - this.context = context; - clientService.addConnectionListener(this); - - } - - public void stop() { - clientService.removeConnectionListener(this); - unregisterConnectionNode(); - this.messageService = null; - this.clientService = null; - this.context = null; - - } - - public void setMessageService(MessageService messageService) { - this.messageService = messageService; - } - - public void setClientService(IOteClientService clientService) { - this.clientService = clientService; - } - - public void bindOteUdpEndpoint(OteUdpEndpoint oteEndpoint) { - this.oteEndpoint = oteEndpoint; - } - - @Override - public void onPostConnect(ConnectionEvent event) { - if (context == null) { - OseeLog.log(getClass(), Level.SEVERE, "Received a onPostConnect event with a null context."); - return; - } - IServiceConnector connector = event.getConnector(); - registerConnectionNode(connector); - } - - /** - * @param connector - */ - private void registerConnectionNode(IServiceConnector connector) { - Object obj = connector.getProperty("oteUdpEndpoint", null); - if (obj != null) { - try{ - InetSocketAddress address = OteEndpointUtil.getAddress(obj.toString()); - if(!oteEndpoint.getLocalEndpoint().equals(address)){ - oteEndpointSender = oteEndpoint.getOteEndpointSender(address); - oteEndpoint.addBroadcast(oteEndpointSender); - } - } catch (OTEException ex){ - OseeLog.log(getClass(), Level.SEVERE, ex); - } - } else { - obj = connector.getProperty("OTEEmbeddedBroker", null); - if (obj != null && obj instanceof NodeInfo) { - debug("Registering client connection service"); - NodeInfo nodeInfo = (NodeInfo) obj; - registerConnectionNode(nodeInfo); - } else { - debug(String.format("Problem using connector...%s:%s", obj.getClass(), obj)); - EnhancedProperties properties = connector.getProperties(); - for( Entry<String, Serializable> entry : properties.entrySet() ) { - debug(String.format("\t%s = %s", entry.getKey(), entry.getValue())); - } - } - } - } - - /** - * @param nodeInfo - */ - private void registerConnectionNode(NodeInfo nodeInfo) { - try { - ConnectionNode node = messageService.get(nodeInfo); - registration = - context.registerService(OteServerJmsNodeProvider.class.getName(), new ClientSideConnectionNodeProviderImpl(node), null); - } catch (OseeCoreException ex) { - OseeLog.log(getClass(), Level.SEVERE, ex); - } - } - - @Override - public void onConnectionLost(IServiceConnector connector) { - Object obj = connector.getProperty("oteUdpEndpoint", null); - if (obj != null) { - try{ - InetSocketAddress address = OteEndpointUtil.getAddress(obj.toString()); - if(!oteEndpoint.getLocalEndpoint().equals(address)){ - oteEndpointSender = oteEndpoint.getOteEndpointSender(address); - oteEndpoint.removeBroadcast(oteEndpointSender); - oteEndpointSender.stop(); - } - } catch (OTEException ex){ - OseeLog.log(getClass(), Level.SEVERE, ex); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } else { - unregisterConnectionNode(); - } - } - - - - private void unregisterConnectionNode() { - if (registration != null) { - registration.unregister(); - registration = null; - } - } - - @Override - public void onPreDisconnect(ConnectionEvent event) { - Object obj = event.getConnector().getProperty("oteUdpEndpoint", null); - if (obj != null) { - try{ - InetSocketAddress address = OteEndpointUtil.getAddress(obj.toString()); - if(!oteEndpoint.getLocalEndpoint().equals(address)){ - oteEndpointSender = oteEndpoint.getOteEndpointSender(address); - oteEndpoint.removeBroadcast(oteEndpointSender); - oteEndpointSender.stop(); - } - } catch (OTEException ex){ - OseeLog.log(getClass(), Level.SEVERE, ex); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } else { - unregisterConnectionNode(); - } - } - - private void debug(String msg ) { - if( System.getProperty("ote.jms.node.debug") != null ) - System.out.println(msg); - } -} diff --git a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/internal/ClientSideConnectionNodeProviderImpl.java b/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/internal/ClientSideConnectionNodeProviderImpl.java deleted file mode 100644 index 8535a5e8bf9..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/internal/ClientSideConnectionNodeProviderImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.jms.internal; - -import org.eclipse.osee.framework.messaging.ConnectionNode; -import org.eclipse.osee.ote.jms.OteServerJmsNodeProvider; - - -public final class ClientSideConnectionNodeProviderImpl implements OteServerJmsNodeProvider{ - - private final ConnectionNode node; - - ClientSideConnectionNodeProviderImpl(ConnectionNode node) { - this.node = node; - } - - @Override - public ConnectionNode getConnectionNode() { - return node; - } -} diff --git a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/internal/ServerSideConnectionNodeProviderImpl.java b/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/internal/ServerSideConnectionNodeProviderImpl.java deleted file mode 100644 index fcc7953f4df..00000000000 --- a/plugins/org.eclipse.osee.ote.jms/src/org/eclipse/osee/ote/jms/internal/ServerSideConnectionNodeProviderImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.jms.internal; - -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.ConnectionNode; -import org.eclipse.osee.framework.messaging.MessageService; -import org.eclipse.osee.framework.messaging.NodeInfo; -import org.eclipse.osee.ote.core.environment.TestEnvironment; -import org.eclipse.osee.ote.core.environment.TestEnvironmentInterface; -import org.eclipse.osee.ote.jms.OteServerJmsNodeProvider; - - - -/** - * @author Michael P. Masterson - */ -public final class ServerSideConnectionNodeProviderImpl implements OteServerJmsNodeProvider { - private TestEnvironmentInterface testEnv; - private MessageService messageService; - - private static OteServerJmsNodeProvider instance; - - public void start() { - instance = this; - } - - public void stop() { - } - - public synchronized void setTestEnvironmentInterface(TestEnvironmentInterface testEnv) { - this.testEnv = testEnv; - } - - public synchronized void unsetTestEnvironmentInterface(TestEnvironmentInterface testEnv) { - this.testEnv = null; - } - - public synchronized void setMessageService(MessageService messageService) { - this.messageService = messageService; - } - - public synchronized void unsetMessageService(MessageService messageService) { - this.messageService = null; - } - - public static OteServerJmsNodeProvider getInstance() { - return instance; - } - - @Override - public synchronized ConnectionNode getConnectionNode() { - if (testEnv instanceof TestEnvironment) { - NodeInfo info = ((TestEnvironment) testEnv).getOteNodeInfo(); - try { - ConnectionNode connection = messageService.get(info); - return connection; - } catch (OseeCoreException ex) { - OseeLog.log(this.getClass(), Level.SEVERE, ex); - } - } - - return null; - } -} diff --git a/plugins/org.eclipse.osee.ote.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.server/META-INF/MANIFEST.MF index cbeb8ce44eb..f37dfe72f64 100644 --- a/plugins/org.eclipse.osee.ote.server/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.ote.server/META-INF/MANIFEST.MF @@ -17,9 +17,6 @@ Import-Package: org.apache.felix.service.command;status=provisional;version="0.8 org.eclipse.osee.framework.jdk.core.util.io.streams, org.eclipse.osee.framework.jdk.core.util.network, org.eclipse.osee.framework.logging, - org.eclipse.osee.framework.messaging, - org.eclipse.osee.framework.messaging.services, - org.eclipse.osee.framework.messaging.services.messages, org.eclipse.osee.framework.plugin.core.util, org.eclipse.osee.ote, org.eclipse.osee.ote.connection.jini, 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 b0aa234d71d..3f3f55a6d09 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,9 +5,7 @@ <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="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"/> <reference bind="bindOTESessionManager" cardinality="1..1" interface="org.eclipse.osee.ote.core.OTESessionManager" name="OTESessionManager" policy="static" unbind="unbindOTESessionManager"/> <reference bind="bindOTEMasterServer" cardinality="1..1" interface="org.eclipse.osee.ote.master.rest.client.OTEMasterServer" name="OTEMasterServer" policy="static" unbind="unbindOTEMasterServer"/> <reference bind="bindOteUdpEndpoint" cardinality="1..1" interface="org.eclipse.osee.ote.endpoint.OteUdpEndpoint" name="OteUdpEndpoint" policy="static" unbind="unbindOteUdpEndpoint"/> diff --git a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/RemoteShell.java b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/RemoteShell.java index d5a59201e9a..4868832523a 100644 --- a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/RemoteShell.java +++ b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/RemoteShell.java @@ -20,7 +20,7 @@ import org.eclipse.osee.ote.core.environment.interfaces.IRemoteCommandConsole; */ public class RemoteShell extends ConsoleShell implements IRemoteCommandConsole { - private static final long serialVersionUID = -4931966494670170915L; +// private static final long serialVersionUID = -4931966494670170915L; private final StringBuffer buffer = new StringBuffer(32000); @Override diff --git a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/EnvironmentCreationParameter.java b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/EnvironmentCreationParameter.java index 62b2d23ab83..b4a7fca6605 100644 --- a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/EnvironmentCreationParameter.java +++ b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/EnvironmentCreationParameter.java @@ -14,7 +14,6 @@ import java.io.Serializable; import java.rmi.server.ExportException; import org.eclipse.osee.connection.service.IServiceConnector; -import org.eclipse.osee.framework.messaging.NodeInfo; import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; import org.eclipse.osee.ote.core.environment.interfaces.IRuntimeLibraryManager; import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment; @@ -26,7 +25,7 @@ import org.eclipse.osee.ote.server.TestEnvironmentFactory; * @author Andrew M. Finkbeiner */ class EnvironmentCreationParameter { - private final NodeInfo oteEmbeddedBroker; +// private final NodeInfo oteEmbeddedBroker; private final IServiceConnector serviceConnector; private final ITestEnvironmentServiceConfig config; private final IRuntimeLibraryManager runtimeLibraryManager; @@ -35,8 +34,8 @@ class EnvironmentCreationParameter { private TestEnvironmentFactory factory; private final String environmentFactoryClass; - public EnvironmentCreationParameter(IRuntimeLibraryManager runtimeLibraryManager, NodeInfo oteEmbeddedBroker, IServiceConnector serviceConnector, ITestEnvironmentServiceConfig config, TestEnvironmentFactory factory, String environmentFactoryClass) { - this.oteEmbeddedBroker = oteEmbeddedBroker; + public EnvironmentCreationParameter(IRuntimeLibraryManager runtimeLibraryManager,/* NodeInfo oteEmbeddedBroker,*/ IServiceConnector serviceConnector, ITestEnvironmentServiceConfig config, TestEnvironmentFactory factory, String environmentFactoryClass) { +// this.oteEmbeddedBroker = oteEmbeddedBroker; this.serviceConnector = serviceConnector; this.config = config; this.runtimeLibraryManager = runtimeLibraryManager; @@ -45,9 +44,9 @@ class EnvironmentCreationParameter { } - public NodeInfo getBroker(){ - return oteEmbeddedBroker; - } +// public NodeInfo getBroker(){ +// return oteEmbeddedBroker; +// } public Serializable getServerTitle() { return config.getServerTitle(); @@ -69,7 +68,7 @@ class EnvironmentCreationParameter { factory = clazz.newInstance(); } MessageSystemTestEnvironment testEnvironment = factory.createEnvironment(runtimeLibraryManager); - testEnvironment.setOteNodeInfo(oteEmbeddedBroker); + // testEnvironment.setOteNodeInfo(oteEmbeddedBroker); testEnvironment.init(serviceConnector); return testEnvironment; } diff --git a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/OteService.java b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/OteService.java index adc9eafc412..a690e03441b 100644 --- a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/OteService.java +++ b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/OteService.java @@ -26,8 +26,6 @@ import net.jini.id.UuidFactory; import org.eclipse.osee.framework.jdk.core.util.EnhancedProperties; import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.NodeInfo; -import org.eclipse.osee.framework.messaging.services.RegisteredServiceReference; import org.eclipse.osee.ote.HostServerProperties; import org.eclipse.osee.ote.core.ConnectionRequestResult; import org.eclipse.osee.ote.core.IRemoteUserSession; @@ -38,7 +36,6 @@ import org.eclipse.osee.ote.core.ReturnStatus; import org.eclipse.osee.ote.core.ServiceUtility; import org.eclipse.osee.ote.core.environment.TestEnvironmentConfig; import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment; -import org.eclipse.osee.ote.core.environment.interfaces.IRuntimeLibraryManager; import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment; import org.eclipse.osee.ote.endpoint.OteUdpEndpoint; import org.eclipse.osee.ote.io.OTEServerFolder; @@ -53,13 +50,13 @@ public class OteService implements IHostTestEnvironment { private MessageSystemTestEnvironment currentEnvironment; private ITestEnvironment remoteEnvironment; private final EnvironmentCreationParameter environmentCreation; - private final IRuntimeLibraryManager runtimeLibraryManager; - private RegisteredServiceReference registeredServiceReference; +// private final IRuntimeLibraryManager runtimeLibraryManager; +// private RegisteredServiceReference registeredServiceReference; private OTESessionManager oteSessions; - public OteService(IRuntimeLibraryManager runtimeLibraryManager, EnvironmentCreationParameter environmentCreation, OTESessionManager oteSessions, PropertyParamter parameterObject, EnhancedProperties properties, OteUdpEndpoint receiver) { - this.runtimeLibraryManager = runtimeLibraryManager; + public OteService(EnvironmentCreationParameter environmentCreation, OTESessionManager oteSessions, PropertyParamter parameterObject, EnhancedProperties properties, OteUdpEndpoint receiver) { +// this.runtimeLibraryManager = runtimeLibraryManager; this.environmentCreation = environmentCreation; this.oteSessions = oteSessions; @@ -79,7 +76,7 @@ public class OteService implements IHostTestEnvironment { enhancedProperties.setProperty(HostServerProperties.group.name(), "OSEE Test Environment"); enhancedProperties.setProperty(HostServerProperties.owner.name(), OtePropertiesCore.userName.getValue()); enhancedProperties.setProperty(HostServerProperties.id.name(), serviceID.toString()); - enhancedProperties.setProperty(HostServerProperties.activeMq.name(), environmentCreation.getBroker().getUri().toString()); +// enhancedProperties.setProperty(HostServerProperties.activeMq.name(), environmentCreation.getBroker().getUri().toString()); try { String format = String.format("tcp://%s:%d", receiver.getLocalEndpoint().getAddress().getHostAddress(), receiver.getLocalEndpoint().getPort()); if(OtePropertiesCore.httpPort.getValue() == null){ @@ -111,10 +108,10 @@ public class OteService implements IHostTestEnvironment { } } - @Override - public NodeInfo getBroker(){ - return environmentCreation.getBroker(); - } +// @Override +// public NodeInfo getBroker(){ +// return environmentCreation.getBroker(); +// } @Override public EnhancedProperties getProperties() throws RemoteException { @@ -173,9 +170,9 @@ public class OteService implements IHostTestEnvironment { } else { environmentCreation.getServiceConnector().setProperty("user_list", "N/A"); } - if (registeredServiceReference != null) { - registeredServiceReference.update(); - } +// if (registeredServiceReference != null) { +// registeredServiceReference.update(); +// } } public ServiceID getServiceID() throws RemoteException { @@ -188,9 +185,9 @@ public class OteService implements IHostTestEnvironment { } } - public void set(RegisteredServiceReference ref) { - this.registeredServiceReference = ref; - } +// public void set(RegisteredServiceReference ref) { +// this.registeredServiceReference = ref; +// } @Override public void disconnect(UUID sessionId) throws RemoteException { 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 26d6aac8be2..015ee6599b1 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 @@ -10,20 +10,10 @@ *******************************************************************************/ package org.eclipse.osee.ote.server.internal; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.io.Serializable; import java.net.HttpURLConnection; -import java.net.Inet6Address; -import java.net.InetAddress; import java.net.URI; import java.net.UnknownHostException; -import java.rmi.RemoteException; import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -37,20 +27,9 @@ import java.util.logging.Level; import org.apache.activemq.broker.BrokerService; import org.eclipse.osee.connection.service.IConnectionService; import org.eclipse.osee.connection.service.IServiceConnector; -import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.jdk.core.type.OseeStateException; -import org.eclipse.osee.framework.jdk.core.util.network.PortUtil; import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.MessageService; -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.ServiceInfoPopulator; -import org.eclipse.osee.framework.messaging.services.messages.ServiceDescriptionPair; -import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; import org.eclipse.osee.ote.core.OTESessionManager; -import org.eclipse.osee.ote.core.OteBaseMessages; import org.eclipse.osee.ote.core.ServiceUtility; import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment; import org.eclipse.osee.ote.core.environment.interfaces.IRuntimeLibraryManager; @@ -64,21 +43,20 @@ import org.eclipse.osee.ote.server.OteServiceStarter; import org.eclipse.osee.ote.server.PropertyParamter; import org.eclipse.osee.ote.server.TestEnvironmentFactory; import org.osgi.framework.FrameworkUtil; -import org.osgi.service.packageadmin.PackageAdmin; /** * @author Andrew M. Finkbeiner */ -public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopulator, OseeMessagingStatusCallback { +public class OteServiceStarterImpl implements OteServiceStarter { - private PackageAdmin packageAdmin; +// private PackageAdmin packageAdmin; private IRuntimeLibraryManager runtimeLibraryManager; private IConnectionService connectionService; - private MessageService messageService; +// private MessageService messageService; private BrokerService brokerService; private OteService service; - private final ListenForHostRequest listenForHostRequest; +// private final ListenForHostRequest listenForHostRequest; private IServiceConnector serviceSideConnector; private OTESessionManager oteSessions; @@ -89,13 +67,13 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu private ScheduledFuture<?> taskToCancel; private LookupRegistration lookupRegistration; private URI masterURI; - private NodeInfo nodeInfo; - private int brokerPort = 0; +// private NodeInfo nodeInfo; +// private int brokerPort = 0; private OteUdpEndpoint receiver; - private boolean ENABLE_BROKER; +// private boolean ENABLE_BROKER; public OteServiceStarterImpl() { - listenForHostRequest = new ListenForHostRequest(); +// listenForHostRequest = new ListenForHostRequest(); executor = Executors.newSingleThreadScheduledExecutor(new ThreadFactory(){ @Override @@ -125,13 +103,13 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu this.runtimeLibraryManager = null; } - public void bindMessageService(MessageService messageService){ - this.messageService = messageService; - } - - public void unbindMessageService(MessageService messageService){ - this.messageService = null; - } +// public void bindMessageService(MessageService messageService){ +// this.messageService = messageService; +// } +// +// public void unbindMessageService(MessageService messageService){ +// this.messageService = null; +// } public void bindIConnectionService(IConnectionService connectionService){ this.connectionService = connectionService; @@ -149,13 +127,13 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu this.masterServer = null; } - public void bindPackageAdmin(PackageAdmin packageAdmin){ - this.packageAdmin = packageAdmin; - } - - public void unbindPackageAdmin(PackageAdmin packageAdmin){ - this.packageAdmin = null; - } +// public void bindPackageAdmin(PackageAdmin packageAdmin){ +// this.packageAdmin = packageAdmin; +// } +// +// public void unbindPackageAdmin(PackageAdmin packageAdmin){ +// this.packageAdmin = null; +// } public void bindOteUdpEndpoint(OteUdpEndpoint receiver){ this.receiver = receiver; @@ -180,52 +158,52 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu throw new OseeStateException("An ote Server has already been started."); } this.serviceSideConnector = serviceSideConnector; - ENABLE_BROKER = Boolean.parseBoolean(System.getProperty("ote.enable.broker", "true")); - if(ENABLE_BROKER){ - brokerService = new BrokerService(); - - String strUri; - try { - String addressAsString = getAddress(); - if(brokerPort <= 0){ - brokerPort = getServerPort(); - } - strUri = String.format("tcp://%s:%d", addressAsString, brokerPort); - try { - brokerService.addConnector(strUri); - OseeLog.log(getClass(), Level.FINE, "Added TCP connector: " + strUri); - } catch (Exception e) { - OseeLog.log(getClass(), Level.SEVERE, "could not add connector for " + strUri, e); - strUri = "vm://localhost?broker.persistent=false"; - } - } catch (Exception e) { - OseeLog.log(getClass(), Level.SEVERE, "could acquire a TCP address", e); - strUri = "vm://localhost?broker.persistent=false"; - } - //necessary for rmi/jini classloading - Thread.currentThread().setContextClassLoader(ExportClassLoader.getInstance()); - - brokerService.setEnableStatistics(false); - brokerService.setBrokerName("OTEServer"); - brokerService.setPersistent(false); - brokerService.setUseJmx(false); - brokerService.start(); - URI uri = new URI(strUri); - - nodeInfo = new NodeInfo("OTEEmbeddedBroker", uri); - } else { - URI uri = new URI(String.format("tcp://%s:%d", "nohost", 0)); - nodeInfo = new NodeInfo("OTEEmbeddedBroker", uri); - } +// ENABLE_BROKER = Boolean.parseBoolean(System.getProperty("ote.enable.broker", "true")); +// if(ENABLE_BROKER){ +//// brokerService = new BrokerService(); +// +// String strUri; +// try { +// String addressAsString = getAddress(); +// if(brokerPort <= 0){ +// brokerPort = getServerPort(); +// } +// strUri = String.format("tcp://%s:%d", addressAsString, brokerPort); +// try { +// brokerService.addConnector(strUri); +// OseeLog.log(getClass(), Level.INFO, "Added TCP connector: " + strUri); +// } catch (Exception e) { +// OseeLog.log(getClass(), Level.SEVERE, "could not add connector for " + strUri, e); +// strUri = "vm://localhost?broker.persistent=false"; +// } +// } catch (Exception e) { +// OseeLog.log(getClass(), Level.SEVERE, "could acquire a TCP address", e); +// strUri = "vm://localhost?broker.persistent=false"; +// } +// //necessary for rmi/jini classloading +// Thread.currentThread().setContextClassLoader(ExportClassLoader.getInstance()); +// +// brokerService.setEnableStatistics(false); +// brokerService.setBrokerName("OTEServer"); +// brokerService.setPersistent(false); +// brokerService.setUseJmx(false); +// brokerService.start(); +// URI uri = new URI(strUri); +// +//// nodeInfo = new NodeInfo("OTEEmbeddedBroker", uri); +// } else { +//// URI uri = new URI(String.format("tcp://%s:%d", "nohost", 0)); +//// nodeInfo = new NodeInfo("OTEEmbeddedBroker", uri); +// } OteUdpEndpoint oteEndpoint = ServiceUtility.getService(OteUdpEndpoint.class); System.out.printf("SERVER CONNECTION URI[\n\ttcp://%s:%d\n]\n", oteEndpoint.getLocalEndpoint().getAddress().getHostAddress(), oteEndpoint.getLocalEndpoint().getPort()); EnvironmentCreationParameter environmentCreationParameter = - new EnvironmentCreationParameter(runtimeLibraryManager, nodeInfo, serviceSideConnector, config, factory, + new EnvironmentCreationParameter(runtimeLibraryManager, serviceSideConnector, config, factory, environmentFactoryClass); service = - new OteService(runtimeLibraryManager, environmentCreationParameter, oteSessions, propertyParameter, + new OteService(environmentCreationParameter, oteSessions, propertyParameter, serviceSideConnector.getProperties(), receiver); serviceSideConnector.init(service); @@ -240,7 +218,7 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu if(masterURIStr != null){ try{ masterURI = new URI(masterURIStr); - oteServerEntry = createOTEServer(nodeInfo, environmentCreationParameter, propertyParameter, service.getServiceID().toString()); + oteServerEntry = createOTEServer(environmentCreationParameter, propertyParameter, service.getServiceID().toString()); lookupRegistration = new LookupRegistration(masterURI, masterServer, oteServerEntry, service); taskToCancel = executor.scheduleWithFixedDelay(lookupRegistration, 0, 30, TimeUnit.SECONDS); } catch(Throwable th){ @@ -251,7 +229,7 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu } } else { - serviceSideConnector.setProperty("OTEEmbeddedBroker", nodeInfo); +// serviceSideConnector.setProperty("OTEEmbeddedBroker", nodeInfo); } FrameworkUtil.getBundle(getClass()).getBundleContext().registerService(IHostTestEnvironment.class, service, null); @@ -260,7 +238,7 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu return service; } - private OTEServer createOTEServer(NodeInfo nodeInfo, EnvironmentCreationParameter environmentCreationParameter, PropertyParamter propertyParameter, String uuid) throws NumberFormatException, UnknownHostException{ + private OTEServer createOTEServer(EnvironmentCreationParameter environmentCreationParameter, PropertyParamter propertyParameter, String uuid) throws NumberFormatException, UnknownHostException{ OTEServer server = new OTEServer(); server.setName(environmentCreationParameter.getServerTitle().toString()); server.setStation(propertyParameter.getStation()); @@ -271,36 +249,36 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu server.setOwner(OtePropertiesCore.userName.getValue()); server.setUUID(uuid); server.setOteRestServer(String.format("tcp://%s:%d", receiver.getLocalEndpoint().getAddress().getHostAddress(), receiver.getLocalEndpoint().getPort())); - server.setOteActivemqServer(nodeInfo.getUri().toString()); + server.setOteActivemqServer(String.format("tcp://%s:%d", receiver.getLocalEndpoint().getAddress().getHostAddress(), receiver.getLocalEndpoint().getPort())); return server; } - private int getServerPort() throws IOException { - String portFromLaunch = OtePropertiesCore.brokerUriPort.getValue(); - int port = 0; - if (portFromLaunch != null) { - try { - port = Integer.parseInt(portFromLaunch); - } catch (NumberFormatException ex) { - } - } - if (port == 0) { - port = PortUtil.getInstance().getValidPort(); - } - return port; - } +// private int getServerPort() throws IOException { +// String portFromLaunch = OtePropertiesCore.brokerUriPort.getValue(); +// int port = 0; +// if (portFromLaunch != null) { +// try { +// port = Integer.parseInt(portFromLaunch); +// } catch (NumberFormatException ex) { +// } +// } +// if (port == 0) { +// port = PortUtil.getInstance().getValidPort(); +// } +// return port; +// } @Override public void stop() { - if(messageService != null && nodeInfo != null && service != null){ - try { - messageService.get(nodeInfo).send(OteBaseMessages.OteHostShutdown, service.getServiceID().toString()); - } catch (OseeCoreException e) { - OseeLog.log(getClass(), Level.SEVERE, e); - } catch (RemoteException e) { - OseeLog.log(getClass(), Level.SEVERE, e); - } - } +// if(messageService != null && nodeInfo != null && service != null){ +// try { +// messageService.get(nodeInfo).send(OteBaseMessages.OteHostShutdown, service.getServiceID().toString()); +// } catch (OseeCoreException e) { +// OseeLog.log(getClass(), Level.SEVERE, e); +// } catch (RemoteException e) { +// OseeLog.log(getClass(), Level.SEVERE, e); +// } +// } if (service != null) { try { service.updateDynamicInfo(); @@ -345,63 +323,63 @@ public class OteServiceStarterImpl implements OteServiceStarter, ServiceInfoPopu brokerService = null; } - private String getAddress() throws UnknownHostException { - InetAddress[] all = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName()); - String defaultAddress = all[0].getHostAddress(); - for (InetAddress address : all ) { - if(!address.isSiteLocalAddress()) - { - String firstRealLocalAddress = address.getHostAddress(); - if (address instanceof Inet6Address) { - firstRealLocalAddress = "[" + firstRealLocalAddress + "]"; - } - return firstRealLocalAddress; - } - } - return defaultAddress; - } - - private class ListenForHostRequest extends OseeMessagingListener { - - @Override - public void process(Object message, Map<String, Object> headers, ReplyConnection replyConnection) { - if (replyConnection.isReplyRequested()) { - try { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(message); - oos.writeObject(serviceSideConnector.getService()); - replyConnection.send(baos.toByteArray(), null, OteServiceStarterImpl.this); - } catch (OseeCoreException ex) { - OseeLog.log(getClass(), Level.SEVERE, ex); - } catch (IOException ex) { - OseeLog.log(getClass(), Level.SEVERE, ex); - } - } - } - } +// private String getAddress() throws UnknownHostException { +// InetAddress[] all = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName()); +// String defaultAddress = all[0].getHostAddress(); +// for (InetAddress address : all ) { +// if(!address.isSiteLocalAddress()) +// { +// String firstRealLocalAddress = address.getHostAddress(); +// if (address instanceof Inet6Address) { +// firstRealLocalAddress = "[" + firstRealLocalAddress + "]"; +// } +// return firstRealLocalAddress; +// } +// } +// return defaultAddress; +// } - @Override - public void updateServiceInfo(List<ServiceDescriptionPair> serviceDescription) { - for (Entry<String, Serializable> entry : serviceSideConnector.getProperties().entrySet()) { - ServiceDescriptionPair pair = new ServiceDescriptionPair(); - if (entry.getKey() != null && entry.getValue() != null) { - pair.setName(entry.getKey()); - pair.setValue(entry.getValue().toString()); - serviceDescription.add(pair); - } - } - } - - @Override - public void fail(Throwable th) { - OseeLog.log(getClass(), Level.SEVERE, th); - } - - @Override - public void success() { - } - +// private class ListenForHostRequest extends OseeMessagingListener { +// +// @Override +// public void process(Object message, Map<String, Object> headers, ReplyConnection replyConnection) { +// if (replyConnection.isReplyRequested()) { +// try { +// ByteArrayOutputStream baos = new ByteArrayOutputStream(); +// ObjectOutputStream oos = new ObjectOutputStream(baos); +// oos.writeObject(message); +// oos.writeObject(serviceSideConnector.getService()); +// replyConnection.send(baos.toByteArray(), null, OteServiceStarterImpl.this); +// } catch (OseeCoreException ex) { +// OseeLog.log(getClass(), Level.SEVERE, ex); +// } catch (IOException ex) { +// OseeLog.log(getClass(), Level.SEVERE, ex); +// } +// } +// } +// } +// +// @Override +// public void updateServiceInfo(List<ServiceDescriptionPair> serviceDescription) { +// for (Entry<String, Serializable> entry : serviceSideConnector.getProperties().entrySet()) { +// ServiceDescriptionPair pair = new ServiceDescriptionPair(); +// if (entry.getKey() != null && entry.getValue() != null) { +// pair.setName(entry.getKey()); +// pair.setValue(entry.getValue().toString()); +// serviceDescription.add(pair); +// } +// } +// } +// +// @Override +// public void fail(Throwable th) { +// OseeLog.log(getClass(), Level.SEVERE, th); +// } +// +// @Override +// public void success() { +// } +// private static class LookupRegistration implements Runnable { private final OTEMasterServer masterServer; diff --git a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/RemoteTestEnvironment.java b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/RemoteTestEnvironment.java index ef0f2c65a9c..dc30a36c109 100644 --- a/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/RemoteTestEnvironment.java +++ b/plugins/org.eclipse.osee.ote.server/src/org/eclipse/osee/ote/server/internal/RemoteTestEnvironment.java @@ -16,9 +16,9 @@ import java.util.HashMap; import java.util.List; import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; + import org.eclipse.osee.connection.service.IServiceConnector; import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.messaging.Message; import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; import org.eclipse.osee.ote.core.ServiceUtility; import org.eclipse.osee.ote.core.environment.console.ICommandManager; @@ -252,11 +252,11 @@ public class RemoteTestEnvironment implements ITestEnvironmentMessageSystem { Thread.currentThread().setContextClassLoader(ExportClassLoader.getInstance()); env.setBatchMode(isInBatchMode); } - - @Override - public void sendMessage(Message message) throws RemoteException { - Thread.currentThread().setContextClassLoader(ExportClassLoader.getInstance()); - env.sendMessageToServer(message); - } +// +// @Override +// public void sendMessage(Message message) throws RemoteException { +// Thread.currentThread().setContextClassLoader(ExportClassLoader.getInstance()); +// env.sendMessageToServer(message); +// } } diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerServiceStatusDataVisitor.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerServiceStatusDataVisitor.java index 9fa9dec112a..bd551dc923d 100644 --- a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerServiceStatusDataVisitor.java +++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerServiceStatusDataVisitor.java @@ -189,9 +189,10 @@ final class TestManagerServiceStatusDataVisitor implements IServiceStatusDataVis task.getScriptModel().getOutputModel().setPassedTestPoints(testPointUpdate.getPass()); task.getScriptModel().getOutputModel().setFailedTestPoints(testPointUpdate.getFail()); scriptManager.updateScriptTableViewerTimed(task); - } else { - OseeLog.log(TestManagerPlugin.class, Level.WARNING, "testPointsUpdated: task is null"); - } + } +// else { +// OseeLog.log(TestManagerPlugin.class, Level.WARNING, "testPointsUpdated: task is null"); +// } } }); logExecutorSize(); diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/ScriptPage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/ScriptPage.java index fc5ba7d2dae..8a4004cb39b 100644 --- a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/ScriptPage.java +++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/ScriptPage.java @@ -157,6 +157,9 @@ public abstract class ScriptPage extends TestManagerPage { AWorkbench.getDisplay().asyncExec(new Runnable() { @Override public void run() { + if(runButton.isDisposed()){ + return; + } if (running) { runButton.setEnabled(false); abortButton.setEnabled(true); |