Permalink
Browse files

Split message interface. Removed subscription stubs from queue.

  • Loading branch information...
1 parent 7ca80fe commit 76ce7c07589bc3ed6a047275072cc7daf4f943b7 Joern Barthel committed Aug 25, 2009
@@ -4,6 +4,7 @@
import org.apache.commons.logging.LogFactory;
import org.springframework.amqp.AMQException;
import org.springframework.amqp.message.Message;
+import org.springframework.amqp.message.SentMessage;
import java.io.IOException;
import java.util.Collections;
@@ -47,11 +48,11 @@ public void declare(boolean passive) throws IOException {
}
- public void send(Message message) {
+ public void send(SentMessage message) {
send(message, message.getHeader().getRoutingKey());
}
- public void send(Message message, String routingKey) {
+ public void send(SentMessage message, String routingKey) {
try {
getChannel().basicPublish(getName(),
@@ -1,11 +1,8 @@
package org.springframework.amqp.component;
-import org.springframework.amqp.message.MessageSink;
-import org.springframework.amqp.message.MessageSource;
-
import java.util.Set;
-public interface Queue extends NamedComponent, MessageSource {
+public interface Queue extends NamedComponent {
public enum Property implements CharSequence {
@@ -38,6 +35,4 @@ public String toString() {
public Set<CharSequence> getProperties();
- public void subscribe(MessageSink... messageSinks);
-
}
@@ -4,8 +4,7 @@
import org.apache.commons.logging.LogFactory;
import org.springframework.amqp.AMQException;
import org.springframework.amqp.component.util.CollectionUtil;
-import org.springframework.amqp.message.Message;
-import org.springframework.amqp.message.MessageSink;
+import org.springframework.amqp.message.SentMessage;
import java.io.IOException;
import java.util.Arrays;
@@ -55,15 +54,11 @@ public void declare(final boolean passive) {
}
- public void send(Message message) {
+ public void send(SentMessage message) {
//To change body of implemented methods use File | Settings | File Templates.
}
- public void send(Message message, String routingKey) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void subscribe(MessageSink... messageSinks) {
+ public void send(SentMessage message, String routingKey) {
//To change body of implemented methods use File | Settings | File Templates.
}
@@ -1,11 +1,7 @@
package org.springframework.amqp.message;
-import org.springframework.amqp.message.header.Header;
-
public interface Message {
- public Header getHeader();
-
public byte[] getBody();
}
@@ -3,7 +3,7 @@
import org.springframework.amqp.message.header.EmptyHeader;
import org.springframework.amqp.message.header.Header;
-public class MessageImpl extends AbstractMessage<Header> implements Message {
+public class MessageImpl extends AbstractMessage<Header> implements SentMessage {
public MessageImpl(byte[] body) {
super(body, EmptyHeader.INSTANCE);
@@ -2,8 +2,8 @@
public interface MessageSource {
- public void send(Message message);
+ public void send(SentMessage message);
- public void send(Message message, String routingKey);
+ public void send(SentMessage message, String routingKey);
}
@@ -0,0 +1,9 @@
+package org.springframework.amqp.message;
+
+import org.springframework.amqp.message.header.Header;
+
+public interface SentMessage extends Message {
+
+ public Header getHeader();
+
+}

0 comments on commit 76ce7c0

Please sign in to comment.