geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r631612 - in /geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc: AsyncHttpClient.java util/EventDispatcher.java
Date Wed, 27 Feb 2008 15:21:16 GMT
Author: rickmcguire
Date: Wed Feb 27 07:21:13 2008
New Revision: 631612

URL: http://svn.apache.org/viewvc?rev=631612&view=rev
Log:
GERONIMO-3877 AsyncHttpClient should provide a method that returns monitoring listeners

Patch provided by Sangjin Lee 


Modified:
    geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java
    geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/EventDispatcher.java

Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java?rev=631612&r1=631611&r2=631612&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java (original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java Wed
Feb 27 07:21:13 2008
@@ -655,6 +655,14 @@
             eventDispatcher.removeListener(listener);
         }
     }
+    
+    /**
+     * Returns the list of all listeners.  May return null if no listeners have
+     * been added.
+     */
+    public MonitoringListener[] getMonitoringListeners() {
+        return eventDispatcher == null ? null : eventDispatcher.getListeners();
+    }
 
     /**
      * Send a notification event to any monitoring listeners.

Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/EventDispatcher.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/EventDispatcher.java?rev=631612&r1=631611&r2=631612&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/EventDispatcher.java
(original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/EventDispatcher.java
Wed Feb 27 07:21:13 2008
@@ -68,6 +68,13 @@
     }
     
     /**
+     * Returns an array of the current monitoring listeners.
+     */
+    public MonitoringListener[] getListeners() {
+        return listeners.toArray(new MonitoringListener[0]);
+    }
+    
+    /**
      * Dispatch an event.  
      * 
      * @param event     The event to dispatch.



Mime
View raw message