| Commit in servicemix/base/src/main/java/org/servicemix/jbi on MAIN | |||
| framework/Registry.java | +3 | -1 | 1.7 -> 1.8 |
| container/SubscriptionSpec.java | +22 | -2 | 1.4 -> 1.5 |
| +25 | -3 | ||
introduced Component id as part of hash/equals functions on the SubscriptionSpec
servicemix/base/src/main/java/org/servicemix/jbi/framework
diff -u -r1.7 -r1.8 --- Registry.java 22 Sep 2005 18:17:58 -0000 1.7 +++ Registry.java 5 Oct 2005 08:44:52 -0000 1.8 @@ -47,7 +47,7 @@
/** * Registry - state infomation including running state, SA's deployed etc. *
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class Registry extends BaseLifeCycle {
private final static Log log = LogFactory.getLog(Registry.class);
@@ -591,6 +591,7 @@
*/
public void registerSubscription(ComponentContextImpl context,SubscriptionSpec subscription, ServiceEndpoint endpoint) {
ServiceEndpointImpl sei = (ServiceEndpointImpl)endpoint;
+ subscription.setName(context.getComponentNameSpace());
subscriptionRegistry.registerSubscription(subscription,sei);
if (sei != null) {
ComponentConnector cc = componentRegistry.getComponentConnector(sei.getComponentNameSpace());
@@ -606,6 +607,7 @@
* @return the ServiceEndpoint
*/
public ServiceEndpointImpl deregisterSubscription(ComponentContextImpl context,SubscriptionSpec subscription) {
+ subscription.setName(context.getComponentNameSpace());
ServiceEndpointImpl result = subscriptionRegistry.deregisterSubscription(subscription);
if (result != null) {
ComponentConnector cc = componentRegistry.getComponentConnector(result.getComponentNameSpace());
servicemix/base/src/main/java/org/servicemix/jbi/container
diff -u -r1.4 -r1.5 --- SubscriptionSpec.java 22 Sep 2005 18:17:58 -0000 1.4 +++ SubscriptionSpec.java 5 Oct 2005 08:44:52 -0000 1.5 @@ -46,6 +46,7 @@
private QName operation;
private String endpoint;
private SubscriptionFilter filter;
+ private ComponentNameSpace name;
public String getEndpoint() {
return endpoint;
@@ -86,6 +87,20 @@
public void setService(QName service) {
this.service = service;
}
+
+ /**
+ * @return Returns the name.
+ */
+ public ComponentNameSpace getName(){
+ return name;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(ComponentNameSpace name){
+ this.name=name;
+ }
/**
* Returns true if this subscription matches the given message exchange
@@ -142,7 +157,8 @@
boolean result = false;
if(obj instanceof SubscriptionSpec){
SubscriptionSpec other = (SubscriptionSpec) obj;
- result = (service == null && other.service == null)
+ result = (name == null && other.name == null || name.equals(other.name)) && + (service == null && other.service == null)
|| (service != null && other.service != null && service.equals(other.service))
&& (interfaceName == null && other.interfaceName == null)
|| (interfaceName != null && other.interfaceName != null && interfaceName
@@ -157,6 +173,10 @@
* @see java.lang.Object#hashCode()
*/
public int hashCode(){
- return (service != null?service.hashCode():(interfaceName != null?interfaceName.hashCode():super.hashCode()));
+ return (name!=null?name.hashCode():0) + ^(service!=null?service.hashCode():(interfaceName!=null?interfaceName.hashCode():super + .hashCode()));
}
+ +
}
