Skip to content
Browse files

Make it simple to copy destinations.

  • Loading branch information...
1 parent 44201a7 commit 852c405da8e84962bc0ad8ff285b0c2060755575 @chirino chirino committed Jul 30, 2012
View
8 stompjms-client/src/main/java/org/fusesource/stomp/jms/StompJmsDestination.java
@@ -49,6 +49,13 @@ public StompJmsDestination(String prefix, String name) {
setName(name);
}
+ public StompJmsDestination copy() {
+ final StompJmsDestination copy = new StompJmsDestination();
+ copy.setProperties(getProperties());
+ return copy;
+ }
+
+
public String toString() {
if (toString == null) {
toString = getPrefix() + getName();
@@ -212,4 +219,5 @@ public void setSubscribeHeaders(Map<String, String> subscribeHeaders) {
public String getPhysicalName() {
return getName();
}
+
}
View
6 stompjms-client/src/main/java/org/fusesource/stomp/jms/StompJmsQueue.java
@@ -25,6 +25,12 @@ public StompJmsQueue(StompJmsConnection connection, String name) {
this(connection.queuePrefix, name);
}
+ public StompJmsQueue copy() {
+ final StompJmsQueue copy = new StompJmsQueue();
+ copy.setProperties(getProperties());
+ return copy;
+ }
+
/**
* Constructor
*
View
10 stompjms-client/src/main/java/org/fusesource/stomp/jms/StompJmsTempQueue.java
@@ -18,10 +18,20 @@
*/
public class StompJmsTempQueue extends StompJmsDestination implements TemporaryQueue {
+ public StompJmsTempQueue() {
+ super(null, null);
+ }
+
public StompJmsTempQueue(String prefix, String name) {
super(prefix, name);
}
+ public StompJmsTempQueue copy() {
+ final StompJmsTempQueue copy = new StompJmsTempQueue();
+ copy.setProperties(getProperties());
+ return copy;
+ }
+
/**
* @see javax.jms.TemporaryQueue#delete()
*/
View
9 stompjms-client/src/main/java/org/fusesource/stomp/jms/StompJmsTempTopic.java
@@ -18,10 +18,19 @@
*/
public class StompJmsTempTopic extends StompJmsDestination implements TemporaryTopic {
+ public StompJmsTempTopic() {
+ this(null, null);
+ }
public StompJmsTempTopic(String prefix, String name) {
super(prefix, name);
}
+ public StompJmsTempTopic copy() {
+ final StompJmsTempTopic copy = new StompJmsTempTopic();
+ copy.setProperties(getProperties());
+ return copy;
+ }
+
/**
* @see javax.jms.TemporaryTopic#delete()
*/
View
7 stompjms-client/src/main/java/org/fusesource/stomp/jms/StompJmsTopic.java
@@ -25,6 +25,13 @@ public StompJmsTopic(StompJmsConnection connection, String name) {
this(connection.topicPrefix, name);
}
+ public StompJmsTopic copy() {
+ final StompJmsTopic copy = new StompJmsTopic();
+ copy.setProperties(getProperties());
+ return copy;
+ }
+
+
/**
* Constructor
*

0 comments on commit 852c405

Please sign in to comment.
Something went wrong with that request. Please try again.