Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorafinkbein2010-06-28 17:03:11 -0400
committerafinkbein2010-06-28 17:03:11 -0400
commit8860cd927e8f54b2f1ac4a58d55a382ce5254ebb (patch)
treeb219d0331d35fd2a008fa88b4cd4744d0bb96e3e /plugins/org.eclipse.osee.framework.messaging
parentd782e6ed092c53a9e7104a7640eb7febbd2d1b33 (diff)
downloadorg.eclipse.osee-8860cd927e8f54b2f1ac4a58d55a382ce5254ebb.tar.gz
org.eclipse.osee-8860cd927e8f54b2f1ac4a58d55a382ce5254ebb.tar.xz
org.eclipse.osee-8860cd927e8f54b2f1ac4a58d55a382ce5254ebb.zip
cleaned up some messaging interfaces
Diffstat (limited to 'plugins/org.eclipse.osee.framework.messaging')
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/MessageID.java6
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/SystemTopic.java9
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/internal/activemq/ConnectionNodeActiveMq.java18
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/BaseMessages.java28
4 files changed, 21 insertions, 40 deletions
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/MessageID.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/MessageID.java
index 60cb1ae49e..ca2682cd33 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/MessageID.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/MessageID.java
@@ -5,17 +5,15 @@
*/
package org.eclipse.osee.framework.messaging;
-import org.eclipse.osee.framework.core.data.Identity;
import org.eclipse.osee.framework.core.data.Named;
/**
* @author Andrew M. Finkbeiner
*
*/
-public interface MessageID extends Named, Identity{
-
- String getMessageDestination();
+public interface MessageID extends Named {
Class<?> getSerializationClass();
boolean isReplyRequired();
boolean isTopic();
+ String getId();
}
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/SystemTopic.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/SystemTopic.java
index 6852f20665..0b319e5a43 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/SystemTopic.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/SystemTopic.java
@@ -10,7 +10,7 @@ package org.eclipse.osee.framework.messaging;
*/
public enum SystemTopic implements MessageID {
- JMS_HEALTH_STATUS("topic:jms.health.status"),
+ JMS_HEALTH_STATUS("jms.health.status"),
KILL_TEST_JMS_BROKER("jms.kill.broker");
private String name;
@@ -25,11 +25,6 @@ public enum SystemTopic implements MessageID {
}
@Override
- public String getMessageDestination() {
- return name;
- }
-
- @Override
public Class<?> getSerializationClass() {
return null;
}
@@ -40,7 +35,7 @@ public enum SystemTopic implements MessageID {
}
@Override
- public String getGuid() {
+ public String getId() {
return name;
}
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 398eef8b94..7291839ed7 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
@@ -14,7 +14,6 @@ import java.util.Map.Entry;
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;
@@ -26,7 +25,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.OseeWrappedException;
@@ -166,7 +164,7 @@ class ConnectionNodeActiveMq implements ConnectionNodeFailoverSupport, MessageLi
destination = getOrCreateTopic(messageId);
MessageConsumer consumer = session.createConsumer(destination);
consumer.setMessageListener(new ActiveMqMessageListenerWrapper(activeMqUtil, replyProducer, session, listener));
- regularListeners.put(messageId.getGuid(), consumer, listener);
+ regularListeners.put(messageId.getId(), consumer, listener);
statusCallback.success();
} else {
statusCallback.fail(new OseeCoreException("This connection is not started."));
@@ -186,7 +184,7 @@ class ConnectionNodeActiveMq implements ConnectionNodeFailoverSupport, MessageLi
destination = getOrCreateTopic(messageId);
MessageConsumer consumer = session.createConsumer(destination, selector);
consumer.setMessageListener(new ActiveMqMessageListenerWrapper(activeMqUtil, replyProducer, session, listener));
- regularListeners.put(messageId.getGuid(), consumer, listener);
+ regularListeners.put(messageId.getId(), consumer, listener);
statusCallback.success();
} else {
statusCallback.fail(new OseeCoreException("This connection is not started."));
@@ -199,10 +197,10 @@ class ConnectionNodeActiveMq implements ConnectionNodeFailoverSupport, MessageLi
}
private Topic getOrCreateTopic(MessageID messageId) throws JMSException {
- Topic topic = topicCache.get(messageId.getGuid());
+ Topic topic = topicCache.get(messageId.getId());
if (topic == null) {
- topic = session.createTopic(messageId.getGuid());
- topicCache.put(messageId.getGuid(), topic);
+ topic = session.createTopic(messageId.getId());
+ topicCache.put(messageId.getId(), topic);
}
return topic;
}
@@ -224,13 +222,13 @@ class ConnectionNodeActiveMq implements ConnectionNodeFailoverSupport, MessageLi
@Override
public boolean subscribeToReply(MessageID messageId, OseeMessagingListener listener) {
- replyListeners.put(messageId.getGuid(), listener);
+ replyListeners.put(messageId.getId(), listener);
return true;
}
@Override
public void unsubscribe(MessageID messageId, OseeMessagingListener listener, OseeMessagingStatusCallback statusCallback) {
- Map<MessageConsumer, OseeMessagingListener> listeners = regularListeners.getKeyedValues(messageId.getGuid());
+ Map<MessageConsumer, OseeMessagingListener> listeners = regularListeners.getKeyedValues(messageId.getId());
List<MessageConsumer> consumersToRemove = new ArrayList<MessageConsumer>();
if (listeners != null) {
try{
@@ -253,7 +251,7 @@ class ConnectionNodeActiveMq implements ConnectionNodeFailoverSupport, MessageLi
@Override
public boolean unsubscribteToReply(MessageID messageId, OseeMessagingListener listener) {
- replyListeners.remove(messageId.getGuid());
+ replyListeners.remove(messageId.getId());
return true;
}
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/BaseMessages.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/BaseMessages.java
index 6897e84e6d..36fdb21624 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/BaseMessages.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/BaseMessages.java
@@ -15,16 +15,15 @@ import org.eclipse.osee.framework.messaging.services.messages.Synch;
*
*/
public enum BaseMessages implements MessageID {
- ServiceHealth(true, "ABjyjamBQRvvAGcWpRQA", "topic:osee.message.core.ServiceHealth", ServiceHealth.class, false),
- ServiceHealthRequest(true, "ABkAHOSFQ3VUZcfzsAgA", "topic:osee.message.core.ServiceHealthRequest", ServiceHealthRequest.class, true),
- Synch(true, "ABkweOSFQ3yuZcfzsAgA", "topic:osee.message.core.ServiceHealthRequest", Synch.class, true);
+ ServiceHealth(true, "ABjyjamBQRvvAGcWpRQA", "osee.message.core.ServiceHealth", ServiceHealth.class, false),
+ ServiceHealthRequest(true, "ABkAHOSFQ3VUZcfzsAgA", "osee.message.core.ServiceHealthRequest", ServiceHealthRequest.class, true),
+ Synch(true, "ABkweOSFQ3yuZcfzsAgA", "osee.message.core.ServiceHealthRequest", Synch.class, true);
private String name;
private Class<?> clazz;
boolean isReplyRequired;
- private String guid;
- private String destination;
private boolean isTopic;
+ private String guid;
BaseMessages(boolean isTopic, String guid, String name, Class<?> clazz, boolean isReplyRequired){
this.guid = guid;
@@ -32,11 +31,6 @@ public enum BaseMessages implements MessageID {
this.clazz = clazz;
this.isReplyRequired = isReplyRequired;
this.isTopic = isTopic;
- if(isTopic){
- destination = "topic:"+guid;
- } else {
- destination = guid;
- }
}
@Override
@@ -55,16 +49,12 @@ public enum BaseMessages implements MessageID {
}
@Override
- public String getGuid() {
- return guid;
- }
-
- @Override
- public String getMessageDestination() {
- return destination;
- }
-
public boolean isTopic(){
return isTopic;
}
+
+ @Override
+ public String getId() {
+ return guid;
+ }
}

Back to the top