jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1494169 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java
Date Tue, 18 Jun 2013 15:20:49 GMT
Author: jukka
Date: Tue Jun 18 15:20:49 2013
New Revision: 1494169

URL: http://svn.apache.org/r1494169
Log:
JCR-3608: MBeans for tracking event listeners

Better toString() method for the ListenerTracker

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java?rev=1494169&r1=1494168&r2=1494169&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java
Tue Jun 18 15:20:49 2013
@@ -228,6 +228,34 @@ public class ListenerTracker {
 
     @Override
     public String toString() {
+        StringBuilder builder = new StringBuilder();
+        if (absPath != null) {
+            builder.append(absPath);
+        }
+        if (isDeep) {
+            builder.append("//*");
+        } else {
+            builder.append("/*");
+        }
+        builder.append('[');
+        builder.append(Integer.toBinaryString(eventTypes));
+        builder.append('b');
+        if (uuid != null) {
+            for (String id : uuid) {
+                builder.append(", ");
+                builder.append(id);
+            }
+        }
+        if (nodeTypeName != null) {
+            for (String name : nodeTypeName) {
+                builder.append(", ");
+                builder.append(name);
+            }
+        }
+        if (noLocal) {
+            builder.append(", local");
+        }
+        builder.append(']');
         return listener.getClass().getSimpleName();
     }
 



Mime
View raw message