Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-11-07 20:12:15 -0500
committerRoberto E. Escobar2012-11-07 20:12:15 -0500
commitc04ce11db040bddd9eeda4790ba0065b26174c4e (patch)
tree099740462396d1734da91890f147d67c175ab298 /plugins/org.eclipse.osee.framework.messaging
parentb7bec492c86a57cda90eded1649d09b145f185e1 (diff)
downloadorg.eclipse.osee-c04ce11db040bddd9eeda4790ba0065b26174c4e.tar.gz
org.eclipse.osee-c04ce11db040bddd9eeda4790ba0065b26174c4e.tar.xz
org.eclipse.osee-c04ce11db040bddd9eeda4790ba0065b26174c4e.zip
feature[ats_TL5SF]: Add messaging tests to maven
Diffstat (limited to 'plugins/org.eclipse.osee.framework.messaging')
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/MessageServiceProxy.java2
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/RemoteServiceLookupProxy.java6
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/activemq/ConnectionNodeActiveMq.java52
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java2
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceLookupImpl.java5
6 files changed, 33 insertions, 37 deletions
diff --git a/plugins/org.eclipse.osee.framework.messaging/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.messaging/META-INF/MANIFEST.MF
index 1f44fffe7c..685e38732d 100644
--- a/plugins/org.eclipse.osee.framework.messaging/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.messaging/META-INF/MANIFEST.MF
@@ -119,15 +119,12 @@ Import-Package: javax.jms,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
- org.eclipse.osee.framework.jdk.core.util.time,
org.eclipse.osee.framework.logging,
- org.eclipse.osee.framework.plugin.core,
org.eclipse.osee.framework.plugin.core.util,
org.eclipse.osgi.framework.console,
org.osgi.framework,
org.osgi.util.tracker
Bundle-ActivationPolicy: lazy
-Eclipse-ExtensibleAPI: true
Export-Package: org.eclipse.osee.framework.messaging,
org.eclipse.osee.framework.messaging.definitions,
org.eclipse.osee.framework.messaging.id,
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/MessageServiceProxy.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/MessageServiceProxy.java
index 43fa8a6fee..e1c945589e 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/MessageServiceProxy.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/MessageServiceProxy.java
@@ -45,7 +45,7 @@ public class MessageServiceProxy implements MessageService {
messageService = null;
}
- MessageService getProxiedService() {
+ public MessageService getProxiedService() {
return messageService;
}
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/RemoteServiceLookupProxy.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/RemoteServiceLookupProxy.java
index a2a2f3a623..00876f438e 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/RemoteServiceLookupProxy.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/RemoteServiceLookupProxy.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.framework.messaging.internal;
import java.net.URI;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -31,6 +32,8 @@ import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader;
*/
public class RemoteServiceLookupProxy implements RemoteServiceLookup, RemoteServiceRegistrar {
+ private static final long SERVICE_LOOKUP_TIMEOUT = 30;
+
private ClassLoader contextClassLoader;
private RemoteServiceRegistrarImpl registrar;
private RemoteServiceLookupImpl lookup;
@@ -52,7 +55,8 @@ public class RemoteServiceLookupProxy implements RemoteServiceLookup, RemoteServ
registrar = new RemoteServiceRegistrarImpl(messageService.getDefault(), executor);
registrar.start();
- lookup = new RemoteServiceLookupImpl(messageService.getDefault(), executor);
+ lookup =
+ new RemoteServiceLookupImpl(messageService.getDefault(), executor, SERVICE_LOOKUP_TIMEOUT, TimeUnit.SECONDS);
lookup.start();
OseeLog.log(Activator.class, Level.INFO, "Remote Service Lookup - Started");
}
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/activemq/ConnectionNodeActiveMq.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/activemq/ConnectionNodeActiveMq.java
index 1caf4aa072..d9cef6cf61 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/activemq/ConnectionNodeActiveMq.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/activemq/ConnectionNodeActiveMq.java
@@ -20,7 +20,6 @@ import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
-
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.ExceptionListener;
@@ -32,7 +31,6 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TemporaryTopic;
import javax.jms.Topic;
-
import org.apache.activemq.ActiveMQConnectionFactory;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
@@ -80,7 +78,7 @@ class ConnectionNodeActiveMq implements ConnectionNodeFailoverSupport, MessageLi
regularListeners = new CompositeKeyHashMap<String, MessageConsumer, OseeMessagingListener>(64, true);
replyListeners = new ConcurrentHashMap<String, OseeMessagingListener>();
}
-
+
@Override
public synchronized void start() throws OseeCoreException {
if (started) {
@@ -122,12 +120,13 @@ class ConnectionNodeActiveMq implements ConnectionNodeFailoverSupport, MessageLi
try {
if (messageId.isTopic()) {
try {
- sendInternal(messageId, message, properties, statusCallback);
+ sendInternal(messageId, message, properties);
+ statusCallback.success();
} catch (JMSException ex) {
removeProducerFromCache(messageId);
- sendInternal(messageId, message, properties, statusCallback);
+ sendInternal(messageId, message, properties);
+ statusCallback.success();
}
- statusCallback.success();
}
} catch (Exception ex) {
statusCallback.fail(ex);
@@ -135,28 +134,28 @@ class ConnectionNodeActiveMq implements ConnectionNodeFailoverSupport, MessageLi
}
}
- private synchronized void sendInternal(MessageID messageId, Object message, Properties properties, OseeMessagingStatusCallback statusCallback) throws JMSException, OseeCoreException {
+ private synchronized void sendInternal(MessageID messageId, Object message, Properties properties) throws JMSException, OseeCoreException {
ConsoleDebugSupport support = ServiceUtility.getConsoleDebugSupport();
- if(support != null){
- if(support.getPrintSends()){
- System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++");
- System.out.println(messageId.getName() + " ==> " + new Date());
- if(properties != null){
- System.out.println("PROPERTIES:");
- System.out.println(properties.toString());
- }
- System.out.println("MESSAGE:");
- System.out.println(message.toString());
- System.out.println("STACK:");
- StackTraceElement[] stack = Thread.currentThread().getStackTrace();
- for(StackTraceElement el:stack){
- System.out.println(" " + el.toString());
- }
- System.out.println("-----------------------------------------------------------------------------");
- }
- support.addSend(messageId);
+ if (support != null) {
+ if (support.getPrintSends()) {
+ System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++");
+ System.out.println(messageId.getName() + " ==> " + new Date());
+ if (properties != null) {
+ System.out.println("PROPERTIES:");
+ System.out.println(properties.toString());
+ }
+ System.out.println("MESSAGE:");
+ System.out.println(message.toString());
+ System.out.println("STACK:");
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ for (StackTraceElement el : stack) {
+ System.out.println(" " + el.toString());
+ }
+ System.out.println("-----------------------------------------------------------------------------");
+ }
+ support.addSend(messageId);
}
- Topic destination = getOrCreateTopic(messageId);
+ Topic destination = getOrCreateTopic(messageId);
MessageProducer producer = getOrCreateProducer(destination);
Message msg = activeMqUtil.createMessage(session, messageId.getSerializationClass(), message);
if (messageId.isReplyRequired()) {
@@ -193,7 +192,6 @@ class ConnectionNodeActiveMq implements ConnectionNodeFailoverSupport, MessageLi
}
}
producer.send(msg);
- statusCallback.success();
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java
index 241546a001..f7e4257a73 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java
@@ -55,10 +55,8 @@ class MonitorTimedOutServices implements Runnable {
for (ThreeItems item : toRemove) {
Map<String, ServiceHealthPlusTimeout> innerMap = map.get(item.first, item.second);
innerMap.remove(item.key);
- System.out.println(item.key);
if (innerMap.isEmpty()) {
map.remove(item.first, item.second);
- System.out.println("removed " + item.first + item.second);
}
}
}
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceLookupImpl.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceLookupImpl.java
index beff750af7..9ab954fa76 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceLookupImpl.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/RemoteServiceLookupImpl.java
@@ -17,7 +17,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
-
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap;
import org.eclipse.osee.framework.jdk.core.type.Pair;
@@ -38,13 +37,13 @@ public class RemoteServiceLookupImpl implements RemoteServiceLookup {
private final CompositeKeyHashMap<String, String, List<ServiceNotification>> callbacks;
private final HealthServiceListener healthServiceListener;
- public RemoteServiceLookupImpl(ConnectionNode node, ScheduledExecutorService executor) {
+ public RemoteServiceLookupImpl(ConnectionNode node, ScheduledExecutorService executor, long serviceTimeout, TimeUnit unit) {
this.connectionNode = node;
map = new CompositeKeyHashMap<String, String, Map<String, ServiceHealthPlusTimeout>>(25, true);
callbacks = new CompositeKeyHashMap<String, String, List<ServiceNotification>>(25, true);
healthServiceListener = new HealthServiceListener(map, callbacks);
connectionNode.subscribeToReply(BaseMessages.ServiceHealthRequest, healthServiceListener);
- executor.scheduleAtFixedRate(new MonitorTimedOutServices(map, callbacks), 30, 30, TimeUnit.SECONDS);
+ executor.scheduleAtFixedRate(new MonitorTimedOutServices(map, callbacks), serviceTimeout, serviceTimeout, unit);
}
public void start() {

Back to the top