maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r658122 - /maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEventSupport.java
Date Tue, 20 May 2008 06:44:04 GMT
Author: brett
Date: Mon May 19 23:44:04 2008
New Revision: 658122

URL: http://svn.apache.org/viewvc?rev=658122&view=rev
Log:
[WAGON-79] synchronize methods so that listener changes won't break iterators
Submitted by: nicolas de loof

Modified:
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEventSupport.java

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEventSupport.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEventSupport.java?rev=658122&r1=658121&r2=658122&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEventSupport.java
(original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEventSupport.java
Mon May 19 23:44:04 2008
@@ -49,7 +49,7 @@
      * @see #removeTransferListener(org.apache.maven.wagon.events.TransferListener)
      * @see TransferListener
      */
-    public void addTransferListener( final TransferListener listener )
+    public synchronized void addTransferListener( final TransferListener listener )
     {
         if ( listener != null )
         {
@@ -68,7 +68,7 @@
      * @param listener the transfer listener
      * @see #addTransferListener(TransferListener)
      */
-    public void removeTransferListener( final TransferListener listener )
+    public synchronized void removeTransferListener( final TransferListener listener )
     {
         listeners.remove( listener );
     }
@@ -85,7 +85,7 @@
      * @see org.apache.maven.wagon.events.TransferEvent
      * @see #addTransferListener(TransferListener)
      */
-    public boolean hasTransferListener( final TransferListener listener )
+    public synchronized boolean hasTransferListener( final TransferListener listener )
     {
         return listeners.contains( listener );
     }
@@ -98,7 +98,7 @@
      *
      * @param transferEvent the TransferEvent which will be dispached to listeners
      */
-    public void fireTransferStarted( final TransferEvent transferEvent )
+    public synchronized void fireTransferStarted( final TransferEvent transferEvent )
     {
         for ( Iterator iter = listeners.iterator(); iter.hasNext(); )
         {
@@ -116,7 +116,7 @@
      * @param buffer        the buffer containing the additional content
      * @param length        the length of the content in the buffer
      */
-    public void fireTransferProgress( final TransferEvent transferEvent, byte[] buffer, int
length )
+    public synchronized void fireTransferProgress( final TransferEvent transferEvent, byte[]
buffer, int length )
     {
         for ( Iterator iter = listeners.iterator(); iter.hasNext(); )
         {
@@ -133,7 +133,7 @@
      *
      * @param transferEvent the TransferEvent which will be dispached to listeners
      */
-    public void fireTransferCompleted( final TransferEvent transferEvent )
+    public synchronized void fireTransferCompleted( final TransferEvent transferEvent )
     {
         for ( Iterator iter = listeners.iterator(); iter.hasNext(); )
         {
@@ -151,7 +151,7 @@
      *
      * @param transferEvent the TransferEvent which will be dispached to listeners
      */
-    public void fireTransferError( final TransferEvent transferEvent )
+    public synchronized void fireTransferError( final TransferEvent transferEvent )
     {
         for ( Iterator iter = listeners.iterator(); iter.hasNext(); )
         {
@@ -167,7 +167,7 @@
      *
      * @param message the debug message which will be dispached to listeners
      */
-    public void fireDebug( final String message )
+    public synchronized void fireDebug( final String message )
     {
 
         for ( Iterator iter = listeners.iterator(); iter.hasNext(); )
@@ -185,7 +185,7 @@
      *
      * @param transferEvent the TransferEvent which will be dispached to listeners
      */
-    public void fireTransferInitiated( final TransferEvent transferEvent )
+    public synchronized void fireTransferInitiated( final TransferEvent transferEvent )
     {
         for ( Iterator iter = listeners.iterator(); iter.hasNext(); )
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-commits-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-commits-help@maven.apache.org


Mime
View raw message