From 32446c1f1db18d6908f9aff168b74c96bce7e1ad Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Tue, 24 Jan 2006 16:20:42 +0000 Subject: [PATCH] Fix for https://jira.logicblaze.com/jira/browse/AMQ-501 - ActiveMQManagedConnectionFactory now implements equals() and hashCode() - ActiveMQActivationSpec is now serializable. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@371951 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/ra/ActiveMQActivationSpec.java | 7 +++++-- .../ra/ActiveMQManagedConnectionFactory.java | 20 +++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java index e45998461c..058ecdbf98 100755 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java @@ -18,6 +18,7 @@ package org.apache.activemq.ra; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; +import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -42,8 +43,10 @@ import org.apache.activemq.selector.SelectorParser; * * @version $Revision$ $Date$ */ -public class ActiveMQActivationSpec implements ActivationSpec { +public class ActiveMQActivationSpec implements ActivationSpec, Serializable { + private static final long serialVersionUID = -7153087544100459975L; + /** Auto-acknowledge constant for acknowledgeMode property **/ public static final String AUTO_ACKNOWLEDGE_MODE = "Auto-acknowledge"; /** Dups-ok-acknowledge constant for acknowledgeMode property * */ @@ -55,7 +58,7 @@ public class ActiveMQActivationSpec implements ActivationSpec { public static final int INVALID_ACKNOWLEDGE_MODE = -1; - private ActiveMQResourceAdapter resourceAdapter; + private transient ActiveMQResourceAdapter resourceAdapter; private String destinationType; private String messageSelector; private String destination; diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnectionFactory.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnectionFactory.java index 0f804c114f..af37bf3442 100755 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnectionFactory.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnectionFactory.java @@ -57,6 +57,18 @@ public class ActiveMQManagedConnectionFactory implements ManagedConnectionFactor if (info.getUserName() == null) info.setUserName(baseInfo.getUserName()); } + + public boolean equals(Object object) { + if( object == null || object.getClass()!=ActiveMQManagedConnectionFactory.class ) { + return false; + } + return ((ActiveMQManagedConnectionFactory)object).info.equals(info); + } + + public int hashCode() { + return info.hashCode(); + } + public ResourceAdapter getResourceAdapter() { return adapter; @@ -145,10 +157,6 @@ public class ActiveMQManagedConnectionFactory implements ManagedConnectionFactor return info.getPassword(); } - public String getServerUrl() { - return info.getServerUrl(); - } - public String getUserName() { return info.getUserName(); } @@ -161,10 +169,6 @@ public class ActiveMQManagedConnectionFactory implements ManagedConnectionFactor info.setPassword(password); } - public void setServerUrl(String url) { - info.setServerUrl(url); - } - public void setUserName(String userid) { info.setUserName(userid); }