Improve toString() representation for dynamic references and filters
git-svn-id: https://svn.apache.org/repos/asf/servicemix/smx4/nmr/trunk@706874 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/nmr/core/src/main/java/org/apache/servicemix/nmr/core/DynamicReferenceImpl.java b/nmr/core/src/main/java/org/apache/servicemix/nmr/core/DynamicReferenceImpl.java
index 5494188..72c43c9 100644
--- a/nmr/core/src/main/java/org/apache/servicemix/nmr/core/DynamicReferenceImpl.java
+++ b/nmr/core/src/main/java/org/apache/servicemix/nmr/core/DynamicReferenceImpl.java
@@ -68,4 +68,8 @@
this.matches = null;
}
+ public String toString() {
+ return "DynamicReference[filter=" + filter + "]";
+ }
+
}
diff --git a/nmr/core/src/main/java/org/apache/servicemix/nmr/core/EndpointRegistryImpl.java b/nmr/core/src/main/java/org/apache/servicemix/nmr/core/EndpointRegistryImpl.java
index d72cb05..0a46baf 100644
--- a/nmr/core/src/main/java/org/apache/servicemix/nmr/core/EndpointRegistryImpl.java
+++ b/nmr/core/src/main/java/org/apache/servicemix/nmr/core/EndpointRegistryImpl.java
@@ -202,6 +202,9 @@
}
return true;
}
+ public String toString() {
+ return properties.toString();
+ }
});
this.references.put(ref, true);
return ref;
@@ -226,7 +229,7 @@
* @param filter a LDAP filter used to find matching endpoints
* @return a new Reference that uses the given filter
*/
- public Reference lookup(String filter) {
+ public Reference lookup(final String filter) {
try {
try {
final org.osgi.framework.Filter flt = org.osgi.framework.FrameworkUtil.createFilter(filter);
@@ -235,6 +238,9 @@
Map<String, ?> props = EndpointRegistryImpl.this.getProperties(endpoint);
return flt.match(new MapToDictionary(props));
}
+ public String toString() {
+ return filter;
+ }
});
this.references.put(ref, true);
return ref;